From 3c28e7f9020fd1f533eb163638e01f7fd0a88933 Mon Sep 17 00:00:00 2001 From: lresende Date: Wed, 10 Jun 2009 06:47:36 +0000 Subject: Migrating test case to jUnit 4.5 style git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@783229 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/test/java/helloworld/HelloWorld.java | 2 +- .../test/java/helloworld/HelloWorldTestCase.java | 31 +++++++++++++--------- 2 files changed, 20 insertions(+), 13 deletions(-) (limited to 'java/sca/itest/bpel/helloworld') diff --git a/java/sca/itest/bpel/helloworld/src/test/java/helloworld/HelloWorld.java b/java/sca/itest/bpel/helloworld/src/test/java/helloworld/HelloWorld.java index ffdbc50a22..0999e97065 100644 --- a/java/sca/itest/bpel/helloworld/src/test/java/helloworld/HelloWorld.java +++ b/java/sca/itest/bpel/helloworld/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/src/test/java/helloworld/HelloWorldTestCase.java b/java/sca/itest/bpel/helloworld/src/test/java/helloworld/HelloWorldTestCase.java index 76fcd35c2d..ead696f03d 100644 --- a/java/sca/itest/bpel/helloworld/src/test/java/helloworld/HelloWorldTestCase.java +++ b/java/sca/itest/bpel/helloworld/src/test/java/helloworld/HelloWorldTestCase.java @@ -19,45 +19,52 @@ package helloworld; -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.Node; +import org.apache.tuscany.sca.node.NodeFactory; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; /** * 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"); + node = NodeFactory.newInstance().createNode(); + node.start(); } /** * @throws java.lang.Exception */ - @Override + @AfterClass protected void tearDown() throws Exception { - scaDomain.close(); + node.stop(); } + @Test public void testServiceInvocation() throws Exception { - HelloPortType bpelService = scaDomain.getService(HelloPortType.class, "BPELHelloWorldService"); + HelloPortType bpelService = node.getService(HelloPortType.class, "BPELHelloWorldService"); String response = bpelService.hello("Hello"); - assertEquals("Hello World", response); + Assert.assertEquals("Hello World", response); } + @Test public void testReferenceInvocation() throws Exception { - HelloWorld bpelService = scaDomain.getService(HelloWorld.class, "BPELHelloWorld"); + HelloWorld bpelService = node.getService(HelloWorld.class, "BPELHelloWorld"); String response = bpelService.hello("Hello"); - assertEquals("Hello World", response); + Assert.assertEquals("Hello World", response); } } -- cgit v1.2.3