summaryrefslogtreecommitdiffstats
path: root/java/sca/itest/callback-api
diff options
context:
space:
mode:
Diffstat (limited to 'java/sca/itest/callback-api')
-rw-r--r--java/sca/itest/callback-api/pom.xml12
-rw-r--r--java/sca/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClientImpl.java3
-rw-r--r--java/sca/itest/callback-api/src/test/java/org/apache/tuscany/sca/test/CallBackApiTestCase.java40
3 files changed, 35 insertions, 20 deletions
diff --git a/java/sca/itest/callback-api/pom.xml b/java/sca/itest/callback-api/pom.xml
index 65d641daae..c2676b0df2 100644
--- a/java/sca/itest/callback-api/pom.xml
+++ b/java/sca/itest/callback-api/pom.xml
@@ -31,16 +31,24 @@
<dependencies>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
+ <artifactId>tuscany-node-api</artifactId>
<version>2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-implementation-java-runtime</artifactId>
<version>2.0-SNAPSHOT</version>
- <scope>runtime</scope>
+ <scope>test</scope>
</dependency>
+
</dependencies>
<properties>
diff --git a/java/sca/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClientImpl.java b/java/sca/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClientImpl.java
index 274984abb3..0535ceb826 100644
--- a/java/sca/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClientImpl.java
+++ b/java/sca/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClientImpl.java
@@ -18,8 +18,7 @@
*/
package org.apache.tuscany.sca.test;
-import junit.framework.Assert;
-
+import org.junit.Assert;
import org.osoa.sca.annotations.Reference;
import org.osoa.sca.annotations.Service;
diff --git a/java/sca/itest/callback-api/src/test/java/org/apache/tuscany/sca/test/CallBackApiTestCase.java b/java/sca/itest/callback-api/src/test/java/org/apache/tuscany/sca/test/CallBackApiTestCase.java
index 9471049c74..75fab95efb 100644
--- a/java/sca/itest/callback-api/src/test/java/org/apache/tuscany/sca/test/CallBackApiTestCase.java
+++ b/java/sca/itest/callback-api/src/test/java/org/apache/tuscany/sca/test/CallBackApiTestCase.java
@@ -18,13 +18,17 @@
*/
package org.apache.tuscany.sca.test;
-import junit.framework.TestCase;
+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;
+import org.junit.Test;
-import org.apache.tuscany.sca.host.embedded.SCADomain;
+public class CallBackApiTestCase {
-public class CallBackApiTestCase extends TestCase {
-
- private static SCADomain domain;
+ private static Node node;
private CallBackApiClient aCallBackClient;
/**
@@ -35,28 +39,32 @@ public class CallBackApiTestCase extends TestCase {
* 2. Test in which the target does not call back to the client <br>
* 3. Test in which the target calls back multiple times to the client.
*/
+ @Test
public void testCallBackBasic() {
+ aCallBackClient = node.getService(CallBackApiClient.class, "CallBackApiClient");
aCallBackClient.run();
}
/**
- * This function creates the SCADomain instance and gets an Instance of CallBackApiClient.class
+ * This function creates the Node instance and gets an Instance of CallBackApiClient.class
*/
- @Override
- protected void setUp() throws Exception {
- if (domain == null) {
- domain = SCADomain.newInstance("CallBackApiTest.composite");
- }
- aCallBackClient = domain.getService(CallBackApiClient.class, "CallBackApiClient");
+ @BeforeClass
+ public static void setUp() throws Exception {
+ if (node == null) {
+ String location = ContributionLocationHelper.getContributionLocation("CallBackApiTest.composite");
+ node = NodeFactory.newInstance().createNode("CallBackApiTest.composite", new Contribution("c1", location));
+ node.start();
+ }
}
/**
- * This function destroys the SCADomain instance that was created in setUp()
+ * This function destroys the Node instance that was created in setUp()
*/
- @Override
- protected void tearDown() throws Exception {
- domain.close();
+
+ @AfterClass
+ public static void tearDown() throws Exception {
+ node.stop();
}
}