Author: rfeng
Date: Wed Feb 10 20:14:10 2010
New Revision: 908654

URL: http://svn.apache.org/viewvc?rev=908654&view=rev
Log:
Timing the sequence to avoid hangs

Modified:
    tuscany/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/build.xml
    
tuscany/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/server-config.xml
    
tuscany/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/server.xml
    
tuscany/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/src/test/java/itest/SCAClient.java
    
tuscany/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/src/test/java/itest/Service.java

Modified: 
tuscany/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/build.xml
URL: 
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/build.xml?rev=908654&r1=908653&r2=908654&view=diff
==============================================================================
--- 
tuscany/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/build.xml 
(original)
+++ 
tuscany/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/build.xml 
Wed Feb 10 20:14:10 2010
@@ -27,7 +27,7 @@
             </daemons>
        
             <sequential>
-                <sleep seconds="4"/>
+                <sleep seconds="10"/>
                 <ant antfile="client.xml"/>
                <ant antfile="scaclient.xml"/>
             </sequential>

Modified: 
tuscany/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/server-config.xml
URL: 
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/server-config.xml?rev=908654&r1=908653&r2=908654&view=diff
==============================================================================
--- 
tuscany/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/server-config.xml
 (original)
+++ 
tuscany/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/server-config.xml
 Wed Feb 10 20:14:10 2010
@@ -20,7 +20,7 @@
 <node xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912";
     xmlns="http://tuscany.apache.org/xmlns/sca/1.1";
     xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1";
-    uri="http://sample/nodes/TestNode1";
+    uri="http://sample/nodes/TestNode2";
     domain="default"
     domainRegistry="tuscany:default">
 

Modified: 
tuscany/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/server.xml
URL: 
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/server.xml?rev=908654&r1=908653&r2=908654&view=diff
==============================================================================
--- 
tuscany/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/server.xml 
(original)
+++ 
tuscany/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/server.xml 
Wed Feb 10 20:14:10 2010
@@ -24,6 +24,9 @@
                <java classpath="${runtime_classpath}" 
classname="org.apache.tuscany.sca.node.launcher.NodeMain" fork="true">
                        <arg value="-node"/>
                        <arg value="./server-config.xml"/>
+                       <!-- Give the server 60 seconds to stay -->
+               <arg value="-ttl"/>
+               <arg value="60000"/>
                </java>
        </target>
        

Modified: 
tuscany/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/src/test/java/itest/SCAClient.java
URL: 
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/src/test/java/itest/SCAClient.java?rev=908654&r1=908653&r2=908654&view=diff
==============================================================================
--- 
tuscany/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/src/test/java/itest/SCAClient.java
 (original)
+++ 
tuscany/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/src/test/java/itest/SCAClient.java
 Wed Feb 10 20:14:10 2010
@@ -35,6 +35,9 @@
         // The configuration required when running with sca-client-impl and 
endpoint-hazelcast
         SCAClientFactory factory = 
SCAClientFactory.newInstance(URI.create("tuscany:default"));
         
+        // Sleep 3 seconds so that the endpoint is populated into the 
EndpointRegistry
+        Thread.sleep(3000);
+        
         Helloworld service = factory.getService(Helloworld.class, 
"HelloworldService");
         
         String response = service.sayHello("test");

Modified: 
tuscany/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/src/test/java/itest/Service.java
URL: 
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/src/test/java/itest/Service.java?rev=908654&r1=908653&r2=908654&view=diff
==============================================================================
--- 
tuscany/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/src/test/java/itest/Service.java
 (original)
+++ 
tuscany/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/src/test/java/itest/Service.java
 Wed Feb 10 20:14:10 2010
@@ -39,9 +39,8 @@
 
     @Test
     public void testNothing() throws Exception {
-        synchronized (this) {
-            this.wait();
-        }
+        // Stay for 1 min
+        Thread.sleep(60000);
     }
 
     @AfterClass
@@ -53,14 +52,7 @@
     
     public static void main(String[] args) throws Exception {
         Service.setUpBeforeClass();
-        
-        try {
-            System.out.println("Press a key to stop");
-            System.in.read();
-        } catch (Exception ex) {
-            // do nothing
-        }
-        
+        new Service().testNothing();
         Service.tearDownAfterClass();
     }    
 }


Reply via email to