incubator-yoko-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r554983 - in /incubator/yoko/trunk/core/src/test/java: org/apache/yoko/AbstractOrbTestBase.java org/apache/yoko/CodeSetTest.java org/apache/yoko/IIOPPluginTest.java org/apache/yoko/LocalTest.java test/codesets/Client.java
Date Tue, 10 Jul 2007 15:38:17 GMT
Author: bravi
Date: Tue Jul 10 08:38:17 2007
New Revision: 554983

URL: http://svn.apache.org/viewvc?view=rev&rev=554983
Log:
[YOKO-48] - Updated test cases for clients to wait for the server to output a file.

Modified:
    incubator/yoko/trunk/core/src/test/java/org/apache/yoko/AbstractOrbTestBase.java
    incubator/yoko/trunk/core/src/test/java/org/apache/yoko/CodeSetTest.java
    incubator/yoko/trunk/core/src/test/java/org/apache/yoko/IIOPPluginTest.java
    incubator/yoko/trunk/core/src/test/java/org/apache/yoko/LocalTest.java
    incubator/yoko/trunk/core/src/test/java/test/codesets/Client.java

Modified: incubator/yoko/trunk/core/src/test/java/org/apache/yoko/AbstractOrbTestBase.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/core/src/test/java/org/apache/yoko/AbstractOrbTestBase.java?view=diff&rev=554983&r1=554982&r2=554983
==============================================================================
--- incubator/yoko/trunk/core/src/test/java/org/apache/yoko/AbstractOrbTestBase.java (original)
+++ incubator/yoko/trunk/core/src/test/java/org/apache/yoko/AbstractOrbTestBase.java Tue Jul
10 08:38:17 2007
@@ -38,7 +38,6 @@
  * can be used to set the name of this file, which varies in the ORB tests.
  */
 public class AbstractOrbTestBase extends TestCase {
-    protected static final File TEST_REF_FILE = new File("Test.ref");
     protected ProcessManager processManager;
     protected JavaProcess server, client;
     protected File waitForFile;
@@ -91,9 +90,6 @@
         server.launch();
         Thread serverThread = server.invokeMainAsync(serverClass, serverArgs);
         waitForFile();
-        // TODO: Need to find a better way, this slows down testing unneccesarily,
-        // and is somewhat non-robust.
-        Thread.sleep(1000);
         client.invokeMain(clientClass, clientArgs);
         serverThread.join();
         server.exit(0);
@@ -110,6 +106,7 @@
         
     protected void waitForFile() {
         long timeBefore = System.currentTimeMillis();
+        System.out.println("Waiting for file... " + getWaitForFile());
         if(getWaitForFile() != null) {
             while(true) {
                 try {

Modified: incubator/yoko/trunk/core/src/test/java/org/apache/yoko/CodeSetTest.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/core/src/test/java/org/apache/yoko/CodeSetTest.java?view=diff&rev=554983&r1=554982&r2=554983
==============================================================================
--- incubator/yoko/trunk/core/src/test/java/org/apache/yoko/CodeSetTest.java (original)
+++ incubator/yoko/trunk/core/src/test/java/org/apache/yoko/CodeSetTest.java Tue Jul 10 08:38:17
2007
@@ -1,11 +1,11 @@
 /**
  *
- * Licensed to the Apache Software Foundation (ASF) under one or more
-*  contributor license agreements.  See the NOTICE file distributed with
-*  this work for additional information regarding copyright ownership.
-*  The ASF licenses this file to You under the Apache License, Version 2.0
-*  (the "License"); you may not use this file except in compliance with
-*  the License.  You may obtain a copy of the License at
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
  *
  *     http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -20,6 +20,12 @@
 public class CodeSetTest extends AbstractOrbTestBase {
     private static final String SERVER_CLASS = "test.codesets.Server";
     private static final String CLIENT_CLASS = "test.codesets.Client";
+    private static final String OUTPUT_FILE = "TestCodeSets.ref";
+
+    public void setUp() throws Exception {
+        super.setUp();
+        setWaitForFile(new java.io.File(OUTPUT_FILE));
+    }
         
     public void testStandardCodeSet() throws Exception {
         runServerClientTest(SERVER_CLASS, CLIENT_CLASS);

Modified: incubator/yoko/trunk/core/src/test/java/org/apache/yoko/IIOPPluginTest.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/core/src/test/java/org/apache/yoko/IIOPPluginTest.java?view=diff&rev=554983&r1=554982&r2=554983
==============================================================================
--- incubator/yoko/trunk/core/src/test/java/org/apache/yoko/IIOPPluginTest.java (original)
+++ incubator/yoko/trunk/core/src/test/java/org/apache/yoko/IIOPPluginTest.java Tue Jul 10
08:38:17 2007
@@ -27,9 +27,13 @@
 public class IIOPPluginTest extends AbstractOrbTestBase {
     private static final String SERVER_CLASS = "test.iiopplugin.Server";
     private static final String CLIENT_CLASS = "test.iiopplugin.Client";
-    public static File waitForFile = new File("Test.ref");
+    private static final String OUTPUT_FILE = "Test.ref";
+
+    public void setUp() throws Exception {
+        super.setUp();
+        setWaitForFile(new File(OUTPUT_FILE));
+    }
     public void testLocal() throws Exception {
-        setWaitForFile(waitForFile);
         runServerClientTest(SERVER_CLASS, CLIENT_CLASS);
     }
 }

Modified: incubator/yoko/trunk/core/src/test/java/org/apache/yoko/LocalTest.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/core/src/test/java/org/apache/yoko/LocalTest.java?view=diff&rev=554983&r1=554982&r2=554983
==============================================================================
--- incubator/yoko/trunk/core/src/test/java/org/apache/yoko/LocalTest.java (original)
+++ incubator/yoko/trunk/core/src/test/java/org/apache/yoko/LocalTest.java Tue Jul 10 08:38:17
2007
@@ -1,11 +1,11 @@
 /**
  *
- * Licensed to the Apache Software Foundation (ASF) under one or more
-*  contributor license agreements.  See the NOTICE file distributed with
-*  this work for additional information regarding copyright ownership.
-*  The ASF licenses this file to You under the Apache License, Version 2.0
-*  (the "License"); you may not use this file except in compliance with
-*  the License.  You may obtain a copy of the License at
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
  *
  *     http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -20,6 +20,13 @@
 public class LocalTest extends AbstractOrbTestBase {
     private static final String SERVER_CLASS = "test.local.Server";
     private static final String CLIENT_CLASS = "test.local.Client";
+    private static final String OUTPUT_FILE = "Test.ref";
+
+    public void setUp() throws Exception {
+        super.setUp();
+        setWaitForFile(new java.io.File(OUTPUT_FILE));
+    }
+
     public void testLocal() throws Exception {
         runServerClientTest(SERVER_CLASS, CLIENT_CLASS);
     }

Modified: incubator/yoko/trunk/core/src/test/java/test/codesets/Client.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/core/src/test/java/test/codesets/Client.java?view=diff&rev=554983&r1=554982&r2=554983
==============================================================================
--- incubator/yoko/trunk/core/src/test/java/test/codesets/Client.java (original)
+++ incubator/yoko/trunk/core/src/test/java/test/codesets/Client.java Tue Jul 10 08:38:17
2007
@@ -68,16 +68,6 @@
 
         int status = 0;
         ORB orb = null;
-
-        File file = new File("TestCodeSets.ref");
-        if (!file.exists()) {
-            try {
-                Thread.sleep(5000);
-            } catch (Exception ex) {
-                //IGNORE
-            }
-        }
-
         try {
             orb = ORB.init(args, props);
             status = run(orb, args);



Mime
View raw message