summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2009-06-10 06:53:12 +0000
committerlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2009-06-10 06:53:12 +0000
commit0bcb8bebd810236baef6c8c2fd6bb20c33d2cb9f (patch)
treefa958338654ac974f5a8049efe12e3eb05355e47
parent2d891c3c5df80825e9ff2bf5b6a4e15042a17c1d (diff)
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
-rw-r--r--java/sca/itest/bpel/helloworld-ws/src/test/java/helloworld/HelloWorld.java2
-rw-r--r--java/sca/itest/bpel/helloworld-ws/src/test/java/helloworld/HelloWorldTestCase.java27
2 files changed, 18 insertions, 11 deletions
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);
}
}