summaryrefslogtreecommitdiffstats
path: root/sca-java-1.x/trunk/samples/calculator-distributed/src
diff options
context:
space:
mode:
Diffstat (limited to 'sca-java-1.x/trunk/samples/calculator-distributed/src')
-rw-r--r--sca-java-1.x/trunk/samples/calculator-distributed/src/main/java/node/LaunchDomain.java5
-rw-r--r--sca-java-1.x/trunk/samples/calculator-distributed/src/main/resources/cloud.composite26
-rw-r--r--sca-java-1.x/trunk/samples/calculator-distributed/src/main/resources/cloud/NodeA.composite2
-rw-r--r--sca-java-1.x/trunk/samples/calculator-distributed/src/main/resources/cloud/NodeB.composite2
-rw-r--r--sca-java-1.x/trunk/samples/calculator-distributed/src/main/resources/cloud/NodeC.composite2
-rw-r--r--sca-java-1.x/trunk/samples/calculator-distributed/src/main/resources/domain.composite26
-rw-r--r--sca-java-1.x/trunk/samples/calculator-distributed/src/main/resources/workspace.xml25
-rw-r--r--sca-java-1.x/trunk/samples/calculator-distributed/src/test/java/calculator/CalculatorDistributedTestCase.java2
8 files changed, 85 insertions, 5 deletions
diff --git a/sca-java-1.x/trunk/samples/calculator-distributed/src/main/java/node/LaunchDomain.java b/sca-java-1.x/trunk/samples/calculator-distributed/src/main/java/node/LaunchDomain.java
index 8b4fe566a1..114c07edeb 100644
--- a/sca-java-1.x/trunk/samples/calculator-distributed/src/main/java/node/LaunchDomain.java
+++ b/sca-java-1.x/trunk/samples/calculator-distributed/src/main/java/node/LaunchDomain.java
@@ -26,8 +26,11 @@ import org.apache.tuscany.sca.node.launcher.DomainManagerLauncher;
* in each node that talk to the registry should be replaced also.
*/
public class LaunchDomain {
+ private static String[] defaultRootDir = {"./target/classes/"};
+
public static void main(String[] args) throws Exception {
- DomainManagerLauncher.main(args);
+ String[] rootDir = args.length > 0 ? args : defaultRootDir;
+ DomainManagerLauncher.main(rootDir);
}
}
diff --git a/sca-java-1.x/trunk/samples/calculator-distributed/src/main/resources/cloud.composite b/sca-java-1.x/trunk/samples/calculator-distributed/src/main/resources/cloud.composite
new file mode 100644
index 0000000000..1d37da39de
--- /dev/null
+++ b/sca-java-1.x/trunk/samples/calculator-distributed/src/main/resources/cloud.composite
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite name="cloud.composite"
+ targetNamespace="http://tuscany.apache.org/xmlns/sca/1.0"
+ xmlns="http://www.osoa.org/xmlns/sca/1.0" xmlns:ns1="http://www.osoa.org/xmlns/sca/1.0">
+ <include name="ns2:NodeA" uri="http://tuscany.apache.org/cloud" xmlns:ns2="http://tuscany.apache.org/cloud"/>
+ <include name="ns2:NodeB" uri="http://tuscany.apache.org/cloud" xmlns:ns2="http://tuscany.apache.org/cloud"/>
+ <include name="ns2:NodeC" uri="http://tuscany.apache.org/cloud" xmlns:ns2="http://tuscany.apache.org/cloud"/>
+</composite>
diff --git a/sca-java-1.x/trunk/samples/calculator-distributed/src/main/resources/cloud/NodeA.composite b/sca-java-1.x/trunk/samples/calculator-distributed/src/main/resources/cloud/NodeA.composite
index ed7fe55abc..7f03eb52c2 100644
--- a/sca-java-1.x/trunk/samples/calculator-distributed/src/main/resources/cloud/NodeA.composite
+++ b/sca-java-1.x/trunk/samples/calculator-distributed/src/main/resources/cloud/NodeA.composite
@@ -19,7 +19,7 @@
-->
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
- targetNamespace="http://sample/cloud"
+ targetNamespace="http://tuscany.apache.org/cloud"
xmlns:s="http://sample"
name="NodeA">
diff --git a/sca-java-1.x/trunk/samples/calculator-distributed/src/main/resources/cloud/NodeB.composite b/sca-java-1.x/trunk/samples/calculator-distributed/src/main/resources/cloud/NodeB.composite
index 8f29cc17aa..74f06cc289 100644
--- a/sca-java-1.x/trunk/samples/calculator-distributed/src/main/resources/cloud/NodeB.composite
+++ b/sca-java-1.x/trunk/samples/calculator-distributed/src/main/resources/cloud/NodeB.composite
@@ -19,7 +19,7 @@
-->
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
- targetNamespace="http://sample/cloud"
+ targetNamespace="http://tuscany.apache.org/cloud"
xmlns:s="http://sample"
name="NodeB">
diff --git a/sca-java-1.x/trunk/samples/calculator-distributed/src/main/resources/cloud/NodeC.composite b/sca-java-1.x/trunk/samples/calculator-distributed/src/main/resources/cloud/NodeC.composite
index 9ad132b0d4..f29230365a 100644
--- a/sca-java-1.x/trunk/samples/calculator-distributed/src/main/resources/cloud/NodeC.composite
+++ b/sca-java-1.x/trunk/samples/calculator-distributed/src/main/resources/cloud/NodeC.composite
@@ -19,7 +19,7 @@
-->
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
- targetNamespace="http://sample/cloud"
+ targetNamespace="http://tuscany.apache.org/cloud"
xmlns:s="http://sample"
name="NodeC">
diff --git a/sca-java-1.x/trunk/samples/calculator-distributed/src/main/resources/domain.composite b/sca-java-1.x/trunk/samples/calculator-distributed/src/main/resources/domain.composite
new file mode 100644
index 0000000000..643e22d0cf
--- /dev/null
+++ b/sca-java-1.x/trunk/samples/calculator-distributed/src/main/resources/domain.composite
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite name="domain.composite"
+ targetNamespace="http://tuscany.apache.org/xmlns/sca/1.0"
+ xmlns="http://www.osoa.org/xmlns/sca/1.0" xmlns:ns1="http://www.osoa.org/xmlns/sca/1.0">
+ <include name="ns2:CalculatorA" uri="nodeA" xmlns:ns2="http://sample"/>
+ <include name="ns2:CalculatorB" uri="nodeB" xmlns:ns2="http://sample"/>
+ <include name="ns2:CalculatorC" uri="nodeC" xmlns:ns2="http://sample"/>
+</composite>
diff --git a/sca-java-1.x/trunk/samples/calculator-distributed/src/main/resources/workspace.xml b/sca-java-1.x/trunk/samples/calculator-distributed/src/main/resources/workspace.xml
new file mode 100644
index 0000000000..818b0550dc
--- /dev/null
+++ b/sca-java-1.x/trunk/samples/calculator-distributed/src/main/resources/workspace.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<workspace xmlns="http://tuscany.apache.org/xmlns/sca/1.0" xmlns:ns1="http://tuscany.apache.org/xmlns/sca/1.0">
+ <contribution location="file:./target/classes/nodeA" uri="nodeA"/>
+ <contribution location="file:./target/classes/nodeB" uri="nodeB"/>
+ <contribution location="file:./target/classes/nodeC" uri="nodeC"/>
+ <contribution location="file:./target/classes/cloud" uri="http://tuscany.apache.org/cloud"/>
+</workspace>
diff --git a/sca-java-1.x/trunk/samples/calculator-distributed/src/test/java/calculator/CalculatorDistributedTestCase.java b/sca-java-1.x/trunk/samples/calculator-distributed/src/test/java/calculator/CalculatorDistributedTestCase.java
index 2a6f3af002..92197ac07c 100644
--- a/sca-java-1.x/trunk/samples/calculator-distributed/src/test/java/calculator/CalculatorDistributedTestCase.java
+++ b/sca-java-1.x/trunk/samples/calculator-distributed/src/test/java/calculator/CalculatorDistributedTestCase.java
@@ -50,7 +50,7 @@ public class CalculatorDistributedTestCase {
System.out.println("Setting up domain");
DomainManagerLauncher managerLauncher = DomainManagerLauncher.newInstance();
- manager = managerLauncher.createDomainManager();
+ manager = managerLauncher.createDomainManager("./target/classes/");
manager.start();
SCANodeFactory nodeFactory = SCANodeFactory.newInstance();