diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2010-02-25 23:00:57 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2010-02-25 23:00:57 +0000 |
commit | d7c15da034109074d717d3f9f0c3325a54b597dd (patch) | |
tree | 553365305a3bad892346fb83cf92187b24ca0288 /sca-java-2.x/trunk/itest/nodes/binding-sca-tribes | |
parent | f026711cd4af3326d8e40a428954f822f65e4c80 (diff) |
Add the check for local-by-reference, local-by-value and remote invocations for binding.sca
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@916483 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/itest/nodes/binding-sca-tribes')
5 files changed, 32 insertions, 16 deletions
diff --git a/sca-java-2.x/trunk/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/BindingSCATestCase.java b/sca-java-2.x/trunk/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/BindingSCATestCase.java index baf4d69508..88d1e201f1 100644 --- a/sca-java-2.x/trunk/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/BindingSCATestCase.java +++ b/sca-java-2.x/trunk/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/BindingSCATestCase.java @@ -26,7 +26,7 @@ import org.apache.tuscany.sca.node.NodeFactory; import org.apache.tuscany.sca.node.configuration.NodeConfiguration; import org.junit.Assert; import org.junit.Test; -import org.oasisopen.sca.SCARuntimeException; +import org.oasisopen.sca.ServiceRuntimeException; /** * Test binding.sca in the same classloader @@ -49,10 +49,13 @@ public class BindingSCATestCase { Node node2 = createServiceNode(factory1); node1.start(); node2.start(); - runClient(node1); - node2.stop(); - node1.stop(); - factory1.destroy(); + try { + runClient(node1); + } finally { + node2.stop(); + node1.stop(); + factory1.destroy(); + } } /** @@ -94,14 +97,15 @@ public class BindingSCATestCase { node2.start(); try { runClient(node1); - Assert.fail("SCARuntimeException should have been thrown."); - } catch (SCARuntimeException e) { + Assert.fail("ServiceRuntimeException should have been thrown."); + } catch (ServiceRuntimeException e) { // ignore + } finally { + node2.stop(); + node1.stop(); + factory2.destroy(); + factory1.destroy(); } - node2.stop(); - node1.stop(); - factory2.destroy(); - factory1.destroy(); } /** @@ -117,7 +121,7 @@ public class BindingSCATestCase { String id = client.create("Ray"); Assert.assertEquals("Ray", client.getName(id)); } - + /** * One node factory and one node for both composites */ @@ -130,9 +134,12 @@ public class BindingSCATestCase { Node node1 = factory.createNode(config1); node1.start(); - runClient(node1); - node1.stop(); - factory.destroy(); + try { + runClient(node1); + } finally { + node1.stop(); + factory.destroy(); + } } } diff --git a/sca-java-2.x/trunk/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientNodeSharedCustomerTestCase.java b/sca-java-2.x/trunk/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientNodeSharedCustomerTestCase.java index d9436e8ea5..7255697d4b 100644 --- a/sca-java-2.x/trunk/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientNodeSharedCustomerTestCase.java +++ b/sca-java-2.x/trunk/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientNodeSharedCustomerTestCase.java @@ -31,12 +31,13 @@ import org.junit.Test; public class ClientNodeSharedCustomerTestCase { private static Node clientNode; private static TestCaseRunner runner; + private static NodeFactory factory; @BeforeClass public static void setUpBeforeClass() throws Exception { runner = new TestCaseRunner(ServiceNode.class, Remote.class.getName(), RemoteServiceImpl.class.getName()); runner.beforeClass(); - NodeFactory factory = NodeFactory.getInstance(); + factory = NodeFactory.getInstance(); clientNode = BindingSCATestCase.createClientNode(factory).start(); Thread.sleep(1000); } @@ -54,5 +55,8 @@ public class ClientNodeSharedCustomerTestCase { if (runner != null) { runner.afterClass(); } + if (factory != null) { + factory.destroy(); + } } } diff --git a/sca-java-2.x/trunk/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientNodeSharedLocalTestCase.java b/sca-java-2.x/trunk/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientNodeSharedLocalTestCase.java index c29dfe4ae4..51fafae32c 100644 --- a/sca-java-2.x/trunk/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientNodeSharedLocalTestCase.java +++ b/sca-java-2.x/trunk/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientNodeSharedLocalTestCase.java @@ -57,5 +57,6 @@ public class ClientNodeSharedLocalTestCase { if (runner != null) { runner.afterClass(); } + NodeFactory.getInstance().destroy(); } } diff --git a/sca-java-2.x/trunk/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientSharedCustomerTestCase.java b/sca-java-2.x/trunk/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientSharedCustomerTestCase.java index 13dd048f1f..b8ff0c58ba 100644 --- a/sca-java-2.x/trunk/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientSharedCustomerTestCase.java +++ b/sca-java-2.x/trunk/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientSharedCustomerTestCase.java @@ -19,6 +19,7 @@ package org.apache.tuscany.sca.itest.bindingsca; +import org.apache.tuscany.sca.node.NodeFactory; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; @@ -48,5 +49,6 @@ public class ClientSharedCustomerTestCase { if (runner != null) { runner.afterClass(); } + NodeFactory.getInstance().destroy(); } } diff --git a/sca-java-2.x/trunk/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientSharedLocalTestCase.java b/sca-java-2.x/trunk/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientSharedLocalTestCase.java index d48b18f83a..034136ca53 100644 --- a/sca-java-2.x/trunk/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientSharedLocalTestCase.java +++ b/sca-java-2.x/trunk/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientSharedLocalTestCase.java @@ -19,6 +19,7 @@ package org.apache.tuscany.sca.itest.bindingsca; +import org.apache.tuscany.sca.node.NodeFactory; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; @@ -51,5 +52,6 @@ public class ClientSharedLocalTestCase { if (runner != null) { runner.afterClass(); } + NodeFactory.getInstance().destroy(); } } |