Index: /trunk/src/VBox/Main/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Main/Makefile.kmk	(revision 38913)
+++ /trunk/src/VBox/Main/Makefile.kmk	(revision 38914)
@@ -933,4 +933,6 @@
 	$(VBOX_JAR) cf $@ -C $(VBOX_JMSCOM_JDEST) .
 
+## @todo compile TestVBox.java (see below) to have sanity checking
+
 endif # VBOX_WITH_JMSCOM
 
@@ -943,5 +945,5 @@
 javagluesample_SOURCES = \
 	$(VBOX_PATH_MAIN_SRC)/glue/tests/TestVBox.java=>TestVBox.java \
-	$(VBOX_PATH_MAIN_SRC)/glue/tests/Makefile.kmk=>Makefile.kmk
+	$(VBOX_PATH_MAIN_SRC)/glue/tests/Makefile=>Makefile
 
 updatenls::
Index: /trunk/src/VBox/Main/glue/tests/Makefile
===================================================================
--- /trunk/src/VBox/Main/glue/tests/Makefile	(revision 38914)
+++ /trunk/src/VBox/Main/glue/tests/Makefile	(revision 38914)
@@ -0,0 +1,50 @@
+#
+# Copyright (C) 2010-2011 Oracle Corporation
+#
+# This file is part of VirtualBox Open Source Edition (OSE), as
+# available from http://www.virtualbox.org. This file is free software;
+# you can redistribute it and/or modify it under the terms of the GNU
+# General Public License (GPL) as published by the Free Software
+# Foundation, in version 2 as it comes in the "COPYING" file of the
+# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+#
+
+HOSTOS=linux
+VBOX_BIN = ../../../..
+VBOX_SDK = ../../..
+JACOB_DIR =
+CLASSPATH = .
+
+ifeq ($(HOSTOS),win)
+ JACOB_JAR=$(JACOB_DIR)/jacob.jar
+ VBOX_JAR=$(VBOX_SDK)/bindings/mscom/java/vboxjmscom.jar
+ SEP=\;
+ JAVA_COM_ARGS += -Djava.library.path=$(JACOB_DIR)
+ CLASSPATH += $(JACOB_JAR)$(SEP)
+else
+ VBOX_JAR=$(VBOX_SDK)/bindings/xpcom/java/vboxjxpcom.jar
+ SEP=:
+ JAVA_COM_ARGS += -Dvbox.home=$(VBOX_BIN)
+endif
+
+VBOX_JAR_WS=$(VBOX_SDK)/bindings/webservice/java/jax-ws/vboxjws.jar
+
+
+all: ws/TestVBox.class com/TestVBox.class
+
+test: ws/test-TestVBox com/test-TestVBox
+
+com/TestVBox.class:
+	@mkdir com 2>/dev/null || true
+	javac -g -d com -cp $(VBOX_JAR)$(SEP)$(CLASSPATH) TestVBox.java
+
+com/test-TestVBox: com/TestVBox.class
+	java $(JAVA_COM_ARGS) -cp com$(SEP)$(VBOX_JAR)$(SEP)$(CLASSPATH) TestVBox
+
+ws/TestVBox.class:
+	@mkdir ws 2>/dev/null || true
+	javac -d ws -cp $(VBOX_JAR_WS)$(SEP)$(CLASSPATH) TestVBox.java
+
+ws/test-TestVBox: ws/TestVBox.class
+	java $(JAVA_WS_ARGS) -cp ws$(SEP)$(VBOX_JAR_WS)$(SEP)$(CLASSPATH) TestVBox -w -url http://localhost:18083/
Index: unk/src/VBox/Main/glue/tests/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Main/glue/tests/Makefile.kmk	(revision 38913)
+++ 	(revision )
@@ -1,61 +1,0 @@
-#
-# Copyright (C) 2010 Oracle Corporation
-#
-# This file is part of VirtualBox Open Source Edition (OSE), as
-# available from http://www.virtualbox.org. This file is free software;
-# you can redistribute it and/or modify it under the terms of the GNU
-# General Public License (GPL) as published by the Free Software
-# Foundation, in version 2 as it comes in the "COPYING" file of the
-# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
-# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
-#
-ifeq ($(KBUILD_HOST),darwin)
- VBOX_BIN=/Applications/VirtualBox.app/Contents/MacOS
- VBOX_SDK=$(VBOX_BIN)/sdk
- JAVA15=/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Commands/java
-# JAVA_ARGS += -d32
-endif
-
-ifeq ($(KBUILD_HOST),linux)
- VBOX_BIN=/home/nike/work/ws/out/linux.amd64/debug/bin
- VBOX_SDK=$(VBOX_BIN)/sdk
-endif
-
-ifeq ($(KBUILD_HOST),win)
- VBOX_BIN=e:/ws/out/win.amd64/debug/bin
- VBOX_SDK=$(VBOX_BIN)/sdk
- JACOB_DIR=s:/jacob-1.15-M3/
- JACOB_JAR=$(JACOB_DIR)/jacob.jar
- CLASSPATH += $(JACOB_JAR)$(SEP)
- JAVA_ARGS += -Djava.library.path=$(JACOB_DIR)
-endif
-
-ifeq ($(KBUILD_HOST),win)
- VBOX_JAR=$(VBOX_SDK)/bindings/mscom/java/vboxjmscom.jar
- SEP=\;
-else
- VBOX_JAR=$(VBOX_SDK)/bindings/xpcom/java/vboxjxpcom.jar
- SEP=:
-endif
-
-VBOX_JAR_WS=$(VBOX_SDK)/bindings/webservice/java/jax-ws/vboxjws.jar
-
-JAVA_ARGS += -Dvbox.home=$(VBOX_BIN)
-CLASSPATH  := $(CLASSPATH)$(VBOX_JAR)$(SEP).
-
-all: testvb
-
-testvb:
-	javac -cp $(VBOX_JAR) TestVBox.java
-	java $(JAVA_ARGS) -cp $(CLASSPATH)  TestVBox
-
-JAXLIBS=../../webservice/jaxlibs/
-# -noverify could be needed due http://bugs.sun.com/bugdatabase/view_bug.do;jsessionid=eb3fcd8f72ab4713f96e378a7575?bug_id=6614974
-testws15:
-	javac -target 1.5 -source 1.5 -cp $(VBOX_JAR) TestVBox.java
-	$(JAVA15) $(JAVA_ARGS) -cp $(VBOX_JAR_WS)$(SEP)$(CLASSPATH)$(SEP)$(JAXLIBS)/jaxws-api.jar$(SEP)$(JAXLIBS)/jaxws-rt.jar \
-            TestVBox -w -url http://localhost:18083
-
-testws:
-	javac -cp $(VBOX_JAR_WS) TestVBox.java
-	java $(JAVA_ARGS) -cp $(VBOX_JAR_WS)$(SEP)$(CLASSPATH) TestVBox -w -url http://localhost:18083
Index: /trunk/src/VBox/Main/glue/tests/TestVBox.java
===================================================================
--- /trunk/src/VBox/Main/glue/tests/TestVBox.java	(revision 38913)
+++ /trunk/src/VBox/Main/glue/tests/TestVBox.java	(revision 38914)
@@ -1,5 +1,9 @@
 /* $Id$ */
