diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2008-11-21 12:16:29 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2008-11-21 12:16:29 +0000 |
commit | 65e3fd65b82c7cd08cfdeee8819f571212b3b1fe (patch) | |
tree | 72142bd4e7fbd9becf3f43d09dde26836562d72f /java/sca/samples/calculator/src | |
parent | 6a9b9b7586fd7a377d57b5ce0117c664beebff25 (diff) |
Simplify the Node API for a common default case so that creating a Node for simple samples and tests can be:
node = NodeFactory.newInstance().createNode();
instead of:
NodeFactory factory = NodeFactory.newInstance();
String root = ContributionLocationHelper.getContributionLocation("Calculator.composite");
Contribution contribution = new Contribution(root, root);
node = factory.createNode("Calculator.composite", contribution);
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@719565 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/samples/calculator/src')
-rw-r--r-- | java/sca/samples/calculator/src/main/java/calculator/CalculatorClient.java | 7 | ||||
-rw-r--r-- | java/sca/samples/calculator/src/test/java/calculator/CalculatorTestCase.java | 8 |
2 files changed, 2 insertions, 13 deletions
diff --git a/java/sca/samples/calculator/src/main/java/calculator/CalculatorClient.java b/java/sca/samples/calculator/src/main/java/calculator/CalculatorClient.java index 5496521525..03fc56ceb3 100644 --- a/java/sca/samples/calculator/src/main/java/calculator/CalculatorClient.java +++ b/java/sca/samples/calculator/src/main/java/calculator/CalculatorClient.java @@ -20,8 +20,6 @@ package calculator; 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; @@ -32,10 +30,7 @@ import org.apache.tuscany.sca.node.NodeFactory; public class CalculatorClient { public static void main(String[] args) throws Exception { - NodeFactory factory = NodeFactory.newInstance(); - String root = ContributionLocationHelper.getContributionLocation("Calculator.composite"); - Contribution contribution = new Contribution(root, root); - Node node = factory.createNode("Calculator.composite", contribution); + Node node = NodeFactory.newInstance().createNode(); node.start(); diff --git a/java/sca/samples/calculator/src/test/java/calculator/CalculatorTestCase.java b/java/sca/samples/calculator/src/test/java/calculator/CalculatorTestCase.java index 464950f08c..6bc7e21606 100644 --- a/java/sca/samples/calculator/src/test/java/calculator/CalculatorTestCase.java +++ b/java/sca/samples/calculator/src/test/java/calculator/CalculatorTestCase.java @@ -21,8 +21,6 @@ package calculator; import junit.framework.TestCase; 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; @@ -36,11 +34,7 @@ public class CalculatorTestCase extends TestCase { @Override protected void setUp() throws Exception { - NodeFactory factory = NodeFactory.newInstance(); - String root = ContributionLocationHelper.getContributionLocation("Calculator.composite"); - Contribution contribution = new Contribution(root, root); - node = factory.createNode("Calculator.composite", contribution); - + node = NodeFactory.newInstance().createNode(); node.start(); calculatorService = ((Client)node).getService(CalculatorService.class, "CalculatorServiceComponent"); |