From bfa3a326441cbe17ea6786dbdd658832fc2e93b8 Mon Sep 17 00:00:00 2001 From: rfeng Date: Tue, 2 Mar 2010 23:30:54 +0000 Subject: Add the ability to map binding.sca to any bindings in the runtime by configuration git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@918261 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/test/scaclient/SCAClientTestCase.java | 23 +++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'sca-java-2.x/trunk/itest/scaclient-api-rmi') diff --git a/sca-java-2.x/trunk/itest/scaclient-api-rmi/src/test/java/test/scaclient/SCAClientTestCase.java b/sca-java-2.x/trunk/itest/scaclient-api-rmi/src/test/java/test/scaclient/SCAClientTestCase.java index 35e5e28194..91a3f552f4 100644 --- a/sca-java-2.x/trunk/itest/scaclient-api-rmi/src/test/java/test/scaclient/SCAClientTestCase.java +++ b/sca-java-2.x/trunk/itest/scaclient-api-rmi/src/test/java/test/scaclient/SCAClientTestCase.java @@ -19,14 +19,17 @@ package test.scaclient; +import static org.junit.Assert.assertEquals; import itest.HelloworldService; import java.net.URI; -import junit.framework.TestCase; - +import org.apache.tuscany.sca.binding.rmi.RMIBinding; import org.apache.tuscany.sca.node.Node; import org.apache.tuscany.sca.node.NodeFactory; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.BeforeClass; import org.junit.Test; import org.oasisopen.sca.client.SCAClientFactory; @@ -35,9 +38,19 @@ import org.oasisopen.sca.client.SCAClientFactory; * * @version $Rev: 904064 $ $Date: 2010-01-28 12:31:36 +0000 (Thu, 28 Jan 2010) $ */ -public class SCAClientTestCase extends TestCase { +public class SCAClientTestCase { private Node node; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + System.setProperty("org.apache.tuscany.sca.binding.sca.provider.SCABindingMapper.mappedBinding", RMIBinding.TYPE.toString()); + } + + @AfterClass + public static void tearDownAfterClass() throws Exception { + System.clearProperty("org.apache.tuscany.sca.binding.sca.provider.SCABindingMapper.mappedBinding"); + } @Test public void testDefault() throws Exception { @@ -77,8 +90,8 @@ public class SCAClientTestCase extends TestCase { assertEquals("Hello petra", service.sayHello("petra")); } - @Override - protected void tearDown() throws Exception { + @After + public void tearDown() throws Exception { node.stop(); } -- cgit v1.2.3