diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2010-02-10 20:14:10 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2010-02-10 20:14:10 +0000 |
commit | 19e75a3777d7002d86914190c37a798c9b222146 (patch) | |
tree | d26e9beea5ae1074975365751655c6098f8e0e34 | |
parent | c02027ec2a7ebecf86a1fe42ce5099876cb59333 (diff) |
Timing the sequence to avoid hangs
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@908654 13f79535-47bb-0310-9956-ffa450edef68
5 files changed, 11 insertions, 13 deletions
diff --git a/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/build.xml b/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/build.xml index acc0dcb591..05fb27ddba 100644 --- a/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/build.xml +++ b/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/build.xml @@ -27,7 +27,7 @@ </daemons>
<sequential>
- <sleep seconds="4"/>
+ <sleep seconds="10"/>
<ant antfile="client.xml"/>
<ant antfile="scaclient.xml"/>
</sequential>
diff --git a/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/server-config.xml b/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/server-config.xml index 44d2624102..f3677523cb 100644 --- a/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/server-config.xml +++ b/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/server-config.xml @@ -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">
diff --git a/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/server.xml b/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/server.xml index 1bb7e7a0d7..6e282e1f12 100644 --- a/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/server.xml +++ b/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/server.xml @@ -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>
diff --git a/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/src/test/java/itest/SCAClient.java b/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/src/test/java/itest/SCAClient.java index cf6d34348e..67f2c913dc 100644 --- a/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/src/test/java/itest/SCAClient.java +++ b/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/src/test/java/itest/SCAClient.java @@ -35,6 +35,9 @@ public class SCAClient { // 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"); diff --git a/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/src/test/java/itest/Service.java b/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/src/test/java/itest/Service.java index a7e4c6bed1..dbccfd4407 100644 --- a/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/src/test/java/itest/Service.java +++ b/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/src/test/java/itest/Service.java @@ -39,9 +39,8 @@ public class Service { @Test
public void testNothing() throws Exception {
- synchronized (this) {
- this.wait();
- }
+ // Stay for 1 min
+ Thread.sleep(60000);
}
@AfterClass
@@ -53,14 +52,7 @@ public class Service { 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();
}
}
|