From 0bcb8bebd810236baef6c8c2fd6bb20c33d2cb9f Mon Sep 17 00:00:00 2001 From: lresende Date: Wed, 10 Jun 2009 06:53:12 +0000 Subject: Migrating test case to jUnit 4.5 style git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@783234 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/test/java/helloworld/HelloWorld.java | 2 +- .../test/java/helloworld/HelloWorldTestCase.java | 27 ++++++++++++++-------- 2 files changed, 18 insertions(+), 11 deletions(-) (limited to 'java') diff --git a/java/sca/itest/bpel/helloworld-ws/src/test/java/helloworld/HelloWorld.java b/java/sca/itest/bpel/helloworld-ws/src/test/java/helloworld/HelloWorld.java index ffdbc50a22..0999e97065 100644 --- a/java/sca/itest/bpel/helloworld-ws/src/test/java/helloworld/HelloWorld.java +++ b/java/sca/itest/bpel/helloworld-ws/src/test/java/helloworld/HelloWorld.java @@ -20,7 +20,7 @@ package helloworld; import org.apache.tuscany.implementation.bpel.example.helloworld.HelloPortType; -import org.osoa.sca.annotations.Reference; +import org.oasisopen.sca.annotation.Reference; /** * @version $Rev$ $Date$ diff --git a/java/sca/itest/bpel/helloworld-ws/src/test/java/helloworld/HelloWorldTestCase.java b/java/sca/itest/bpel/helloworld-ws/src/test/java/helloworld/HelloWorldTestCase.java index 6971151a77..315591fb98 100644 --- a/java/sca/itest/bpel/helloworld-ws/src/test/java/helloworld/HelloWorldTestCase.java +++ b/java/sca/itest/bpel/helloworld-ws/src/test/java/helloworld/HelloWorldTestCase.java @@ -22,34 +22,41 @@ package helloworld; import java.io.IOException; import java.net.Socket; -import junit.framework.TestCase; +import junit.framework.Assert; import org.apache.tuscany.implementation.bpel.example.helloworld.HelloPortType; -import org.apache.tuscany.sca.host.embedded.SCADomain; +import org.apache.tuscany.sca.node.Contribution; +import org.apache.tuscany.sca.node.ContributionLocationHelper; +import org.apache.tuscany.sca.node.Node; +import org.apache.tuscany.sca.node.NodeFactory; +import org.junit.AfterClass; +import org.junit.BeforeClass; /** * Tests the BPEL Helloworld Service * * @version $Rev$ $Date$ */ -public class HelloWorldTestCase extends TestCase { +public class HelloWorldTestCase { - private SCADomain scaDomain; + private Node node; /** * @throws java.lang.Exception */ - @Override + @BeforeClass protected void setUp() throws Exception { - scaDomain = SCADomain.newInstance("helloworld/helloworld.composite"); + String location = ContributionLocationHelper.getContributionLocation("helloworld/helloworld.composite"); + node = NodeFactory.newInstance().createNode("CallBackApiTest.composite", new Contribution("c1", location)); + node.start(); } /** * @throws java.lang.Exception */ - @Override + @AfterClass protected void tearDown() throws Exception { - scaDomain.close(); + node.stop(); } public void testPing() throws IOException { @@ -57,8 +64,8 @@ public class HelloWorldTestCase extends TestCase { } public void testServiceInvocation() throws Exception { - HelloPortType bpelService = scaDomain.getService(HelloPortType.class, "BPELHelloWorldServiceComponent"); + HelloPortType bpelService = node.getService(HelloPortType.class, "BPELHelloWorldServiceComponent"); String response = bpelService.hello("Hello"); - assertEquals("Hello World", response); + Assert.assertEquals("Hello World", response); } } -- cgit v1.2.3