+
+/* Small sample/testcase which demonstrates that the same source code can
+ * be used to connect to the webservice and (XP)COM APIs. */
+
 /*
- * Copyright (C) 2010 Oracle Corporation
+ * Copyright (C) 2010-2011 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -11,5 +15,5 @@
  * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
  */
-import org.virtualbox_4_1.*;
+import org.virtualbox_4_2.*;
 import java.util.List;
 import java.util.Arrays;
@@ -60,8 +64,8 @@
 
         try {
-            for (int i=0; i<100; i++)
+            for (int i=0; i<50; i++)
             {
                 System.out.print(".");
-                IEvent ev = es.getEvent(listener, 1000);
+                IEvent ev = es.getEvent(listener, 500);
                 if (ev != null)
                 {
@@ -82,8 +86,30 @@
         for (IMachine m : machs)
         {
-            System.out.println("VM name: " + m.getName());// + ", RAM size: " + m.getMemorySize() + "MB");
-            System.out.println(" HWVirt: " + m.getHWVirtExProperty(HWVirtExPropertyType.Enabled)
-                               + ", Nested Paging: " + m.getHWVirtExProperty(HWVirtExPropertyType.NestedPaging)
-                               + ", PAE: " + m.getCPUProperty(CPUPropertyType.PAE) );
+            String name;
+            Long ram = 0L;
+            boolean hwvirtEnabled = false, hwvirtNestedPaging = false;
+            boolean paeEnabled = false;
+            boolean inaccessible = false;
+            try
+            {
+                name = m.getName();
+                ram = m.getMemorySize();
+                hwvirtEnabled = m.getHWVirtExProperty(HWVirtExPropertyType.Enabled);
+                hwvirtNestedPaging = m.getHWVirtExProperty(HWVirtExPropertyType.NestedPaging);
+                paeEnabled = m.getCPUProperty(CPUPropertyType.PAE);
+            }
+            catch (VBoxException e)
+            {
+                name = "<inaccessible>";
+                inaccessible = true;
+            }
+            System.out.println("VM name: " + name);
+            if (!inaccessible)
+            {
+                System.out.println(" RAM size: " + ram + "MB"
+                                   + ", HWVirt: " + hwvirtEnabled
+                                   + ", Nested Paging: " + hwvirtNestedPaging
+                                   + ", PAE: " + paeEnabled);
+            }
         }
     }
@@ -171,5 +197,5 @@
                 System.out.println("VirtualBox version: " + vbox.getVersion() + "\n");
                 testEnumeration(mgr, vbox);
-                //testReadLog(mgr, vbox);
+                testReadLog(mgr, vbox);
                 testStart(mgr, vbox);
                 testEvents(mgr, vbox.getEventSource());
Index: /trunk/src/VBox/Main/webservice/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Main/webservice/Makefile.kmk	(revision 38913)
+++ /trunk/src/VBox/Main/webservice/Makefile.kmk	(revision 38914)
@@ -402,4 +402,6 @@
 	$(VBOX_JAR) cf $@ -C $(VBOX_JWS_GEN)/java .
 
+## @todo compile ../glue/tests/TestVBox.java to have sanity checking
+
  endif # VBOX_WITH_JWS
 
