From 03fd042c47ed75f88e0af65531f7c1392e9fbc51 Mon Sep 17 00:00:00 2001 From: antelder Date: Fri, 15 Jan 2010 14:52:16 +0000 Subject: Add a two nodes test using hazelcast, and have the Server/Client classes use the Node api that takes the domain config uri git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@899648 13f79535-47bb-0310-9956-ffa450edef68 --- .../nodes/two-nodes-two-vms-hazelcast/build.xml | 38 ++++++++ .../two-nodes-two-vms-hazelcast/client-config.xml | 39 ++++++++ .../nodes/two-nodes-two-vms-hazelcast/client.xml | 31 ++++++ .../nodes/two-nodes-two-vms-hazelcast/pom.xml | 104 +++++++++++++++++++++ .../two-nodes-two-vms-hazelcast/server-config.xml | 39 ++++++++ .../nodes/two-nodes-two-vms-hazelcast/server.xml | 30 ++++++ .../src/test/java/itest/Client.java | 55 +++++++++++ .../src/test/java/itest/Service.java | 53 +++++++++++ 8 files changed, 389 insertions(+) create mode 100644 sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/build.xml create mode 100644 sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/client-config.xml create mode 100644 sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/client.xml create mode 100644 sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/pom.xml create mode 100644 sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/server-config.xml create mode 100644 sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/server.xml create mode 100644 sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/src/test/java/itest/Client.java create mode 100644 sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/src/test/java/itest/Service.java diff --git a/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/build.xml b/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/build.xml new file mode 100644 index 0000000000..92f3069596 --- /dev/null +++ b/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/build.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/client-config.xml b/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/client-config.xml new file mode 100644 index 0000000000..a5e4a0b7c3 --- /dev/null +++ b/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/client-config.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/client.xml b/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/client.xml new file mode 100644 index 0000000000..15eee42fcf --- /dev/null +++ b/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/client.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/pom.xml b/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/pom.xml new file mode 100644 index 0000000000..282d48e134 --- /dev/null +++ b/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/pom.xml @@ -0,0 +1,104 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-itest + 2.0-SNAPSHOT + ../pom.xml + + itest-nodes-two-nodes-two-vms-hazelcast + Apache Tuscany SCA iTest Nodes Two Nodes Two VMs Test using Hazelcast registry + + + + org.apache.tuscany.sca + tuscany-domain-node + 2.0-SNAPSHOT + + + org.apache.tuscany.sca + tuscany-endpoint-hazelcast + 2.0-SNAPSHOT + + + org.apache.tuscany.sca + itest-nodes-helloworld-iface + 2.0-SNAPSHOT + + + org.apache.tuscany.sca + tuscany-node-impl + 2.0-SNAPSHOT + + + org.apache.tuscany.sca + tuscany-node-launcher + 2.0-SNAPSHOT + + + org.apache.tuscany.sca + tuscany-sca-client-impl + 2.0-SNAPSHOT + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 2.0-SNAPSHOT + + + org.apache.tuscany.sca + tuscany-binding-sca-runtime-rmi + 2.0-SNAPSHOT + + + org.apache.tuscany.sca + tuscany-host-jetty + 2.0-SNAPSHOT + + + + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + run-samples + test + + run + + + + + + + + + + + + + + diff --git a/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/server-config.xml b/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/server-config.xml new file mode 100644 index 0000000000..44d2624102 --- /dev/null +++ b/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/server-config.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/server.xml b/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/server.xml new file mode 100644 index 0000000000..75a55c205e --- /dev/null +++ b/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/server.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/src/test/java/itest/Client.java b/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/src/test/java/itest/Client.java new file mode 100644 index 0000000000..5df68b8f2f --- /dev/null +++ b/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/src/test/java/itest/Client.java @@ -0,0 +1,55 @@ +/* + * 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 java.net.URI; + +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; + +public class Client { + + private static Node clientNode; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + clientNode = NodeFactory.newInstance().createNode(URI.create("tuscany:default"), "../helloworld-client/target//classes"); + clientNode.start(); + } + + @Test + public void testNothing() throws Exception { + } + + @AfterClass + public static void tearDownAfterClass() throws Exception { + if (clientNode != null) { + clientNode.stop(); + } + } + + public static void main(String[] args) throws Exception { + Client.setUpBeforeClass(); + Client.tearDownAfterClass(); + } +} diff --git a/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/src/test/java/itest/Service.java b/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/src/test/java/itest/Service.java new file mode 100644 index 0000000000..8bd333f932 --- /dev/null +++ b/sca-java-2.x/trunk/itest/nodes/two-nodes-two-vms-hazelcast/src/test/java/itest/Service.java @@ -0,0 +1,53 @@ +/* + * 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 java.net.URI; + +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; + +public class Service { + + private static Node serviceNode; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + serviceNode = NodeFactory.newInstance().createNode(URI.create("tuscany:default"), "../helloworld-service/target/classes"); + serviceNode.start(); + } + + @Test + public void testNothing() throws Exception { + synchronized (this) { + this.wait(); + } + } + + @AfterClass + public static void tearDownAfterClass() throws Exception { + if (serviceNode != null) { + serviceNode.stop(); + } + } +} -- cgit v1.2.3