diff options
Diffstat (limited to 'sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/domain/node/GetServiceTestCase.java')
-rw-r--r-- | sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/domain/node/GetServiceTestCase.java | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/domain/node/GetServiceTestCase.java b/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/domain/node/GetServiceTestCase.java index f8399cf9eb..bee9e0b25a 100644 --- a/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/domain/node/GetServiceTestCase.java +++ b/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/domain/node/GetServiceTestCase.java @@ -21,14 +21,12 @@ package org.apache.tuscany.sca.domain.node; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
-import itest.nodes.Helloworld;
import static org.junit.Assert.fail;
+import itest.nodes.Helloworld;
-import org.apache.tuscany.sca.domain.node.DomainNode;
import org.junit.After;
import org.junit.Test;
import org.oasisopen.sca.SCARuntimeException;
-import org.oasisopen.sca.client.SCAClient;
/**
* This shows how to test the Calculator service component.
@@ -40,8 +38,8 @@ public class GetServiceTestCase{ @Test
public void testTwoNodesSameDomain() throws Exception {
- serviceNode = new DomainNode("vm://fooDomain", "target/test-classes/itest-nodes-helloworld-service-2.0-SNAPSHOT.jar");
- clientNode = new DomainNode("vm://fooDomain", "target/test-classes/itest-nodes-helloworld-client-2.0-SNAPSHOT.jar");
+ serviceNode = new DomainNode("target/test-classes/itest-nodes-helloworld-service-2.0-SNAPSHOT.jar");
+ clientNode = new DomainNode("target/test-classes/itest-nodes-helloworld-client-2.0-SNAPSHOT.jar");
Helloworld service = serviceNode.getService(Helloworld.class, "HelloworldService");
assertNotNull(service);
@@ -50,23 +48,16 @@ public class GetServiceTestCase{ Helloworld client = clientNode.getService(Helloworld.class, "HelloworldClient");
assertNotNull(client);
assertEquals("Hi Hello Petra", client.sayHello("Petra"));
-
- if (clientNode != null && clientNode.isStarted()) {
- clientNode.stop();
- }
- if (serviceNode != null && serviceNode.isStarted()) {
- serviceNode.stop();
- }
}
@Test
public void testTwoNodesDifferentDomains() throws Exception {
- serviceNode = new DomainNode("vm://fooDomain", "target/test-classes/itest-nodes-helloworld-service-2.0-SNAPSHOT.jar");
+ serviceNode = new DomainNode("vm://fooDomain", new String[]{"target/test-classes/itest-nodes-helloworld-service-2.0-SNAPSHOT.jar"});
Helloworld service = serviceNode.getService(Helloworld.class, "HelloworldService");
assertNotNull(service);
assertEquals("Hello Petra", service.sayHello("Petra"));
- clientNode = new DomainNode("vm://barDomain", "target/test-classes/itest-nodes-helloworld-client-2.0-SNAPSHOT.jar");
+ clientNode = new DomainNode("vm://barDomain", new String[] {"target/test-classes/itest-nodes-helloworld-client-2.0-SNAPSHOT.jar"});
Helloworld client = clientNode.getService(Helloworld.class, "HelloworldClient");
assertNotNull(client);
@@ -81,10 +72,10 @@ public class GetServiceTestCase{ @After
public void tearDownAfterClass() throws Exception {
- if (clientNode != null && clientNode.isStarted()) {
+ if (clientNode != null) {
clientNode.stop();
}
- if (serviceNode != null && serviceNode.isStarted()) {
+ if (serviceNode != null) {
serviceNode.stop();
}
}
|