diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2012-04-12 09:14:28 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2012-04-12 09:14:28 +0000 |
commit | bad1f71da1978610806427e2e2a2f96a2fb5b88e (patch) | |
tree | 334e5c38ba5cc33fd853e37c640728ec020862fb /sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test | |
parent | 57c2c65b9d869afc1be14926da2ece51ab52231b (diff) |
Tag 2.0 RC1
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1325166 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test')
45 files changed, 948 insertions, 0 deletions
diff --git a/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/java/itest/nodes/Helloworld.java b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/java/itest/nodes/Helloworld.java new file mode 100644 index 0000000000..ee15dfba12 --- /dev/null +++ b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/java/itest/nodes/Helloworld.java @@ -0,0 +1,29 @@ +/*
+ * 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.
+ */
+
+package itest.nodes;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+public interface Helloworld {
+
+ String sayHello(String name);
+
+}
diff --git a/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/java/org/apache/tuscany/sca/impl/Node2TestCase.java b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/java/org/apache/tuscany/sca/impl/Node2TestCase.java new file mode 100644 index 0000000000..45dbec605a --- /dev/null +++ b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/java/org/apache/tuscany/sca/impl/Node2TestCase.java @@ -0,0 +1,312 @@ +/*
+ * 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.
+ */
+package org.apache.tuscany.sca.impl;
+
+import java.io.Reader;
+import java.io.StringReader;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.stream.XMLStreamException;
+
+import junit.framework.Assert;
+
+import org.apache.tuscany.sca.Node;
+import org.apache.tuscany.sca.TuscanyRuntime;
+import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.contribution.Contribution;
+import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
+import org.apache.tuscany.sca.monitor.ValidationException;
+import org.apache.tuscany.sca.runtime.ActivationException;
+import org.apache.tuscany.sca.runtime.ContributionDescription;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.oasisopen.sca.NoSuchDomainException;
+import org.oasisopen.sca.NoSuchServiceException;
+
+public class Node2TestCase {
+
+ @Test
+ public void localInstall() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException {
+ Node node = TuscanyRuntime.newInstance().createNode("ImportTestCase");
+ node.installContribution("src/test/resources/import.jar");
+
+ Assert.assertEquals(1, node.getInstalledContributionURIs().size());
+ Assert.assertEquals("import", node.getInstalledContributionURIs().get(0));
+ Contribution c = node.getContribution("import");
+ Assert.assertNotNull(c);
+ }
+
+ @Test
+ public void remoteInstall() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException {
+ Node node = TuscanyRuntime.newInstance().createNode("ImportTestCase");
+ node.installContribution("https://repository.apache.org/content/groups/snapshots/org/apache/tuscany/sca/samples/helloworld/2.0-SNAPSHOT/helloworld-2.0-SNAPSHOT.jar");
+
+ Assert.assertEquals(1, node.getInstalledContributionURIs().size());
+ Assert.assertEquals("helloworld", node.getInstalledContributionURIs().get(0));
+ Contribution c = node.getContribution("helloworld");
+ Assert.assertNotNull(c);
+ }
+
+ @Test
+ public void DistributedInstall() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException {
+ TuscanyRuntime runtime = TuscanyRuntime.newInstance();
+ try {
+ Node nodeA = runtime.createNode("uri:DistributedInstall");
+ nodeA.installContribution("https://repository.apache.org/content/groups/snapshots/org/apache/tuscany/sca/samples/helloworld/2.0-SNAPSHOT/helloworld-2.0-SNAPSHOT.jar");
+ nodeA.installContribution("src/test/resources/export.jar");
+
+ Assert.assertEquals(2, nodeA.getInstalledContributionURIs().size());
+ Assert.assertTrue(nodeA.getInstalledContributionURIs().contains("export"));
+ Assert.assertTrue(nodeA.getInstalledContributionURIs().contains("helloworld"));
+ Contribution cA = nodeA.getContribution("helloworld");
+ Assert.assertNotNull(cA);
+
+ Node nodeB = runtime.createNode("uri:DistributedInstall");
+ Assert.assertEquals(2, nodeB.getInstalledContributionURIs().size());
+ Assert.assertTrue(nodeB.getInstalledContributionURIs().contains("export"));
+ Assert.assertTrue(nodeB.getInstalledContributionURIs().contains("helloworld"));
+ Contribution cB = nodeB.getContribution("helloworld");
+ Assert.assertNotNull(cB);
+
+ ContributionDescription cd = ((NodeImpl)nodeB).getInstalledContribution("export");
+ Assert.assertEquals(1, cd.getJavaExports().size());
+ Assert.assertEquals("sample", cd.getJavaExports().get(0));
+ } finally {
+ runtime.stop();
+ }
+ }
+
+ @Test
+ public void deployables() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException {
+ Node node = TuscanyRuntime.newInstance().createNode("ImportTestCase");
+ node.installContribution("src/test/resources/import.jar");
+
+ Assert.assertEquals(1, node.getInstalledContributionURIs().size());
+ Assert.assertEquals("import", node.getInstalledContributionURIs().get(0));
+ List<String> ds = node.getDeployableCompositeURIs("import");
+ Assert.assertEquals(1, ds.size());
+ Assert.assertEquals("helloworld.composite", ds.get(0));
+
+ }
+
+ @Test
+ public void exports() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException {
+ Node node = TuscanyRuntime.newInstance().createNode("ImportTestCase");
+ node.installContribution("src/test/resources/export.jar");
+
+ Assert.assertEquals(1, node.getInstalledContributionURIs().size());
+ Assert.assertEquals("export", node.getInstalledContributionURIs().get(0));
+
+ ContributionDescription cd = ((NodeImpl)node).getInstalledContribution("export");
+ Assert.assertEquals(1, cd.getJavaExports().size());
+ Assert.assertEquals("sample", cd.getJavaExports().get(0));
+ }
+
+ @Test
+ public void validValidate() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException {
+ Node node = TuscanyRuntime.newInstance().createNode("ImportTestCase");
+ node.installContribution("src/test/resources/sample-helloworld.jar");
+ node.validateContribution("sample-helloworld");
+ }
+
+ @Test
+ public void invalidValidate() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException {
+ Node node = TuscanyRuntime.newInstance().createNode("ImportTestCase");
+ node.installContribution("src/test/resources/import.jar");
+ try {
+ node.validateContribution("import");
+ } catch (ValidationException e) {
+ Assert.assertTrue(e.getMessage().endsWith("Unresolved import: Import = sample"));
+ }
+ }
+
+ @Test
+ public void importExportValidate() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException {
+ Node node = TuscanyRuntime.newInstance().createNode("ImportTestCase");
+ node.installContribution("src/test/resources/import.jar");
+ try {
+ node.validateContribution("import");
+ } catch (ValidationException e) {
+ // expected
+ }
+ node.installContribution("src/test/resources/export.jar");
+ node.validateContribution("import");
+ node.startComposite("import", "helloworld.composite");
+ Map<String, List<String>> scs = node.getStartedCompositeURIs();
+ Assert.assertEquals(1, scs.size());
+ }
+
+ @Test
+ public void importExportDistributedValidate() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException {
+ TuscanyRuntime runtime = TuscanyRuntime.newInstance();
+ try {
+ Node nodeA = runtime.createNode("uri:ImportTestCase");
+ nodeA.installContribution("src/test/resources/import.jar");
+ try {
+ nodeA.validateContribution("import");
+ } catch (ValidationException e) {
+ // expected
+ }
+ Node nodeB =runtime.createNode("uri:ImportTestCase");
+ nodeB.installContribution("src/test/resources/export.jar");
+ nodeA.validateContribution("import");
+ nodeA.startComposite("import", "helloworld.composite");
+ Map<String, List<String>> scs = nodeB.getStartedCompositeURIs();
+ Assert.assertEquals(1, scs.size());
+ }finally {
+ runtime.stop();
+ }
+
+ }
+
+ @Test
+ public void startTest() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException {
+ Node node = TuscanyRuntime.newInstance().createNode("ImportTestCase");
+ node.installContribution("src/test/resources/sample-helloworld.jar");
+ Assert.assertEquals(0, node.getStartedCompositeURIs().size());
+
+ node.startComposite("sample-helloworld", "helloworld.composite");
+ Assert.assertEquals(1, node.getStartedCompositeURIs().size());
+ Assert.assertEquals("helloworld.composite", node.getStartedCompositeURIs().get("sample-helloworld").get(0));
+
+ node.stopComposite("sample-helloworld", "helloworld.composite");
+// Assert.assertEquals(0, node.getStartedComposites().size());
+ node.startComposite("sample-helloworld", "helloworld.composite");
+ Assert.assertEquals(1, node.getStartedCompositeURIs().size());
+ Assert.assertEquals("helloworld.composite", node.getStartedCompositeURIs().get("sample-helloworld").get(0));
+ node.stopComposite("sample-helloworld", "helloworld.composite");
+ }
+
+ @Test
+ public void startDistributedTest() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException, InterruptedException {
+ TuscanyRuntime runtime = TuscanyRuntime.newInstance();
+ try {
+ Node node = runtime.createNode("uri:ImportTestCase");
+ Node node2 = runtime.createNode("uri:ImportTestCase");
+
+ node.installContribution("src/test/resources/sample-helloworld.jar");
+ Assert.assertEquals(1, node.getInstalledContributionURIs().size());
+ Assert.assertEquals(1, node2.getInstalledContributionURIs().size());
+
+ node.startComposite("sample-helloworld", "helloworld.composite");
+ Assert.assertEquals(1, node.getStartedCompositeURIs().size());
+ Assert.assertEquals(1, node2.getStartedCompositeURIs().size());
+
+ Assert.assertEquals("helloworld.composite", node.getStartedCompositeURIs().get("sample-helloworld").get(0));
+ Assert.assertEquals("helloworld.composite", node2.getStartedCompositeURIs().get("sample-helloworld").get(0));
+
+ node.stopComposite("sample-helloworld", "helloworld.composite");
+ Assert.assertEquals(0, node.getStartedCompositeURIs().size());
+ Assert.assertEquals(0, node2.getStartedCompositeURIs().size());
+
+ node2.startComposite("sample-helloworld", "helloworld.composite");
+ Assert.assertEquals(1, node.getStartedCompositeURIs().size());
+ Assert.assertEquals("helloworld.composite", node.getStartedCompositeURIs().get("sample-helloworld").get(0));
+
+ Assert.assertEquals(1, node2.getStartedCompositeURIs().size());
+ Assert.assertEquals("helloworld.composite", node2.getStartedCompositeURIs().get("sample-helloworld").get(0));
+
+ } finally {
+ runtime.stop();
+ }
+ }
+
+ @Test
+ public void addDeploymentCompositeTest() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException, XMLStreamException {
+ Node node = TuscanyRuntime.newInstance().createNode("addDeploymentCompositeTest");
+ String curi = node.installContribution("src/test/resources/sample-helloworld.jar");
+
+ String compositeXML =
+ "<composite xmlns=\"http://docs.oasis-open.org/ns/opencsa/sca/200912\""
+ + " xmlns:tuscany=\"http://tuscany.apache.org/xmlns/sca/1.1\""
+ + " targetNamespace=\"http://test/composite\""
+ + " name=\"TestComposite\">"
+ + " <component name=\"TestComponent\">"
+ + " <implementation.java class=\"sample.HelloworldImpl\"/>"
+ + " </component>"
+ + "</composite>";
+ String compositeURI = node.addDeploymentComposite(curi, new StringReader(compositeXML));
+
+ node.startComposite(curi, compositeURI);
+ Assert.assertEquals(1, node.getStartedCompositeURIs().size());
+
+ Composite dc = node.getDomainComposite();
+ Assert.assertEquals(1, dc.getIncludes().size());
+ Composite runningComposite = dc.getIncludes().get(0);
+ Assert.assertEquals("TestComposite", runningComposite.getName().getLocalPart());
+ }
+
+ @Test
+ public void invalidCompositeStartTest() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException, XMLStreamException {
+ Node node = TuscanyRuntime.newInstance().createNode("invalidCompositeStartTest");
+ String curi = node.installContribution("src/test/resources/helloworld-invalidComposite.jar");
+ Assert.assertEquals(1, node.getInstalledContributionURIs().size());
+ Assert.assertEquals(0, node.getStartedCompositeURIs().size());
+ ContributionDescription cd = node.getInstalledContribution(curi);
+ Assert.assertEquals(1, cd.getDeployables().size());
+
+ String compositeXML =
+ "<composite xmlns=\"http://docs.oasis-open.org/ns/opencsa/sca/200912\""
+ + " xmlns:tuscany=\"http://tuscany.apache.org/xmlns/sca/1.1\""
+ + " targetNamespace=\"http://test/composite\""
+ + " name=\"TestComposite\">"
+ + " <component name=\"TestComponent\">"
+ + " <implementation.java class=\"sample.HelloworldImpl\"/>"
+ + " </component>"
+ + "</composite>";
+ String compositeURI = node.addDeploymentComposite(curi, new StringReader(compositeXML));
+ node.startComposite(curi, compositeURI);
+
+// node.startComposite("sample-helloworld", "helloworld.composite");
+// Assert.assertEquals(1, node.getStartedCompositeURIs().size());
+// Assert.assertEquals("helloworld.composite", node.getStartedCompositeURIs().get("sample-helloworld").get(0));
+//
+// node.stopComposite("sample-helloworld", "helloworld.composite");
+//// Assert.assertEquals(0, node.getStartedComposites().size());
+// node.startComposite("sample-helloworld", "helloworld.composite");
+// Assert.assertEquals(1, node.getStartedCompositeURIs().size());
+// Assert.assertEquals("helloworld.composite", node.getStartedCompositeURIs().get("sample-helloworld").get(0));
+// node.stopComposite("sample-helloworld", "helloworld.composite");
+ }
+
+ @Test
+ public void stopAndUnistallTest() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException, XMLStreamException {
+ Node node = TuscanyRuntime.newInstance().createNode("stopAndUnistallTest");
+ node.installContribution("src/test/resources/import.jar");
+ node.installContribution("src/test/resources/export.jar");
+ String compositeXML =
+ "<composite xmlns=\"http://docs.oasis-open.org/ns/opencsa/sca/200912\""
+ + " xmlns:tuscany=\"http://tuscany.apache.org/xmlns/sca/1.1\""
+ + " targetNamespace=\"http://test/composite\""
+ + " name=\"TestComposite\">"
+ + " <component name=\"TestComponent\">"
+ + " <implementation.java class=\"sample.HelloworldImpl\"/>"
+ + " </component>"
+ + "</composite>";
+ String compositeURI = node.addDeploymentComposite("export", new StringReader(compositeXML));
+ node.startComposite("import", "helloworld.composite");
+ node.startComposite("export", compositeURI);
+ Assert.assertEquals(2, node.getInstalledContributionURIs().size());
+ node.stopCompositeAndUninstallUnused("import", "helloworld.composite");
+ Assert.assertEquals(1, node.getInstalledContributionURIs().size());
+ node.stopCompositeAndUninstallUnused("export", compositeURI);
+ Assert.assertEquals(0, node.getInstalledContributionURIs().size());
+ }
+}
diff --git a/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/java/org/apache/tuscany/sca/runtime/DomainCompositeTestCase.java b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/java/org/apache/tuscany/sca/runtime/DomainCompositeTestCase.java new file mode 100644 index 0000000000..97910aaf37 --- /dev/null +++ b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/java/org/apache/tuscany/sca/runtime/DomainCompositeTestCase.java @@ -0,0 +1,69 @@ +/*
+ * 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.
+ */
+package org.apache.tuscany.sca.runtime;
+
+import junit.framework.Assert;
+
+import org.apache.tuscany.sca.Node;
+import org.apache.tuscany.sca.TuscanyRuntime;
+import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.assembly.xml.Utils;
+import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
+import org.apache.tuscany.sca.impl.NodeImpl;
+import org.apache.tuscany.sca.monitor.ValidationException;
+import org.junit.Test;
+import org.oasisopen.sca.NoSuchDomainException;
+import org.oasisopen.sca.NoSuchServiceException;
+
+public class DomainCompositeTestCase {
+
+ @Test
+ public void localOnlyDomain() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException {
+ Node node = TuscanyRuntime.newInstance().createNode("DomainCompositeTestCase");
+ testIt(node);
+ }
+
+ @Test
+ public void distributedDomain() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException {
+ TuscanyRuntime runtime = TuscanyRuntime.newInstance();
+ try {
+ Node node = runtime.createNode("uri:DomainCompositeTestCase");
+ testIt(node);
+ } finally { runtime.stop(); }
+ }
+
+ private void testIt(Node node) throws ContributionReadException, ActivationException, ValidationException {
+ node.installContribution("helloworld", "src/test/resources/sample-helloworld.jar", null, null);
+ node.startComposite("helloworld", "helloworld.composite");
+
+ Composite dc = node.getDomainComposite();
+ Assert.assertEquals("DomainCompositeTestCase", dc.getName().getLocalPart());
+ Assert.assertEquals(1, dc.getIncludes().size());
+ Composite c = dc.getIncludes().get(0);
+ Assert.assertEquals("helloworld", c.getName().getLocalPart());
+
+// String s = node.getDomainLevelCompositeAsString();
+ System.out.println(Utils.modelToXML(node.getDomainComposite(), true, ((NodeImpl)node).getExtensionPointRegistry()));
+// Assert.assertTrue(s.contains(":helloworld\""));
+
+ node.stopComposite("helloworld", "helloworld.composite");
+ Assert.assertEquals(0, node.getDomainComposite().getIncludes().size());
+ }
+
+}
diff --git a/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/java/org/apache/tuscany/sca/runtime/TwoNodesTestCase.java b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/java/org/apache/tuscany/sca/runtime/TwoNodesTestCase.java new file mode 100644 index 0000000000..7827d5dcf0 --- /dev/null +++ b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/java/org/apache/tuscany/sca/runtime/TwoNodesTestCase.java @@ -0,0 +1,50 @@ +/*
+ * 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.
+ */
+package org.apache.tuscany.sca.runtime;
+
+import junit.framework.Assert;
+
+import org.apache.tuscany.sca.Node;
+import org.apache.tuscany.sca.TuscanyRuntime;
+import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
+import org.apache.tuscany.sca.monitor.ValidationException;
+import org.junit.Test;
+import org.oasisopen.sca.NoSuchDomainException;
+import org.oasisopen.sca.NoSuchServiceException;
+
+import sample.Helloworld;
+
+public class TwoNodesTestCase {
+
+ @Test
+ public void testInstallDeployable() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException {
+ TuscanyRuntime runtime = TuscanyRuntime.newInstance();
+ try {
+ Node node1 = runtime.createNode("uri:TwoNodesTestCase?multicast=off&bind=127.0.0.1:44331");
+ node1.installContribution("helloworld", "src/test/resources/sample-helloworld.jar", null, null);
+ node1.startComposite("helloworld", "helloworld.composite");
+
+ Node node2 = TuscanyRuntime.newInstance().createNode("uri:TwoNodesTestCase?multicast=off&bind=127.0.0.1:44332&wka=127.0.0.1:44331");
+
+ Helloworld helloworldService = node2.getService(Helloworld.class, "HelloworldComponent");
+ Assert.assertEquals("Hello petra", helloworldService.sayHello("petra"));
+ } finally { runtime.stop(); }
+ }
+
+}
diff --git a/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/java/sample/Helloworld.java b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/java/sample/Helloworld.java new file mode 100644 index 0000000000..a422c23e6a --- /dev/null +++ b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/java/sample/Helloworld.java @@ -0,0 +1,27 @@ +/*
+ * 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.
+ */
+
+package sample;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+public interface Helloworld {
+ String sayHello(String name);
+}
diff --git a/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/compositeImpl.composite b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/compositeImpl.composite new file mode 100644 index 0000000000..735bf3bbcc --- /dev/null +++ b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/compositeImpl.composite @@ -0,0 +1,30 @@ +<?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 xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ xmlns:sample="http://sample"
+ targetNamespace="http://sample"
+ name="compositeImpl">
+
+ <component name="Helloworld2Component">
+ <implementation.composite name="sample:helloworld"/>
+ </component>
+
+</composite>
diff --git a/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/export.jar b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/export.jar Binary files differnew file mode 100644 index 0000000000..0ca3450bed --- /dev/null +++ b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/export.jar diff --git a/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/helloworld-invalidComposite.jar b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/helloworld-invalidComposite.jar Binary files differnew file mode 100644 index 0000000000..fa35a21696 --- /dev/null +++ b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/helloworld-invalidComposite.jar diff --git a/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/helloworld2.composite b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/helloworld2.composite new file mode 100644 index 0000000000..8c7a789380 --- /dev/null +++ b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/helloworld2.composite @@ -0,0 +1,29 @@ +<?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 xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ targetNamespace="http://sample"
+ name="helloworld2">
+
+ <component name="Helloworld2Component">
+ <implementation.java class="sample.HelloworldImpl"/>
+ </component>
+
+</composite>
diff --git a/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/helloworld2.jar b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/helloworld2.jar Binary files differnew file mode 100644 index 0000000000..2f8e473cd0 --- /dev/null +++ b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/helloworld2.jar diff --git a/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/helloworldNode.xml b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/helloworldNode.xml new file mode 100644 index 0000000000..3095200945 --- /dev/null +++ b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/helloworldNode.xml @@ -0,0 +1,27 @@ +<?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.
+-->
+<node xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns="http://tuscany.apache.org/xmlns/sca/1.1"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ domain="helloworld">
+
+ <contribution location="sample-helloworld.jar" startDeployables="true" />
+
+</node>
\ No newline at end of file diff --git a/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/import.jar b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/import.jar Binary files differnew file mode 100644 index 0000000000..4931074878 --- /dev/null +++ b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/import.jar diff --git a/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/include.composite b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/include.composite new file mode 100644 index 0000000000..a1d9a658be --- /dev/null +++ b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/include.composite @@ -0,0 +1,28 @@ +<?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 xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ xmlns:sample="http://sample"
+ targetNamespace="http://sample"
+ name="include">
+
+ <include name="sample:helloworld" />
+
+</composite>
diff --git a/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/itest-nodes-helloworld-client-2.0-SNAPSHOT.jar b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/itest-nodes-helloworld-client-2.0-SNAPSHOT.jar Binary files differnew file mode 100644 index 0000000000..7f6073ce7f --- /dev/null +++ b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/itest-nodes-helloworld-client-2.0-SNAPSHOT.jar diff --git a/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/itest-nodes-helloworld-service-2.0-SNAPSHOT.jar b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/itest-nodes-helloworld-service-2.0-SNAPSHOT.jar Binary files differnew file mode 100644 index 0000000000..2306ce4d1a --- /dev/null +++ b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/itest-nodes-helloworld-service-2.0-SNAPSHOT.jar diff --git a/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/nested.composite b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/nested.composite new file mode 100644 index 0000000000..1c31941a83 --- /dev/null +++ b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/nested.composite @@ -0,0 +1,28 @@ +<?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 xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ xmlns:sample="http://sample"
+ targetNamespace="http://sample"
+ name="nested">
+
+ <include name="sample:compositeImpl" />
+
+</composite>
diff --git a/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/sample-helloworld-nodeployable.jar b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/sample-helloworld-nodeployable.jar Binary files differnew file mode 100644 index 0000000000..16dde03858 --- /dev/null +++ b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/sample-helloworld-nodeployable.jar diff --git a/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/sample-helloworld.jar b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/sample-helloworld.jar Binary files differnew file mode 100644 index 0000000000..1ea85c8e63 --- /dev/null +++ b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/sample-helloworld.jar diff --git a/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/sample-helloworld2.jar b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/sample-helloworld2.jar Binary files differnew file mode 100644 index 0000000000..80b8b2315f --- /dev/null +++ b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/sample-helloworld2.jar diff --git a/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/sca-contribution-generated.xml b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/sca-contribution-generated.xml new file mode 100644 index 0000000000..5b3d81cb97 --- /dev/null +++ b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/sca-contribution-generated.xml @@ -0,0 +1,23 @@ +<?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.
+-->
+<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:sample="http://sample">
+ <deployable composite="sample:helloworld"/>
+</contribution>
diff --git a/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/MyDomain/domain.properties b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/MyDomain/domain.properties new file mode 100644 index 0000000000..d7ac22d6ad --- /dev/null +++ b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/MyDomain/domain.properties @@ -0,0 +1,17 @@ +#
+# 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.
+#
+domainName=foo
diff --git a/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/MyDomain/helloworld-contribution.deployable.composite b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/MyDomain/helloworld-contribution.deployable.composite new file mode 100644 index 0000000000..8c7a789380 --- /dev/null +++ b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/MyDomain/helloworld-contribution.deployable.composite @@ -0,0 +1,29 @@ +<?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 xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ targetNamespace="http://sample"
+ name="helloworld2">
+
+ <component name="Helloworld2Component">
+ <implementation.java class="sample.HelloworldImpl"/>
+ </component>
+
+</composite>
diff --git a/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/MyDomain/helloworld-contribution.jar b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/MyDomain/helloworld-contribution.jar Binary files differnew file mode 100644 index 0000000000..5198370d85 --- /dev/null +++ b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/MyDomain/helloworld-contribution.jar diff --git a/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/MyDomain/helloworld-contribution.xml b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/MyDomain/helloworld-contribution.xml new file mode 100644 index 0000000000..2788e14022 --- /dev/null +++ b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/MyDomain/helloworld-contribution.xml @@ -0,0 +1,23 @@ +<?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.
+-->
+<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:sample="http://sample">
+ <export.java package="sample" />
+</contribution>
diff --git a/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/MyDomain/readme.txt b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/MyDomain/readme.txt new file mode 100644 index 0000000000..10114926c4 --- /dev/null +++ b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/MyDomain/readme.txt @@ -0,0 +1,8 @@ +A file named domain.properties is used to override the domain name, see in the properties file for what
+other properties are supportted.
+
+Side files are used to modify the helloworld-contribution.jar installed contribution.
+- sca-contribution.xml metaData is modified by having a metaData side file named helloworld-contribution.xml
+- additional deployment composites are added with files named helloworld-contribution.<anything>.composite
+
+
diff --git a/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/NodeXMLDomain/node.xml b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/NodeXMLDomain/node.xml new file mode 100644 index 0000000000..1fe1ccff14 --- /dev/null +++ b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/NodeXMLDomain/node.xml @@ -0,0 +1,27 @@ +<?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.
+-->
+<node xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns="http://tuscany.apache.org/xmlns/sca/1.1"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ domain="helloworld">
+
+ <contribution location="../../sample-helloworld.jar" startDeployables="true" />
+
+</node>
\ No newline at end of file diff --git a/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/NodeXMLDomain/readme.txt b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/NodeXMLDomain/readme.txt new file mode 100644 index 0000000000..15dac7bd0c --- /dev/null +++ b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/NodeXMLDomain/readme.txt @@ -0,0 +1,2 @@ +The domain directory gets all its config from a config XML file named node.xml,
+which may refer to contributions at another location outside of the directory.
\ No newline at end of file diff --git a/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/default/readme.txt b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/default/readme.txt new file mode 100644 index 0000000000..34b3e347ff --- /dev/null +++ b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/default/readme.txt @@ -0,0 +1,4 @@ +The simplest domain. Just a directory of contrbutions,
+the domain is named with the directory name an the contributions
+are installed and all deployables are started.
+
\ No newline at end of file diff --git a/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/default/sample-helloworld.jar b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/default/sample-helloworld.jar Binary files differnew file mode 100644 index 0000000000..1ea85c8e63 --- /dev/null +++ b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/default/sample-helloworld.jar diff --git a/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/dependencies/export1.jar b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/dependencies/export1.jar Binary files differnew file mode 100644 index 0000000000..b2755b65c5 --- /dev/null +++ b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/dependencies/export1.jar diff --git a/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/dependencies/export2.jar b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/dependencies/export2.jar Binary files differnew file mode 100644 index 0000000000..eec5ded5ee --- /dev/null +++ b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/dependencies/export2.jar diff --git a/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/dependencies/import1.dependencies b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/dependencies/import1.dependencies new file mode 100644 index 0000000000..b7c54895d0 --- /dev/null +++ b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/dependencies/import1.dependencies @@ -0,0 +1,19 @@ +# 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.
+
+ export1
+
diff --git a/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/dependencies/import1.jar b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/dependencies/import1.jar Binary files differnew file mode 100644 index 0000000000..8402f6e3c3 --- /dev/null +++ b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/dependencies/import1.jar diff --git a/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/dependencies/import2.dependencies b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/dependencies/import2.dependencies new file mode 100644 index 0000000000..dd3052994c --- /dev/null +++ b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/dependencies/import2.dependencies @@ -0,0 +1,19 @@ +# 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.
+
+export2
+
diff --git a/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/dependencies/import2.jar b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/dependencies/import2.jar Binary files differnew file mode 100644 index 0000000000..6667994eb6 --- /dev/null +++ b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/dependencies/import2.jar diff --git a/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/dependencies/readme.txt b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/dependencies/readme.txt new file mode 100644 index 0000000000..fc645c0682 --- /dev/null +++ b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/dependencies/readme.txt @@ -0,0 +1,14 @@ +Uses the domain.properties file to show explicitly defining a contrbutions dependent contribution URIS.
+
+Contributions export1.jar and export2.jar both export the Java package "sample" and both have
+a class sample.HelloworldImpl but the classes return a sayHello string "Hello 1" in export1.jar
+and "Hello 2" in export2.jar.
+
+Contributions import1.jar and import2.jar both import the package sample and use the
+sample.HelloworldImpl class in the component implementation.
+
+The *.dependencies files explicitly set the dependency URIs used by
+Contributions import1.jar and import2.jar, without the explicit property the imports would just t
+use the first contribution found that exports the sample package.
+
+See section 10.2.1 and 10.4 in the Assembly spec.
diff --git a/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/exploded/readme.txt b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/exploded/readme.txt new file mode 100644 index 0000000000..ea7af2b3f7 --- /dev/null +++ b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/exploded/readme.txt @@ -0,0 +1,4 @@ +A domain directory showing a contribution jar exploded into a contribution directory.
+In this case the contribution jar is ignored and the contribution directory is used.
+Thats the same approach used for things like Tomcat with exploded webapps and it
+enables more easily supporting dynamic updates to individual files in a contribution.
\ No newline at end of file diff --git a/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/exploded/sample-helloworld.jar b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/exploded/sample-helloworld.jar Binary files differnew file mode 100644 index 0000000000..1ea85c8e63 --- /dev/null +++ b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/exploded/sample-helloworld.jar diff --git a/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/exploded/sample-helloworld/META-INF/MANIFEST.MF b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/exploded/sample-helloworld/META-INF/MANIFEST.MF new file mode 100644 index 0000000000..c5d7d06f98 --- /dev/null +++ b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/exploded/sample-helloworld/META-INF/MANIFEST.MF @@ -0,0 +1,14 @@ +Manifest-Version: 1.0
+Archiver-Version: Plexus Archiver
+Created-By: Apache Maven
+Built-By: ant
+Build-Jdk: 1.6.0_18
+Extension-Name: sample-helloworld
+Implementation-Title: Apache Tuscany SCA Sample Helloworld
+Implementation-Vendor: The Apache Software Foundation
+Implementation-Vendor-Id: org.apache
+Implementation-Version: 2.0-SNAPSHOT
+Specification-Title: Apache Tuscany SCA Sample Helloworld
+Specification-Vendor: The Apache Software Foundation
+Specification-Version: 2.0-SNAPSHOT
+
diff --git a/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/exploded/sample-helloworld/META-INF/maven/org.apache.tuscany.sca/sample-helloworld/pom.properties b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/exploded/sample-helloworld/META-INF/maven/org.apache.tuscany.sca/sample-helloworld/pom.properties new file mode 100644 index 0000000000..ff83691757 --- /dev/null +++ b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/exploded/sample-helloworld/META-INF/maven/org.apache.tuscany.sca/sample-helloworld/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven
+#Wed May 19 10:03:09 BST 2010
+version=2.0-SNAPSHOT
+groupId=org.apache.tuscany.sca
+artifactId=sample-helloworld
diff --git a/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/exploded/sample-helloworld/META-INF/maven/org.apache.tuscany.sca/sample-helloworld/pom.xml b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/exploded/sample-helloworld/META-INF/maven/org.apache.tuscany.sca/sample-helloworld/pom.xml new file mode 100644 index 0000000000..e480d4f534 --- /dev/null +++ b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/exploded/sample-helloworld/META-INF/maven/org.apache.tuscany.sca/sample-helloworld/pom.xml @@ -0,0 +1,58 @@ +<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <packaging>jar</packaging>
+ <artifactId>sample-helloworld</artifactId>
+ <name>Apache Tuscany SCA Sample Helloworld</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.tuscany.maven.plugins</groupId>
+ <artifactId>maven-tuscany-plugin</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/exploded/sample-helloworld/META-INF/sca-contribution.xml b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/exploded/sample-helloworld/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..e81e94d9a1 --- /dev/null +++ b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/exploded/sample-helloworld/META-INF/sca-contribution.xml @@ -0,0 +1,24 @@ +<?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.
+-->
+<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:sample="http://sample">
+ <deployable composite="sample:helloworld"/>
+ <export.java package="sample" />
+</contribution> diff --git a/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/exploded/sample-helloworld/helloworld.composite b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/exploded/sample-helloworld/helloworld.composite new file mode 100644 index 0000000000..324395c246 --- /dev/null +++ b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/exploded/sample-helloworld/helloworld.composite @@ -0,0 +1,29 @@ +<?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 xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ targetNamespace="http://sample"
+ name="helloworld">
+
+ <component name="HelloworldComponent">
+ <implementation.java class="sample.HelloworldImpl"/>
+ </component>
+
+</composite>
diff --git a/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/exploded/sample-helloworld/sample/Helloworld.class b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/exploded/sample-helloworld/sample/Helloworld.class Binary files differnew file mode 100644 index 0000000000..19c82db88e --- /dev/null +++ b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/exploded/sample-helloworld/sample/Helloworld.class diff --git a/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/exploded/sample-helloworld/sample/HelloworldImpl.class b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/exploded/sample-helloworld/sample/HelloworldImpl.class Binary files differnew file mode 100644 index 0000000000..575b3370c4 --- /dev/null +++ b/sca-java-2.x/tags/2.0-RC1/testing/itest/domain-node-hazelcast/src/test/resources/test-domains/exploded/sample-helloworld/sample/HelloworldImpl.class |