Author: antelder
Date: Wed Jan 19 09:39:38 2011
New Revision: 1060728

URL: http://svn.apache.org/viewvc?rev=1060728&view=rev
Log:
Rename main class to TuscanyRuntime

Added:
    
tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/runtime/TuscanyRuntime.java
      - copied, changed from r1059924, 
tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/runtime/NodeFactory.java
    
tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/
      - copied from r1059924, 
tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/node2/
Removed:
    
tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/runtime/NodeFactory.java
    
tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/node2/
Modified:
    
tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/runtime/impl/NodeImpl.java
    
tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/DeployerTestCase.java
    
tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/NodeTestCase.java
    
tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/NodeXMLTestCase.java
    
tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/TwoNodesTestCase.java

Copied: 
tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/runtime/TuscanyRuntime.java
 (from r1059924, 
tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/runtime/NodeFactory.java)
URL: 
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/runtime/TuscanyRuntime.java?p2=tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/runtime/TuscanyRuntime.java&p1=tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/runtime/NodeFactory.java&r1=1059924&r2=1060728&rev=1060728&view=diff
==============================================================================
--- 
tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/runtime/NodeFactory.java
 (original)
+++ 
tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/runtime/TuscanyRuntime.java
 Wed Jan 19 09:39:38 2011
@@ -49,7 +49,7 @@ import org.apache.tuscany.sca.runtime.im
 import org.apache.tuscany.sca.work.WorkScheduler;
 import org.oasisopen.sca.ServiceRuntimeException;
 
