You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by an...@apache.org on 2009/08/26 13:58:31 UTC

svn commit: r807972 - /tuscany/java/sca/modules/domain-node/src/test/java/org/apache/tuscany/sca/node/OneNodeTestCase.java

Author: antelder
Date: Wed Aug 26 11:58:30 2009
New Revision: 807972

URL: http://svn.apache.org/viewvc?rev=807972&view=rev
Log:
Split big test method into several discrete test methods

Modified:
    tuscany/java/sca/modules/domain-node/src/test/java/org/apache/tuscany/sca/node/OneNodeTestCase.java

Modified: tuscany/java/sca/modules/domain-node/src/test/java/org/apache/tuscany/sca/node/OneNodeTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/domain-node/src/test/java/org/apache/tuscany/sca/node/OneNodeTestCase.java?rev=807972&r1=807971&r2=807972&view=diff
==============================================================================
--- tuscany/java/sca/modules/domain-node/src/test/java/org/apache/tuscany/sca/node/OneNodeTestCase.java (original)
+++ tuscany/java/sca/modules/domain-node/src/test/java/org/apache/tuscany/sca/node/OneNodeTestCase.java Wed Aug 26 11:58:30 2009
@@ -48,23 +48,42 @@
     }
 
     @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 @@
             // expected
         }
     }
-    
 
     @AfterClass
     public static void tearDownAfterClass() throws Exception {