summaryrefslogtreecommitdiffstats
path: root/branches/sca-java-1.3/modules/binding-rmi/src/test/java/org/apache/tuscany/sca/binding/rmi/BindingTestCase.java
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2008-06-25 15:52:32 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2008-06-25 15:52:32 +0000
commit22749e7c989f20f56cb9efef762d801a05b9a1d3 (patch)
treead0140eeef1d8517b9c90c6203e834ae889b4ab4 /branches/sca-java-1.3/modules/binding-rmi/src/test/java/org/apache/tuscany/sca/binding/rmi/BindingTestCase.java
parent9da64f4dfbb8b71be6f8d943a05570f532e9a3a1 (diff)
Merge the fix for TUSCANY-2406 from trunk
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@671590 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r--branches/sca-java-1.3/modules/binding-rmi/src/test/java/org/apache/tuscany/sca/binding/rmi/BindingTestCase.java47
1 files changed, 27 insertions, 20 deletions
diff --git a/branches/sca-java-1.3/modules/binding-rmi/src/test/java/org/apache/tuscany/sca/binding/rmi/BindingTestCase.java b/branches/sca-java-1.3/modules/binding-rmi/src/test/java/org/apache/tuscany/sca/binding/rmi/BindingTestCase.java
index afc3ef98cf..c8a13573d1 100644
--- a/branches/sca-java-1.3/modules/binding-rmi/src/test/java/org/apache/tuscany/sca/binding/rmi/BindingTestCase.java
+++ b/branches/sca-java-1.3/modules/binding-rmi/src/test/java/org/apache/tuscany/sca/binding/rmi/BindingTestCase.java
@@ -18,6 +18,7 @@
*/
package org.apache.tuscany.sca.binding.rmi;
+import helloworld.HelloException;
import helloworld.HelloWorldRmiService;
import junit.framework.Assert;
@@ -34,32 +35,38 @@ import org.junit.Test;
public class BindingTestCase {
private static HelloWorldRmiService helloWorldRmiService;
private static SCADomain domain;
-
+
@Test
public void testRmiService() {
- System.out.println(helloWorldRmiService.sayRmiHello("Tuscany World!"));
- Assert.assertEquals("Hello from the RMI Service to - Tuscany World! thro the RMI Reference",
- helloWorldRmiService.sayRmiHello("Tuscany World!"));
-
- System.out.println(helloWorldRmiService.sayRmiHi("Tuscany World!", "Apache World"));
-
- Assert.assertEquals("Hi from Apache World in RMI Service to - Tuscany World! thro the RMI Reference",
- helloWorldRmiService.sayRmiHi("Tuscany World!", "Apache World"));
- }
+ String msg = helloWorldRmiService.sayRmiHello("Tuscany World!");
+ System.out.println(msg);
+ Assert.assertEquals("Hello from the RMI Service to - Tuscany World! thro the RMI Reference", msg);
+ try {
+ msg = helloWorldRmiService.sayRmiHi("Tuscany World!", "Apache World");
+ System.out.println(msg);
+ Assert.assertEquals("Hi from Apache World in RMI Service to - Tuscany World! thro the RMI Reference", msg);
+ } catch (HelloException e) {
+ Assert.fail(e.getMessage());
+ }
+ try {
+ msg = helloWorldRmiService.sayRmiHi(null, "Apache World");
+ Assert.fail("HelloException should have been thrown");
+ } catch (HelloException e) {
+
+ }
+ }
-
@BeforeClass
public static void init() throws Exception {
-try {
- domain = SCADomain.newInstance("RMIBindingTest.composite");
- helloWorldRmiService =
- domain.getService(HelloWorldRmiService.class, "HelloWorldRmiServiceComponent");
-} catch (Exception e) {
- e.printStackTrace();
-}
- }
-
+ try {
+ domain = SCADomain.newInstance("RMIBindingTest.composite");
+ helloWorldRmiService = domain.getService(HelloWorldRmiService.class, "HelloWorldRmiServiceComponent");
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
@AfterClass
public static void destroy() throws Exception {
domain.close();