summaryrefslogtreecommitdiffstats
path: root/tags/java/sca/2.0-M3-RC4/itest/nodes
diff options
context:
space:
mode:
Diffstat (limited to 'tags/java/sca/2.0-M3-RC4/itest/nodes')
-rw-r--r--tags/java/sca/2.0-M3-RC4/itest/nodes/helloworld-client/pom.xml44
-rw-r--r--tags/java/sca/2.0-M3-RC4/itest/nodes/helloworld-client/src/main/java/itest/nodes/HelloworldImpl.java33
-rw-r--r--tags/java/sca/2.0-M3-RC4/itest/nodes/helloworld-client/src/main/resources/META-INF/sca-contribution.xml23
-rw-r--r--tags/java/sca/2.0-M3-RC4/itest/nodes/helloworld-client/src/main/resources/helloworld-client.composite29
-rw-r--r--tags/java/sca/2.0-M3-RC4/itest/nodes/helloworld-iface/pom.xml39
-rw-r--r--tags/java/sca/2.0-M3-RC4/itest/nodes/helloworld-iface/src/main/java/itest/nodes/Helloworld.java26
-rw-r--r--tags/java/sca/2.0-M3-RC4/itest/nodes/helloworld-service/pom.xml49
-rw-r--r--tags/java/sca/2.0-M3-RC4/itest/nodes/helloworld-service/src/main/java/itest/nodes/HelloworldImpl.java28
-rw-r--r--tags/java/sca/2.0-M3-RC4/itest/nodes/helloworld-service/src/main/resources/META-INF/sca-contribution.xml23
-rw-r--r--tags/java/sca/2.0-M3-RC4/itest/nodes/helloworld-service/src/main/resources/helloworld-service.composite28
-rw-r--r--tags/java/sca/2.0-M3-RC4/itest/nodes/one-node-test/pom.xml48
-rw-r--r--tags/java/sca/2.0-M3-RC4/itest/nodes/one-node-test/src/test/java/itest/OneNodeTestCase.java87
-rw-r--r--tags/java/sca/2.0-M3-RC4/itest/nodes/pom.xml44
-rw-r--r--tags/java/sca/2.0-M3-RC4/itest/nodes/two-nodes-test/pom.xml53
-rw-r--r--tags/java/sca/2.0-M3-RC4/itest/nodes/two-nodes-test/src/test/java/itest/TwoNodesTestCase.java101
15 files changed, 655 insertions, 0 deletions
diff --git a/tags/java/sca/2.0-M3-RC4/itest/nodes/helloworld-client/pom.xml b/tags/java/sca/2.0-M3-RC4/itest/nodes/helloworld-client/pom.xml
new file mode 100644
index 0000000000..ec124f23f7
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC4/itest/nodes/helloworld-client/pom.xml
@@ -0,0 +1,44 @@
+<?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-itest</artifactId>
+ <version>2.0-M3</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-nodes-helloworld-client</artifactId>
+ <name>Apache Tuscany SCA iTest Nodes Helloworld Client</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-nodes-helloworld-iface</artifactId>
+ <version>2.0-M3</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>2.0-M3</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/tags/java/sca/2.0-M3-RC4/itest/nodes/helloworld-client/src/main/java/itest/nodes/HelloworldImpl.java b/tags/java/sca/2.0-M3-RC4/itest/nodes/helloworld-client/src/main/java/itest/nodes/HelloworldImpl.java
new file mode 100644
index 0000000000..a8e74be096
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC4/itest/nodes/helloworld-client/src/main/java/itest/nodes/HelloworldImpl.java
@@ -0,0 +1,33 @@
+/*
+ * 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.Reference;
+
+public class HelloworldImpl implements Helloworld {
+
+ @Reference
+ public Helloworld service;
+
+ public String sayHello(String name) {
+ return "Hi " + service.sayHello(name);
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC4/itest/nodes/helloworld-client/src/main/resources/META-INF/sca-contribution.xml b/tags/java/sca/2.0-M3-RC4/itest/nodes/helloworld-client/src/main/resources/META-INF/sca-contribution.xml
new file mode 100644
index 0000000000..d55aa7ba9c
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC4/itest/nodes/helloworld-client/src/main/resources/META-INF/sca-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/200903"
+ xmlns:itest="http://itest">
+ <deployable composite="itest:HelloworldClient"/>
+</contribution> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M3-RC4/itest/nodes/helloworld-client/src/main/resources/helloworld-client.composite b/tags/java/sca/2.0-M3-RC4/itest/nodes/helloworld-client/src/main/resources/helloworld-client.composite
new file mode 100644
index 0000000000..81a3fa1f2d
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC4/itest/nodes/helloworld-client/src/main/resources/helloworld-client.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/200903"
+ targetNamespace="http://itest"
+ name="HelloworldClient">
+
+ <component name="HelloworldClient">
+ <implementation.java class="itest.nodes.HelloworldImpl"/>
+ <reference name="service" target="HelloworldService"/>
+ </component>
+
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC4/itest/nodes/helloworld-iface/pom.xml b/tags/java/sca/2.0-M3-RC4/itest/nodes/helloworld-iface/pom.xml
new file mode 100644
index 0000000000..7ee22a320d
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC4/itest/nodes/helloworld-iface/pom.xml
@@ -0,0 +1,39 @@
+<?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-itest</artifactId>
+ <version>2.0-M3</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-nodes-helloworld-iface</artifactId>
+ <name>Apache Tuscany SCA iTest Nodes Helloworld IFaces</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>2.0-M3</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/tags/java/sca/2.0-M3-RC4/itest/nodes/helloworld-iface/src/main/java/itest/nodes/Helloworld.java b/tags/java/sca/2.0-M3-RC4/itest/nodes/helloworld-iface/src/main/java/itest/nodes/Helloworld.java
new file mode 100644
index 0000000000..d49ebc2cef
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC4/itest/nodes/helloworld-iface/src/main/java/itest/nodes/Helloworld.java
@@ -0,0 +1,26 @@
+/*
+ * 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;
+
+public interface Helloworld {
+
+ String sayHello(String name);
+
+}
diff --git a/tags/java/sca/2.0-M3-RC4/itest/nodes/helloworld-service/pom.xml b/tags/java/sca/2.0-M3-RC4/itest/nodes/helloworld-service/pom.xml
new file mode 100644
index 0000000000..24c4299f35
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC4/itest/nodes/helloworld-service/pom.xml
@@ -0,0 +1,49 @@
+<?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-itest</artifactId>
+ <version>2.0-M3</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-nodes-helloworld-service</artifactId>
+ <name>Apache Tuscany SCA iTest Nodes Helloworld Service</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-nodes-helloworld-iface</artifactId>
+ <version>2.0-M3</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>2.0-M3</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>2.0-M3</version>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/tags/java/sca/2.0-M3-RC4/itest/nodes/helloworld-service/src/main/java/itest/nodes/HelloworldImpl.java b/tags/java/sca/2.0-M3-RC4/itest/nodes/helloworld-service/src/main/java/itest/nodes/HelloworldImpl.java
new file mode 100644
index 0000000000..20233b0397
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC4/itest/nodes/helloworld-service/src/main/java/itest/nodes/HelloworldImpl.java
@@ -0,0 +1,28 @@
+/*
+ * 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;
+
+public class HelloworldImpl implements Helloworld {
+
+ public String sayHello(String name) {
+ return "Hello " + name;
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC4/itest/nodes/helloworld-service/src/main/resources/META-INF/sca-contribution.xml b/tags/java/sca/2.0-M3-RC4/itest/nodes/helloworld-service/src/main/resources/META-INF/sca-contribution.xml
new file mode 100644
index 0000000000..9c68ffd043
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC4/itest/nodes/helloworld-service/src/main/resources/META-INF/sca-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/200903"
+ xmlns:itest="http://itest">
+ <deployable composite="itest:HelloworldService"/>
+</contribution> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M3-RC4/itest/nodes/helloworld-service/src/main/resources/helloworld-service.composite b/tags/java/sca/2.0-M3-RC4/itest/nodes/helloworld-service/src/main/resources/helloworld-service.composite
new file mode 100644
index 0000000000..95d78b1983
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC4/itest/nodes/helloworld-service/src/main/resources/helloworld-service.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/200903"
+ targetNamespace="http://itest"
+ name="HelloworldService">
+
+ <component name="HelloworldService">
+ <implementation.java class="itest.nodes.HelloworldImpl"/>
+ </component>
+
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC4/itest/nodes/one-node-test/pom.xml b/tags/java/sca/2.0-M3-RC4/itest/nodes/one-node-test/pom.xml
new file mode 100644
index 0000000000..2b73398afe
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC4/itest/nodes/one-node-test/pom.xml
@@ -0,0 +1,48 @@
+<?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-itest</artifactId>
+ <version>2.0-M3</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-nodes-one-nodes-test</artifactId>
+ <name>Apache Tuscany SCA iTest Nodes One Nodes Test</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-nodes-helloworld-iface</artifactId>
+ <version>2.0-M3</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-M3</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-M3</version>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/tags/java/sca/2.0-M3-RC4/itest/nodes/one-node-test/src/test/java/itest/OneNodeTestCase.java b/tags/java/sca/2.0-M3-RC4/itest/nodes/one-node-test/src/test/java/itest/OneNodeTestCase.java
new file mode 100644
index 0000000000..63ddc789db
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC4/itest/nodes/one-node-test/src/test/java/itest/OneNodeTestCase.java
@@ -0,0 +1,87 @@
+/*
+ * 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;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.io.File;
+
+import itest.nodes.Helloworld;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class OneNodeTestCase{
+
+ private static Node node;
+
+ @BeforeClass
+ public static void setUpBeforeClass() throws Exception {
+ System.setProperty("org.apache.tuscany.sca.contribution.processor.ValidationSchemaExtensionPoint.enabled", "false");
+ NodeFactory factory = NodeFactory.newInstance();
+ node = factory.createNode(
+ new Contribution("service", getJar("../helloworld-service/target")),
+ new Contribution("client", getJar("../helloworld-client/target")));
+ node.start();
+ }
+
+ /**
+ * Get the jar in the target folder without being dependent on the version name to
+ * make tuscany releases easier
+ */
+ private static String getJar(String targetDirectory) {
+ File f = new File(targetDirectory);
+ for (File file : f.listFiles()) {
+ if (file.getName().endsWith(".jar")) {
+ return file.toURI().toString();
+ }
+ }
+ throw new IllegalStateException("Can't find jar in: " + targetDirectory);
+ }
+
+ @Test
+ public void testCalculator() throws Exception {
+
+ // Ideally this would use the SCAClient API but leaving that tillwe have the basics working
+
+ Helloworld service = node.getService(Helloworld.class, "HelloworldService");
+ assertNotNull(service);
+ assertEquals("Hello Petra", service.sayHello("Petra"));
+
+ Helloworld client = node.getService(Helloworld.class, "HelloworldClient");
+ assertNotNull(client);
+ assertEquals("Hi Hello Petra", client.sayHello("Petra"));
+ }
+
+ @AfterClass
+ public static void tearDownAfterClass() throws Exception {
+ if (node != null) {
+ node.stop();
+ }
+ }
+}
diff --git a/tags/java/sca/2.0-M3-RC4/itest/nodes/pom.xml b/tags/java/sca/2.0-M3-RC4/itest/nodes/pom.xml
new file mode 100644
index 0000000000..9d153681ed
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC4/itest/nodes/pom.xml
@@ -0,0 +1,44 @@
+<?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-itest</artifactId>
+ <version>2.0-M3</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <packaging>pom</packaging>
+ <artifactId>itest-nodes</artifactId>
+ <name>Apache Tuscany SCA iTest Nodes</name>
+
+ <build>
+ <defaultGoal>install</defaultGoal>
+ </build>
+
+ <modules>
+ <module>helloworld-iface</module>
+ <module>helloworld-service</module>
+ <module>helloworld-client</module>
+ <module>one-node-test</module>
+ <module>two-nodes-test</module>
+ </modules>
+
+</project>
diff --git a/tags/java/sca/2.0-M3-RC4/itest/nodes/two-nodes-test/pom.xml b/tags/java/sca/2.0-M3-RC4/itest/nodes/two-nodes-test/pom.xml
new file mode 100644
index 0000000000..6436ea09dc
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC4/itest/nodes/two-nodes-test/pom.xml
@@ -0,0 +1,53 @@
+<?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-itest</artifactId>
+ <version>2.0-M3</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-nodes-two-nodes-test</artifactId>
+ <name>Apache Tuscany SCA iTest Nodes Two Nodes Test</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-nodes-helloworld-iface</artifactId>
+ <version>2.0-M3</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-M3</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-client-impl</artifactId>
+ <version>2.0-M3</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-M3</version>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/tags/java/sca/2.0-M3-RC4/itest/nodes/two-nodes-test/src/test/java/itest/TwoNodesTestCase.java b/tags/java/sca/2.0-M3-RC4/itest/nodes/two-nodes-test/src/test/java/itest/TwoNodesTestCase.java
new file mode 100644
index 0000000000..8352f70e17
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC4/itest/nodes/two-nodes-test/src/test/java/itest/TwoNodesTestCase.java
@@ -0,0 +1,101 @@
+/*
+ * 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;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import itest.nodes.Helloworld;
+
+import java.io.File;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.oasisopen.sca.client.SCAClient;
+import org.oasisopen.sca.client.SCAClientFactory;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class TwoNodesTestCase{
+
+ private static Node serviceNode;
+ private static Node clientNode;
+
+ @BeforeClass
+ public static void setUpBeforeClass() throws Exception {
+ System.setProperty("org.apache.tuscany.sca.contribution.processor.ValidationSchemaExtensionPoint.enabled", "false");
+ NodeFactory factory = NodeFactory.newInstance();
+ serviceNode = factory.createNode(new Contribution("service", getJar("../helloworld-service/target")));
+ serviceNode.start();
+ clientNode = factory.createNode(new Contribution("client", getJar("../helloworld-client/target")));
+ clientNode.start();
+ }
+
+ /**
+ * Get the jar in the target folder without being dependent on the version name to
+ * make tuscany releases easier
+ */
+ private static String getJar(String targetDirectory) {
+ File f = new File(targetDirectory);
+ for (File file : f.listFiles()) {
+ if (file.getName().endsWith(".jar")) {
+ return file.toURI().toString();
+ }
+ }
+ throw new IllegalStateException("Can't find jar in: " + targetDirectory);
+ }
+
+ @Test
+ public void testCalculator() throws Exception {
+ Helloworld service = serviceNode.getService(Helloworld.class, "HelloworldService");
+ assertNotNull(service);
+ assertEquals("Hello Petra", service.sayHello("Petra"));
+
+ Helloworld client = clientNode.getService(Helloworld.class, "HelloworldClient");
+ assertNotNull(client);
+ assertEquals("Hi Hello Petra", client.sayHello("Petra"));
+ }
+
+ @Test
+ public void testCalculatorClientAPI() throws Exception {
+ SCAClient scaClient = SCAClientFactory.newInstance();
+ Helloworld service = scaClient.getService(Helloworld.class, "HelloworldService", null);
+ assertNotNull(service);
+ assertEquals("Hello Petra", service.sayHello("Petra"));
+
+ Helloworld client = scaClient.getService(Helloworld.class, "HelloworldClient", null);
+ assertNotNull(client);
+ assertEquals("Hi Hello Petra", client.sayHello("Petra"));
+ }
+
+ @AfterClass
+ public static void tearDownAfterClass() throws Exception {
+ if (serviceNode != null) {
+ serviceNode.stop();
+ }
+ if (clientNode != null) {
+ clientNode.stop();
+ }
+ }
+}