-public class NodeFactory {
+public class TuscanyRuntime {
 
     private Deployer deployer;
     private ExtensionPointRegistry extensionPointRegistry;
@@ -57,26 +57,39 @@ public class NodeFactory {
     private ExtensibleDomainRegistryFactory domainRegistryFactory;
     private RuntimeAssemblyFactory assemblyFactory;
 
-    public static NodeFactory newInstance() {
-        return new NodeFactory(null);
+    public static TuscanyRuntime newInstance() {
+        return new TuscanyRuntime(null);
     }
-    public static NodeFactory newInstance(Properties config) {
-        return new NodeFactory(config);
+    public static TuscanyRuntime newInstance(Properties config) {
+        return new TuscanyRuntime(config);
     }
 
     /**
-     * A helper method to simplify creating a standalone Node 
+     * A helper method to run a standalone SCA composite 
      * @param compositeURI  URI within the contribution of a composite to run 
      *         if compositeURI is null then all deployable composites in the 
contribution will be run 
      * @param contributionURL  URL of the contribution
      * @param dependentContributionURLs  optional URLs of dependent 
contributions
      * @return a Node with installed contributions
      */
-    public static Node createStandaloneNode(String compositeURI, String 
contributionURL, String... dependentContributionURLs) {
+    public static Node runComposite(String compositeURI, String 
contributionURL, String... dependentContributionURLs) {
+        return runComposite(newInstance(), compositeURI, contributionURL, 
dependentContributionURLs);
+    }
+
+    /**
+     * A helper method to run a standalone SCA composite 
+     * @param runtime a TuscanyRuntime instance which will be used to run the 
composite
+     *                 this allows sharing a runtime instance to run multiple 
composites
+     * @param compositeURI  URI within the contribution of a composite to run 
+     *         if compositeURI is null then all deployable composites in the 
contribution will be run 
+     * @param contributionURL  URL of the contribution
+     * @param dependentContributionURLs  optional URLs of dependent 
contributions
+     * @return a Node with installed contributions
+     */
+    public static Node runComposite(TuscanyRuntime runtime, String 
compositeURI, String contributionURL, String... dependentContributionURLs) {
         try {
-            NodeFactory nodeFactory = newInstance();
-            EndpointRegistry endpointRegistry = new 
EndpointRegistryImpl(nodeFactory.extensionPointRegistry, null, null);
-            NodeImpl node = new NodeImpl("default", nodeFactory.deployer, 
nodeFactory.compositeActivator, endpointRegistry, 
nodeFactory.extensionPointRegistry, nodeFactory);
+            EndpointRegistry endpointRegistry = new 
EndpointRegistryImpl(runtime.extensionPointRegistry, null, null);
+            NodeImpl node = new NodeImpl("default", runtime.deployer, 
runtime.compositeActivator, endpointRegistry, runtime.extensionPointRegistry, 
runtime);
 
             if (dependentContributionURLs != null) {
                 for (int i=dependentContributionURLs.length-1; i>-1; i--) {
@@ -95,7 +108,7 @@ public class NodeFactory {
         }
     }
 
-    protected NodeFactory(Properties config) {
+    protected TuscanyRuntime(Properties config) {
         init(config);
     }
     
@@ -122,7 +135,6 @@ public class NodeFactory {
     }
 
     public void stop() {
-        deployer.stop();
         extensionPointRegistry.stop();
     }
 
@@ -152,6 +164,15 @@ public class NodeFactory {
         this.domainRegistryFactory = 
ExtensibleDomainRegistryFactory.getInstance(extensionPointRegistry);
 
     }
+    
+    /**
+     * Get the ExtensionPointRegistry used by this runtime
+     * @return extensionPointRegistry
+     */
+    public ExtensionPointRegistry getExtensionPointRegistry() {
+        return extensionPointRegistry;
+    }
+    
     /**
      * Get the Deployer. The Deployer can be used to create contribution 
artifacts 
      * when configuring a Node programatically.

Modified: 
tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/runtime/impl/NodeImpl.java
URL: 
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/runtime/impl/NodeImpl.java?rev=1060728&r1=1060727&r2=1060728&view=diff
==============================================================================
--- 
tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/runtime/impl/NodeImpl.java
 (original)
+++ 
tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/runtime/impl/NodeImpl.java
 Wed Jan 19 09:39:38 2011
@@ -63,7 +63,7 @@ import org.apache.tuscany.sca.runtime.Ac
 import org.apache.tuscany.sca.runtime.CompositeActivator;
 import org.apache.tuscany.sca.runtime.EndpointRegistry;
 import org.apache.tuscany.sca.runtime.Node;
-import org.apache.tuscany.sca.runtime.NodeFactory;
+import org.apache.tuscany.sca.runtime.TuscanyRuntime;
 import org.apache.tuscany.sca.runtime.RuntimeComponent;
 import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
 import org.apache.tuscany.sca.runtime.RuntimeEndpointReference;
@@ -78,17 +78,17 @@ public class NodeImpl implements Node {
     private CompositeActivator compositeActivator;
     private EndpointRegistry endpointRegistry;
     private ExtensionPointRegistry extensionPointRegistry;
-    private NodeFactory nodeFactory;
+    private TuscanyRuntime tuscanyRuntime;
     
     private static Map<String, Node> allNodes = new HashMap<String, Node>();
     
-    public NodeImpl(String domainName, Deployer deployer, CompositeActivator 
compositeActivator, EndpointRegistry endpointRegistry, ExtensionPointRegistry 
extensionPointRegistry, NodeFactory nodeFactory) {
+    public NodeImpl(String domainName, Deployer deployer, CompositeActivator 
compositeActivator, EndpointRegistry endpointRegistry, ExtensionPointRegistry 
extensionPointRegistry, TuscanyRuntime tuscanyRuntime) {
         this.domainName = domainName;
         this.deployer = deployer;
         this.compositeActivator = compositeActivator;
         this.endpointRegistry = endpointRegistry;
         this.extensionPointRegistry = extensionPointRegistry;
-        this.nodeFactory = nodeFactory;
+        this.tuscanyRuntime = tuscanyRuntime;
         allNodes.put(domainName, this);
     }
 
@@ -273,8 +273,8 @@ public class NodeImpl implements Node {
                 e.printStackTrace();
             }
         }
-        if (nodeFactory != null) {
-            nodeFactory.stop();
+        if (tuscanyRuntime != null) {
+            tuscanyRuntime.stop();
         }
         allNodes.remove(this.domainName);
     }

Modified: 
tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/DeployerTestCase.java
URL: 
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/DeployerTestCase.java?rev=1060728&r1=1059924&r2=1060728&view=diff
==============================================================================
--- 
tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/DeployerTestCase.java
 (original)
+++ 
tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/DeployerTestCase.java
 Wed Jan 19 09:39:38 2011
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.tuscany.sca.node2;
+package org.apache.tuscany.sca.runtime;
 
 import java.io.File;
 import java.net.MalformedURLException;
@@ -35,7 +35,7 @@ import org.apache.tuscany.sca.monitor.Mo
 import org.apache.tuscany.sca.monitor.ValidationException;
 import org.apache.tuscany.sca.runtime.ActivationException;
 import org.apache.tuscany.sca.runtime.Node;
-import org.apache.tuscany.sca.runtime.NodeFactory;
+import org.apache.tuscany.sca.runtime.TuscanyRuntime;
 import org.junit.Test;
 import org.oasisopen.sca.NoSuchDomainException;
 import org.oasisopen.sca.NoSuchServiceException;
@@ -44,10 +44,10 @@ public class DeployerTestCase {
 
     @Test
     public void testInstalledContribution() throws NoSuchServiceException, 
NoSuchDomainException, ContributionReadException, ActivationException, 
ValidationException, MalformedURLException {
-        NodeFactory nodeFactory = NodeFactory.newInstance();
-        Node node = nodeFactory.createNode("myDomain");
+        TuscanyRuntime tuscanyRuntime = TuscanyRuntime.newInstance();
+        Node node = tuscanyRuntime.createNode("myDomain");
         
-        Deployer deployer = nodeFactory.getDeployer();
+        Deployer deployer = tuscanyRuntime.getDeployer();
         Monitor monitor = deployer.createMonitor();
         Contribution contribution = 
deployer.loadContribution(URI.create("foo"), new 
File("src/test/resources/sample-helloworld-nodeployable.jar").toURI().toURL(), 
monitor);
         monitor.analyzeProblems();
@@ -60,12 +60,12 @@ public class DeployerTestCase {
 
     @Test
     public void testAddDeploymentComposite() throws NoSuchServiceException, 
NoSuchDomainException, ContributionReadException, ActivationException, 
ValidationException, MalformedURLException, XMLStreamException {
-        NodeFactory nodeFactory = NodeFactory.newInstance();
-        Node node = nodeFactory.createNode("myDomain");
+        TuscanyRuntime tuscanyRuntime = TuscanyRuntime.newInstance();
+        Node node = tuscanyRuntime.createNode("myDomain");
         
         node.installContribution("foo", 
"src/test/resources/sample-helloworld-nodeployable.jar", null, null, true);
 
-        Deployer deployer = nodeFactory.getDeployer();
+        Deployer deployer = tuscanyRuntime.getDeployer();
         Monitor monitor = deployer.createMonitor();
         Composite composite = deployer.loadXMLDocument(new 
File("src/test/resources/helloworld2.composite").toURI().toURL(), monitor);
         monitor.analyzeProblems();

Modified: 
tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/NodeTestCase.java
URL: 
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/NodeTestCase.java?rev=1060728&r1=1059924&r2=1060728&view=diff
==============================================================================
--- 
tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/NodeTestCase.java
 (original)
+++ 
tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/NodeTestCase.java
 Wed Jan 19 09:39:38 2011
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.tuscany.sca.node2;
+package org.apache.tuscany.sca.runtime;
 
 import java.net.MalformedURLException;
 import java.util.List;
@@ -27,7 +27,7 @@ import org.apache.tuscany.sca.contributi
 import org.apache.tuscany.sca.monitor.ValidationException;
 import org.apache.tuscany.sca.runtime.ActivationException;
 import org.apache.tuscany.sca.runtime.Node;
-import org.apache.tuscany.sca.runtime.NodeFactory;
+import org.apache.tuscany.sca.runtime.TuscanyRuntime;
 import org.apache.tuscany.sca.runtime.impl.NodeImpl;
 import org.junit.Ignore;
 import org.junit.Test;
@@ -40,7 +40,7 @@ public class NodeTestCase {
 
     @Test
     public void testInstallDeployable() throws NoSuchServiceException, 
NoSuchDomainException, ContributionReadException, ActivationException, 
ValidationException {
-        Node node = NodeFactory.newInstance().createNode("default");
+        Node node = TuscanyRuntime.newInstance().createNode("default");
         node.installContribution("helloworld", 
"src/test/resources/sample-helloworld.jar", null, null, true);
 
         Helloworld helloworldService = node.getService(Helloworld.class, 
"HelloworldComponent");
@@ -49,7 +49,7 @@ public class NodeTestCase {
 
     @Test
     public void testStopStart() throws NoSuchServiceException, 
NoSuchDomainException, ContributionReadException, ActivationException, 
ValidationException {
-        Node node = NodeFactory.newInstance().createNode("default");
+        Node node = TuscanyRuntime.newInstance().createNode("default");
         node.installContribution("helloworld", 
"src/test/resources/sample-helloworld.jar", null, null, true);
         String ci = node.getStartedCompositeURIs("helloworld").get(0);
 
@@ -72,7 +72,7 @@ public class NodeTestCase {
     @Test
     @Ignore("Depdends on itest/T3558 which isn't in the build?")
     public void testInstallWithDependent() throws NoSuchServiceException, 
ContributionReadException, ActivationException, ValidationException {
-        Node node = NodeFactory.newInstance().createNode("default");
+        Node node = TuscanyRuntime.newInstance().createNode("default");
         node.installContribution("store", 
"../../itest/T3558/src/test/resources/sample-store.jar", null, null, true);
         node.installContribution("store-client", 
"../../itest/T3558/src/test/resources/sample-store-client.jar", null, null, 
true);
 
@@ -82,7 +82,7 @@ public class NodeTestCase {
 
     @Test
     public void testInstallNoDeployable() throws NoSuchServiceException, 
NoSuchDomainException, ContributionReadException, ActivationException, 
ValidationException {
-        Node node = NodeFactory.newInstance().createNode("default");
+        Node node = TuscanyRuntime.newInstance().createNode("default");
         node.installContribution("helloworld", 
"src/test/resources/sample-helloworld-nodeployable.jar", null, null, true);
 
         try {
@@ -99,7 +99,7 @@ public class NodeTestCase {
 
     @Test
     public void testGetInstalledContributions() throws NoSuchServiceException, 
NoSuchDomainException, ContributionReadException, ActivationException, 
ValidationException {
-        Node node = NodeFactory.newInstance().createNode("default");
+        Node node = TuscanyRuntime.newInstance().createNode("default");
         node.installContribution("foo", 
"src/test/resources/sample-helloworld-nodeployable.jar", null, null, true);
         List<String> ics = node.getInstalledContributionURIs();
         Assert.assertEquals(1, ics.size());
@@ -108,7 +108,7 @@ public class NodeTestCase {
 
     @Test
     public void testGetDeployedCompostes() throws NoSuchServiceException, 
NoSuchDomainException, ContributionReadException, MalformedURLException, 
ActivationException, ValidationException {
-        Node node = NodeFactory.newInstance().createNode("default");
+        Node node = TuscanyRuntime.newInstance().createNode("default");
         node.installContribution("foo", 
"src/test/resources/sample-helloworld.jar", null, null, true);
         List<String> dcs = node.getStartedCompositeURIs("foo");
         Assert.assertEquals(1, dcs.size());
@@ -117,7 +117,7 @@ public class NodeTestCase {
 
     @Test
     public void testRemoveComposte() throws NoSuchServiceException, 
NoSuchDomainException, ContributionReadException, MalformedURLException, 
ActivationException, ValidationException {
-        Node node = NodeFactory.newInstance().createNode("default");
+        Node node = TuscanyRuntime.newInstance().createNode("default");
         node.installContribution("foo", 
"src/test/resources/sample-helloworld.jar", null, null, true);
         node.stop("foo", "helloworld.composite");
         List<String> dcs = node.getStartedCompositeURIs("foo");
@@ -126,7 +126,7 @@ public class NodeTestCase {
 
     @Test
     public void testInstallWithMetaData() throws ContributionReadException, 
ActivationException, ValidationException, NoSuchServiceException {
-        Node node = NodeFactory.newInstance().createNode("default");
+        Node node = TuscanyRuntime.newInstance().createNode("default");
         ((NodeImpl)node).installContribution("helloworld", 
"src/test/resources/sample-helloworld-nodeployable.jar", 
"src/test/resources/sca-contribution-generated.xml", null, true);
 
         List<String> dcs = node.getStartedCompositeURIs("helloworld");
@@ -139,14 +139,14 @@ public class NodeTestCase {
 
     @Test
     public void testURI() throws NoSuchServiceException, 
NoSuchDomainException, ContributionReadException, ActivationException, 
ValidationException {
-        Node node = NodeFactory.newInstance().createNode("default");
+        Node node = TuscanyRuntime.newInstance().createNode("default");
         String uri = 
node.installContribution("src/test/resources/sample-helloworld.jar");
         Assert.assertEquals("sample-helloworld", uri);
     }
 
     @Test
     public void testStaticCreate() {
-        Node node = NodeFactory.createStandaloneNode("helloworld.composite", 
"src/test/resources/sample-helloworld.jar");
+        Node node = TuscanyRuntime.runComposite("helloworld.composite", 
"src/test/resources/sample-helloworld.jar");
         List<String> cs = node.getInstalledContributionURIs();
         Assert.assertEquals(1, cs.size());
         List<String> dcs = node.getStartedCompositeURIs(cs.get(0));
@@ -156,7 +156,7 @@ public class NodeTestCase {
 
     @Test
     public void testStaticCreateWithNullComposite() {
-        Node node = NodeFactory.createStandaloneNode(null, 
"src/test/resources/sample-helloworld.jar");
+        Node node = TuscanyRuntime.runComposite(null, 
"src/test/resources/sample-helloworld.jar");
         List<String> cs = node.getInstalledContributionURIs();
         Assert.assertEquals(1, cs.size());
         List<String> dcs = node.getStartedCompositeURIs(cs.get(0));

Modified: 
tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/NodeXMLTestCase.java
URL: 
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/NodeXMLTestCase.java?rev=1060728&r1=1059924&r2=1060728&view=diff
==============================================================================
--- 
tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/NodeXMLTestCase.java
 (original)
+++ 
tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/NodeXMLTestCase.java
 Wed Jan 19 09:39:38 2011
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.tuscany.sca.node2;
+package org.apache.tuscany.sca.runtime;
 
 import java.util.List;
 
@@ -26,14 +26,14 @@ import org.apache.tuscany.sca.contributi
 import org.apache.tuscany.sca.monitor.ValidationException;
 import org.apache.tuscany.sca.runtime.ActivationException;
 import org.apache.tuscany.sca.runtime.Node;
-import org.apache.tuscany.sca.runtime.NodeFactory;
+import org.apache.tuscany.sca.runtime.TuscanyRuntime;
 import org.junit.Test;
 
 public class NodeXMLTestCase {
 
     @Test
     public void testHelloworldXML() throws ContributionReadException, 
ActivationException, ValidationException {
-        Node node = 
NodeFactory.newInstance().createNodeFromXML("src/test/resources/helloworldNode.xml");
+        Node node = 
TuscanyRuntime.newInstance().createNodeFromXML("src/test/resources/helloworldNode.xml");
         Assert.assertEquals("helloworld", node.getDomainName());
         List<String> cs = node.getInstalledContributionURIs();
         Assert.assertEquals(1, cs.size());

Modified: 
tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/TwoNodesTestCase.java
URL: 
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/TwoNodesTestCase.java?rev=1060728&r1=1059924&r2=1060728&view=diff
==============================================================================
--- 
tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/TwoNodesTestCase.java
 (original)
+++ 
tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/TwoNodesTestCase.java
 Wed Jan 19 09:39:38 2011
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.tuscany.sca.node2;
+package org.apache.tuscany.sca.runtime;
 
 import junit.framework.Assert;
 
@@ -24,7 +24,7 @@ import org.apache.tuscany.sca.contributi
 import org.apache.tuscany.sca.monitor.ValidationException;
 import org.apache.tuscany.sca.runtime.ActivationException;
 import org.apache.tuscany.sca.runtime.Node;
-import org.apache.tuscany.sca.runtime.NodeFactory;
+import org.apache.tuscany.sca.runtime.TuscanyRuntime;
 import org.junit.Test;
 import org.oasisopen.sca.NoSuchDomainException;
 import org.oasisopen.sca.NoSuchServiceException;
@@ -36,11 +36,11 @@ public class TwoNodesTestCase {
     @Test
     public void testInstallDeployable() throws NoSuchServiceException, 
NoSuchDomainException, ContributionReadException, ActivationException, 
ValidationException {
 //        Node node1 = 
NodeFactory.newInstance().createNode("uri:TwoNodesTestCase?multicast=off&bind=127.0.0.1:44331");
-        Node node1 = 
NodeFactory.newInstance().createNode("uri:TwoNodesTestCase");
+        Node node1 = 
TuscanyRuntime.newInstance().createNode("uri:TwoNodesTestCase");
         node1.installContribution("helloworld", 
"src/test/resources/sample-helloworld.jar", null, null, true);
 
 //        Node node2 = 
NodeFactory.newInstance().createNode("uri:TwoNodesTestCase?multicast=off&bind=127.0.0.1:44332&wka=127.0.0.1:44331");
-        Node node2 = 
NodeFactory.newInstance().createNode("uri:TwoNodesTestCase");
+        Node node2 = 
TuscanyRuntime.newInstance().createNode("uri:TwoNodesTestCase");
 
         Helloworld helloworldService = node2.getService(Helloworld.class, 
"HelloworldComponent");
         Assert.assertEquals("Hello petra", 
helloworldService.sayHello("petra"));


Reply via email to