summaryrefslogtreecommitdiffstats
path: root/java/sca/itest
diff options
context:
space:
mode:
authorlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2009-06-10 06:47:36 +0000
committerlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2009-06-10 06:47:36 +0000
commit3c28e7f9020fd1f533eb163638e01f7fd0a88933 (patch)
tree1bc96b01edaa136b548006db2339e530ba4d143e /java/sca/itest
parent3d69ef87b6f9d5fd43e5ea1034cbd23176320e25 (diff)
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
Diffstat (limited to 'java/sca/itest')
-rw-r--r--java/sca/itest/bpel/helloworld/src/test/java/helloworld/HelloWorld.java2
-rw-r--r--java/sca/itest/bpel/helloworld/src/test/java/helloworld/HelloWorldTestCase.java31
2 files changed, 20 insertions, 13 deletions
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);
}
}