diff options
author | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2008-10-09 06:33:54 +0000 |
---|---|---|
committer | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2008-10-09 06:33:54 +0000 |
commit | efe3363a815a777ecd283928900404dea84a7e1f (patch) | |
tree | 42522fd01e6af981f8ff94663d911d56744154d5 /branches/sca-equinox/samples/calculator/src/test | |
parent | aacabe1650e380595a8d701123394d791656d17d (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 'branches/sca-equinox/samples/calculator/src/test')
-rw-r--r-- | branches/sca-equinox/samples/calculator/src/test/java/calculator/CalculatorTestCase.java | 18 |
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 { |