You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by sl...@apache.org on 2009/12/10 12:50:33 UTC

svn commit: r889211 - in /tuscany/sca-java-2.x/trunk/itest/nodes: helloworld-client/src/main/java/itest/nodes/HelloworldImpl.java helloworld-iface/src/main/java/itest/nodes/Helloworld.java two-nodes-test/src/test/java/itest/StopStartNodesTestCase.java

Author: slaws
Date: Thu Dec 10 11:50:26 2009
New Revision: 889211

URL: http://svn.apache.org/viewvc?rev=889211&view=rev
Log:
Add exceptions back into test case so that runtime errors are reported back to the outside world. Change the two nodes test case back to how it was to take account of it. 

Modified:
    tuscany/sca-java-2.x/trunk/itest/nodes/helloworld-client/src/main/java/itest/nodes/HelloworldImpl.java
    tuscany/sca-java-2.x/trunk/itest/nodes/helloworld-iface/src/main/java/itest/nodes/Helloworld.java
    tuscany/sca-java-2.x/trunk/itest/nodes/two-nodes-test/src/test/java/itest/StopStartNodesTestCase.java

Modified: tuscany/sca-java-2.x/trunk/itest/nodes/helloworld-client/src/main/java/itest/nodes/HelloworldImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/itest/nodes/helloworld-client/src/main/java/itest/nodes/HelloworldImpl.java?rev=889211&r1=889210&r2=889211&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/itest/nodes/helloworld-client/src/main/java/itest/nodes/HelloworldImpl.java (original)
+++ tuscany/sca-java-2.x/trunk/itest/nodes/helloworld-client/src/main/java/itest/nodes/HelloworldImpl.java Thu Dec 10 11:50:26 2009
@@ -32,17 +32,12 @@
     public Helloworld service;
     
     @Init
-    public void initialize(){
+    public void initialize() throws Exception{
     	System.out.println(">>>>>> " + sayHello("init"));
     }
     
-    public String sayHello(String name) {
-        try {
+    public String sayHello(String name) throws Exception {
         return "Hi " + service.sayHello(name);
-        } catch (Exception e) {
-            e.printStackTrace();
-            return e.getMessage();
-        }
     }
 
 }

Modified: tuscany/sca-java-2.x/trunk/itest/nodes/helloworld-iface/src/main/java/itest/nodes/Helloworld.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/itest/nodes/helloworld-iface/src/main/java/itest/nodes/Helloworld.java?rev=889211&r1=889210&r2=889211&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/itest/nodes/helloworld-iface/src/main/java/itest/nodes/Helloworld.java (original)
+++ tuscany/sca-java-2.x/trunk/itest/nodes/helloworld-iface/src/main/java/itest/nodes/Helloworld.java Thu Dec 10 11:50:26 2009
@@ -24,6 +24,6 @@
 @Remotable
 public interface Helloworld {
     
-    String sayHello(String name);
+    String sayHello(String name) throws Exception;
 
 }

Modified: tuscany/sca-java-2.x/trunk/itest/nodes/two-nodes-test/src/test/java/itest/StopStartNodesTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/itest/nodes/two-nodes-test/src/test/java/itest/StopStartNodesTestCase.java?rev=889211&r1=889210&r2=889211&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/itest/nodes/two-nodes-test/src/test/java/itest/StopStartNodesTestCase.java (original)
+++ tuscany/sca-java-2.x/trunk/itest/nodes/two-nodes-test/src/test/java/itest/StopStartNodesTestCase.java Thu Dec 10 11:50:26 2009
@@ -61,7 +61,13 @@
         client = clientNode.getService(Helloworld.class, "HelloworldClient");
         assertNotNull(client);
 
-        assertEquals(true, client.sayHello("Petra").startsWith("Unable to bind"));
+        try {
+            client.sayHello("Petra");
+            fail();
+        } catch (Exception e) {
+            // expected
+            // TODO: better exception than NPE
+        }
         
         serviceNode = factory.createNode(new Contribution("service", getJar("../helloworld-service/target")));
         serviceNode.start();