summaryrefslogtreecommitdiffstats
path: root/branches/sca-equinox/samples/calculator/src/test/java/calculator/CalculatorTestCase.java
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2008-10-09 06:33:54 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2008-10-09 06:33:54 +0000
commitefe3363a815a777ecd283928900404dea84a7e1f (patch)
tree42522fd01e6af981f8ff94663d911d56744154d5 /branches/sca-equinox/samples/calculator/src/test/java/calculator/CalculatorTestCase.java
parentaacabe1650e380595a8d701123394d791656d17d (diff)
Work in progress. Fixed implementation of NodeImpl, now working without dependencies on implementations from other bundles (except RuntimeAssemblyFactory, which will need to be cleaned up too). Started to remove dependencies on host-embedded and port code to NodeFactory and Node, as an interim step to bring them up, before porting them to the OSGi-enabled node launcher.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@703068 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r--branches/sca-equinox/samples/calculator/src/test/java/calculator/CalculatorTestCase.java18
1 files changed, 11 insertions, 7 deletions
diff --git a/branches/sca-equinox/samples/calculator/src/test/java/calculator/CalculatorTestCase.java b/branches/sca-equinox/samples/calculator/src/test/java/calculator/CalculatorTestCase.java
index 1b7476534a..1a880d2656 100644
--- a/branches/sca-equinox/samples/calculator/src/test/java/calculator/CalculatorTestCase.java
+++ b/branches/sca-equinox/samples/calculator/src/test/java/calculator/CalculatorTestCase.java
@@ -20,9 +20,11 @@ package calculator;
import junit.framework.TestCase;
-import org.apache.tuscany.sca.node.SCAClient;
-import org.apache.tuscany.sca.node.SCANode;
-import org.apache.tuscany.sca.node.SCANodeFactory;
+import org.apache.tuscany.sca.node.Client;
+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;
/**
* This shows how to test the Calculator service component.
@@ -30,20 +32,22 @@ import org.apache.tuscany.sca.node.SCANodeFactory;
public class CalculatorTestCase extends TestCase {
private CalculatorService calculatorService;
- private SCANode node;
+ private Node node;
@Override
protected void setUp() throws Exception {
- SCANodeFactory factory = SCANodeFactory.newInstance();
- node = factory.createSCANodeFromClassLoader("Calculator.composite", getClass().getClassLoader());
+ NodeFactory factory = NodeFactory.newInstance();
+ String contribution = ContributionLocationHelper.getContributionLocation(CalculatorClient.class);
+ node = factory.createNode("Calculator.composite", new Contribution("calculator", contribution));
node.start();
- calculatorService = ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent");
+ calculatorService = ((Client)node).getService(CalculatorService.class, "CalculatorServiceComponent");
}
@Override
protected void tearDown() throws Exception {
node.stop();
+ node.destroy();
}
public void testCalculator() throws Exception {