incubator-yoko-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r487250 - /incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaTypeTest.java
Date Thu, 14 Dec 2006 16:28:06 GMT
Author: bravi
Date: Thu Dec 14 08:28:05 2006
New Revision: 487250

URL: http://svn.apache.org/viewvc?view=rev&rev=487250
Log:
[YOKO-245] Updates to the type test framework to allow for running the client and server separately.

Modified:
    incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaTypeTest.java

Modified: incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaTypeTest.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaTypeTest.java?view=diff&rev=487250&r1=487249&r2=487250
==============================================================================
--- incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaTypeTest.java
(original)
+++ incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaTypeTest.java
Thu Dec 14 08:28:05 2006
@@ -39,14 +39,21 @@
 
     public static Test suite() throws Exception {
         TestSuite suite = new TestSuite(CorbaTypeTest.class);
-        return new CorbaTypeTestSetup(suite);
+        return new CorbaTypeTestSetup(suite) {
+                public void setUp() throws Exception {
+                    super.setUp();
+                    initClient(AbstractTypeTestClient.class, SERVICE_NAME, PORT_NAME, WSDL_PATH);
+                }
+            };
     }
 
-    public static void main(String[] args) {
-        junit.textui.TestRunner.run(CorbaTypeTest.class);
+    public static void main(String[] args) throws Exception {
+        initClient(AbstractTypeTestClient.class, SERVICE_NAME, PORT_NAME, WSDL_PATH);
+        junit.textui.TestRunner.run(CorbaTypeTest.class);       
     }
 
     public void testVoid() throws Exception {
+        //super.testVoid();
     }
 
     public void testOneway() throws Exception {
@@ -170,21 +177,25 @@
     public void testHexBinary() throws Exception  {
     }
 
-    static class CorbaTypeTestSetup extends TestSetup {
+    static abstract class CorbaTypeTestSetup extends TestSetup {
 
         ServerLauncher sl = null;
 
-        public CorbaTypeTestSetup(Test test) {
-            super(test);
-            java.util.Map<String, String> properties = new java.util.HashMap<String,
String>();
-            properties.put("java.endorsed.dirs", System.getProperty("java.endorsed.dirs"));
-            sl = new ServerLauncher(CorbaTypeTestServer.class.getName(), properties, null);
+        public CorbaTypeTestSetup(Test tester) {
+            super(tester);
+            boolean startServer = !Boolean.getBoolean("NO_SERVER_START");
+            if (startServer) {
+                java.util.Map<String, String> properties = new java.util.HashMap<String,
String>();
+                properties.put("java.endorsed.dirs", System.getProperty("java.endorsed.dirs"));
+                sl = new ServerLauncher(CorbaTypeTestServer.class.getName(), properties,
null);
+            }
         }
 
         public void setUp() throws Exception {
-            boolean ok = sl.launchServer();
-            assertTrue("failed to launch server", ok);
-            initClient(AbstractTypeTestClient.class, SERVICE_NAME, PORT_NAME, WSDL_PATH);
+            if (sl != null) {
+                boolean ok = sl.launchServer();
+                assertTrue("failed to launch server", ok);
+            }
         }
 
         public void tearDown() throws Exception {



Mime
View raw message