diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2009-08-26 11:58:30 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2009-08-26 11:58:30 +0000 |
commit | a98c6019b857227cdba7027b877f33325be4643d (patch) | |
tree | 22b7e60a79d6a63a615d1e2df16d0db757d6d437 /java/sca/modules | |
parent | e785933e664b4665f7f9f5c959adb5a496e4552e (diff) |
Split big test method into several discrete test methods
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@807972 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules')
-rw-r--r-- | java/sca/modules/domain-node/src/test/java/org/apache/tuscany/sca/node/OneNodeTestCase.java | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/java/sca/modules/domain-node/src/test/java/org/apache/tuscany/sca/node/OneNodeTestCase.java b/java/sca/modules/domain-node/src/test/java/org/apache/tuscany/sca/node/OneNodeTestCase.java index e3938f2044..65b0b4defa 100644 --- a/java/sca/modules/domain-node/src/test/java/org/apache/tuscany/sca/node/OneNodeTestCase.java +++ b/java/sca/modules/domain-node/src/test/java/org/apache/tuscany/sca/node/OneNodeTestCase.java @@ -48,23 +48,42 @@ public class OneNodeTestCase{ }
@Test
- public void testCalculator() throws Exception {
+ public void testService() throws Exception {
Helloworld service = SCAClient.getService(Helloworld.class, "defaultDomain/HelloworldService");
assertNotNull(service);
assertEquals("Hello Petra", service.sayHello("Petra"));
+ }
+ @Test
+ public void testClient() throws Exception {
Helloworld client = SCAClient.getService(Helloworld.class, "defaultDomain/HelloworldClient");
assertNotNull(client);
assertEquals("Hi Hello Petra", client.sayHello("Petra"));
-
+ }
+
+ @Test
+ public void testRemovingServiceContribution() throws Exception {
domain.removeContribution(serviceContributionUri);
try {
- client = SCAClient.getService(Helloworld.class, "defaultDomain/HelloworldService");
+ SCAClient.getService(Helloworld.class, "defaultDomain/HelloworldService");
// FIXME: should this be NoSuchServiceException or ServiceNotFoundException?
} catch (NoSuchServiceException e) {
// expected
}
-
+
+ Helloworld client = SCAClient.getService(Helloworld.class, "defaultDomain/HelloworldClient");
+ assertNotNull(client);
+ try {
+ assertEquals("Hi Hello Petra", client.sayHello("Petra"));
+ fail();
+ } catch (Exception e) {
+ // FIXME: this gives an NPE, would be better to be something like ServiceNotFoundException
+ // expected
+ }
+ }
+
+ @Test
+ public void testStoppingDomainNode() throws Exception {
domain.stop();
try {
SCAClient.getService(Helloworld.class, "defaultDomain/HelloworldClient");
@@ -73,7 +92,6 @@ public class OneNodeTestCase{ // expected
}
}
-
@AfterClass
public static void tearDownAfterClass() throws Exception {
|