diff options
Diffstat (limited to '')
273 files changed, 13334 insertions, 0 deletions
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/pom.xml b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/pom.xml new file mode 100644 index 0000000000..aa08bfde8e --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/pom.xml @@ -0,0 +1,94 @@ +<?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-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-nodes-binding-sca-hazelcast</artifactId>
+ <name>Apache Tuscany SCA iTest Nodes binding.sca Using Hazelcast Registry</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-client-impl</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-endpoint-hazelcast</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-endpoint-hazelcast-client</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-hazelcast-runtime</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-jetty</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.5</version>
+ <configuration>
+ <includes>
+ <include>**/*TestCase.java</include>
+ </includes>
+ <reportFormat>brief</reportFormat>
+ <useFile>true</useFile>
+ <forkMode>once</forkMode>
+ <argLine>-ea -Xmx256m</argLine>
+ <parallel>off</parallel>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Client.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Client.java new file mode 100644 index 0000000000..ef2565b750 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Client.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 org.apache.tuscany.sca.itest.bindingsca; + +/** + * + */ +public interface Client { + String getName(String id); + + String create(String name); +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/ClientImpl.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/ClientImpl.java new file mode 100644 index 0000000000..96a0f2dadd --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/ClientImpl.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 org.apache.tuscany.sca.itest.bindingsca; + +import org.oasisopen.sca.annotation.Reference; +import org.oasisopen.sca.annotation.Service; + +/** + * + */ +@Service(Client.class) +public class ClientImpl implements Client { + @Reference + protected Local local; + + @Reference + protected Remote remote; + + public String getName(String id) { + Customer customer = null; + try { + customer = remote.getCustomer(id); + } catch (CustomerNotFoundException e) { + return null; + } + customer.dump("Client.getName()"); + return local.getName(customer); + } + + public String create(String name) { + String id = remote.generateId(); + Customer customer = remote.createCustomer(id, name); + customer.dump("Client.create()"); + return remote.getId(customer); + } +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Customer.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Customer.java new file mode 100644 index 0000000000..f2b7b1e41d --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Customer.java @@ -0,0 +1,70 @@ +/* + * 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.itest.bindingsca; + +/** + * + */ +public class Customer { + private String id; + private String name; + + public Customer() { + } + + /** + * @param id + * @param name + */ + public Customer(String id, String name) { + super(); + this.id = id; + this.name = name; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public String toString() { + return "Customer [id=" + id + ", name=" + name + "]"; + } + + public void dump(String prefix) { + System.out.print(prefix); + System.out.print(": "); + System.out.print(toString()); + System.out.println(" @" + System.identityHashCode(this)); + System.out.println(getClass().getClassLoader()); + } +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/CustomerNotFoundException.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/CustomerNotFoundException.java new file mode 100644 index 0000000000..a6e80c9eca --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/CustomerNotFoundException.java @@ -0,0 +1,64 @@ +/* + * 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.itest.bindingsca; + +/** + * + */ +public class CustomerNotFoundException extends Exception { + private String customerId; + + /** + * + */ + public CustomerNotFoundException() { + } + + /** + * @param message + */ + public CustomerNotFoundException(String message) { + super(message); + } + + /** + * @param cause + */ + public CustomerNotFoundException(Throwable cause) { + super(cause); + } + + /** + * @param message + * @param cause + */ + public CustomerNotFoundException(String message, Throwable cause) { + super(message, cause); + } + + public String getCustomerId() { + return customerId; + } + + public void setCustomerId(String customerId) { + this.customerId = customerId; + } + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Local.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Local.java new file mode 100644 index 0000000000..0fe30c9d53 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Local.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 org.apache.tuscany.sca.itest.bindingsca; + +/** + * + */ +public interface Local { + String getName(Customer customer); +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/LocalServiceImpl.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/LocalServiceImpl.java new file mode 100644 index 0000000000..8783808334 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/LocalServiceImpl.java @@ -0,0 +1,38 @@ +/* + * 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.itest.bindingsca; + +import org.oasisopen.sca.annotation.Service; + +/** + * + */ +@Service(Local.class) +public class LocalServiceImpl implements Local { + + public String getName(Customer customer) { + if (customer == null) { + return null; + } + customer.dump("Local.getName()"); + return customer.getName(); + } + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Remote.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Remote.java new file mode 100644 index 0000000000..050d35007b --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Remote.java @@ -0,0 +1,36 @@ +/* + * 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.itest.bindingsca; + +import org.oasisopen.sca.annotation.Remotable; + +/** + * + */ +@Remotable +public interface Remote { + String generateId(); + + String getId(Customer customer); + + Customer getCustomer(String id) throws CustomerNotFoundException; + + Customer createCustomer(String id, String name); +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/RemoteServiceImpl.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/RemoteServiceImpl.java new file mode 100644 index 0000000000..6c432a500a --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/RemoteServiceImpl.java @@ -0,0 +1,66 @@ +/* + * 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.itest.bindingsca; + +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +import org.oasisopen.sca.annotation.AllowsPassByReference; +import org.oasisopen.sca.annotation.Scope; +import org.oasisopen.sca.annotation.Service; + +/** + * + */ +@Service(Remote.class) +@Scope("COMPOSITE") +public class RemoteServiceImpl implements Remote { + private Map<String, Customer> customers = new HashMap<String, Customer>(); + + public String generateId() { + return UUID.randomUUID().toString(); + } + + @AllowsPassByReference + public String getId(Customer customer) { + customer.dump("Remote.getId()"); + return customer.getId(); + } + + public Customer getCustomer(String id) throws CustomerNotFoundException { + Customer customer = customers.get(id); + if (customer == null) { + CustomerNotFoundException ex = new CustomerNotFoundException("Customer not found"); + ex.setCustomerId(id); + throw ex; + } + customer.dump("Remote.getCustomer()"); + return customer; + } + + public Customer createCustomer(String id, String name) { + Customer customer = new Customer(id, name); + customer.dump("Remote.createCustomer()"); + customers.put(id, customer); + return customer; + } + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/SCAClientImpl.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/SCAClientImpl.java new file mode 100644 index 0000000000..3573eea978 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/SCAClientImpl.java @@ -0,0 +1,57 @@ +/* + * 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.itest.bindingsca; + +import java.net.URI; + +import org.oasisopen.sca.client.SCAClientFactory; + +/** + * + */ +public class SCAClientImpl implements Client { + private Local local; + private Remote remote; + + public SCAClientImpl(String domainURI) throws Exception { + SCAClientFactory factory = SCAClientFactory.newInstance(URI.create(domainURI)); + local = factory.getService(Local.class, "LocalComponent/Local"); + remote = factory.getService(Remote.class, "RemoteComponent/Remote"); + } + + public String getName(String id) { + Customer customer = null; + try { + customer = remote.getCustomer(id); + } catch (CustomerNotFoundException e) { + return null; + } + customer.dump("Client.getName()"); + return local.getName(customer); + } + + public String create(String name) { + String id = remote.generateId(); + Customer customer = remote.createCustomer(id, name); + customer.dump("Client.create()"); + return remote.getId(customer); + } + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/main/resources/org/apache/tuscany/sca/itest/bindingsca/Client.composite b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/main/resources/org/apache/tuscany/sca/itest/bindingsca/Client.composite new file mode 100644 index 0000000000..b04cc33023 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/main/resources/org/apache/tuscany/sca/itest/bindingsca/Client.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 + * 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" + targetNamespace="http://client" + name="Client"> + + <component name="ClientComponent"> + <implementation.java class="org.apache.tuscany.sca.itest.bindingsca.ClientImpl" /> + <reference name="local" target="LocalComponent" /> + <reference name="remote" target="RemoteComponent" /> + </component> + + +</composite>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/main/resources/org/apache/tuscany/sca/itest/bindingsca/Service.composite b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/main/resources/org/apache/tuscany/sca/itest/bindingsca/Service.composite new file mode 100644 index 0000000000..fe282d291c --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/main/resources/org/apache/tuscany/sca/itest/bindingsca/Service.composite @@ -0,0 +1,31 @@ +<?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 + * 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" + targetNamespace="http://service" + name="Service"> + + <component name="LocalComponent"> + <implementation.java class="org.apache.tuscany.sca.itest.bindingsca.LocalServiceImpl" /> + </component> + + <component name="RemoteComponent"> + <implementation.java class="org.apache.tuscany.sca.itest.bindingsca.RemoteServiceImpl" /> + </component> + +</composite>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/AsynchTestCase.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/AsynchTestCase.java new file mode 100644 index 0000000000..9efa1a99ec --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/AsynchTestCase.java @@ -0,0 +1,79 @@ +/* + * 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.binding.sca.axis2; + + +import junit.framework.Assert; + +import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldClient; +import org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldClientCallbackOnewayRemoteImpl; +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; + +// @Ignore("TUSCANY-3138") +public class AsynchTestCase { + + public static Node nodeA; + public static Node nodeB; + + @BeforeClass + public static void init() throws Exception { + System.out.println("Setting up nodes"); + + try { + // create and start nodes + Contribution contrib = new Contribution("asynch", "./target/test-classes/ws/asynchReference"); + nodeA = NodeFactory.getInstance().createNode("HelloWorld.composite", contrib); + nodeA.start(); + + contrib = new Contribution("asynch", "./target/test-classes/ws/asynchService"); + nodeB = NodeFactory.getInstance().createNode("HelloWorld.composite", contrib); + nodeB.start(); + + } catch (Exception ex) { + System.err.println("Exception when creating domain " + ex.getMessage()); + ex.printStackTrace(System.err); + throw ex; + } + } + + @AfterClass + public static void destroy() throws Exception { + nodeA.stop(); + nodeB.stop(); + } + + @Test + public void testHelloWorldAsynch() throws Exception { + HelloWorldClient helloWorldClientB; + helloWorldClientB = nodeA.getService(HelloWorldClient.class, "AHelloWorldClientCallbackRemote"); + helloWorldClientB.getGreetings("fred"); + System.out.println("Sleeping ..."); + Thread.sleep(2000); + System.out.println("... Done"); + Assert.assertEquals("callback fred", HelloWorldClientCallbackOnewayRemoteImpl.result ); + + } + + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/CallbackTestCase.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/CallbackTestCase.java new file mode 100644 index 0000000000..efa84e92a5 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/CallbackTestCase.java @@ -0,0 +1,83 @@ +/* + * 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.binding.sca.axis2; + +import junit.framework.Assert; + +import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldClient; +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; + +// @Ignore("TUSCANY-3138") +public class CallbackTestCase { + + public static Node nodeA; + public static Node nodeB; + + @BeforeClass + public static void init() throws Exception { + System.out.println("Setting up nodes"); + + try { + // create and start nodes + Contribution contrib = new Contribution("reference", "./target/test-classes/ws/callbackReference"); + nodeA = NodeFactory.getInstance().createNode("HelloWorld.composite", contrib); + nodeA.start(); + + contrib = new Contribution("service", "./target/test-classes/ws/callbackService"); + nodeB = NodeFactory.getInstance().createNode("HelloWorld.composite", contrib); + nodeB.start(); + + } catch (Exception ex) { + System.err.println("Exception when creating domain " + ex.getMessage()); + ex.printStackTrace(System.err); + throw ex; + } + } + + @AfterClass + public static void destroy() throws Exception { + nodeA.stop(); + nodeB.stop(); + } + + //@Test + public void testKeepServerRunning() throws Exception { + System.out.println("press enter to continue"); + System.in.read(); + } + + @Test + public void testHelloWorldCallbackLocal() throws Exception { + HelloWorldClient helloWorldClientB; + helloWorldClientB = nodeB.getService(HelloWorldClient.class, "BHelloWorldClientCallbackLocal"); + Assert.assertEquals("Hello callback fred", helloWorldClientB.getGreetings("fred")); + } + + @Test + public void testHelloWorldCallbackRemote() throws Exception { + HelloWorldClient helloWorldClientA; + helloWorldClientA = nodeA.getService(HelloWorldClient.class, "AHelloWorldClientCallbackRemote"); + Assert.assertEquals("Hello callback fred", helloWorldClientA.getGreetings("fred")); + } +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/PromotionTestCase.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/PromotionTestCase.java new file mode 100644 index 0000000000..45d28140b4 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/PromotionTestCase.java @@ -0,0 +1,74 @@ +/* + * 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.binding.sca.axis2; + +import junit.framework.Assert; + +import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldClient; +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.Ignore; +import org.junit.Test; + +public class PromotionTestCase { + + + public static Node nodeA; + public static Node nodeB; + + @BeforeClass + public static void init() throws Exception { + System.out.println("Setting up nodes"); + + try { + // create and start nodes + Contribution contrib = new Contribution("reference", "./target/test-classes/ws/promotionReference"); + nodeA = NodeFactory.getInstance().createNode("HelloWorld.composite", contrib); + nodeA.start(); + + contrib = new Contribution("service", "./target/test-classes/ws/promotionService"); + nodeB = NodeFactory.getInstance().createNode("HelloWorld.composite", contrib); + nodeB.start(); + + } catch (Exception ex) { + System.err.println("Exception when creating domain " + ex.getMessage()); + ex.printStackTrace(System.err); + throw ex; + } + } + + @AfterClass + public static void destroy() throws Exception { + nodeA.stop(); + nodeB.stop(); + } + + @Test + @Ignore + public void testHelloWorldPromotion() throws Exception { + HelloWorldClient helloWorldClientA; + helloWorldClientA = nodeA.getService(HelloWorldClient.class, "AHelloWorldClientRemotePromotion"); + Assert.assertEquals(helloWorldClientA.getGreetings("fred"), "Hello fred"); + + } + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/SimpleTestCase.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/SimpleTestCase.java new file mode 100644 index 0000000000..a5d6529895 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/SimpleTestCase.java @@ -0,0 +1,110 @@ +/* + * 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.binding.sca.axis2; + +import junit.framework.Assert; + +import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldClient; +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.ServiceUnavailableException; + +public class SimpleTestCase { + + public static Node nodeA; + public static Node nodeB; + + @BeforeClass + public static void init() throws Exception { + System.out.println("Setting up nodes"); + + try { + // create and start nodes + Contribution contrib = new Contribution("reference", "./target/test-classes/ws/simpleReference"); + nodeA = NodeFactory.getInstance().createNode("HelloWorld.composite", contrib); + nodeA.start(); + + contrib = new Contribution("service", "./target/test-classes/ws/simpleService"); + nodeB = NodeFactory.getInstance().createNode("HelloWorld.composite", contrib); + nodeB.start(); + + } catch (Exception ex) { + System.err.println("Exception when creating domain " + ex.getMessage()); + ex.printStackTrace(System.err); + throw ex; + } + } + + @AfterClass + public static void destroy() throws Exception { + nodeA.stop(); + nodeB.stop(); + } + + @Test + public void testHelloWorldLocal() throws Exception { + HelloWorldClient helloWorldClientA = nodeA.getService(HelloWorldClient.class, "AHelloWorldClientLocal"); + Assert.assertEquals(helloWorldClientA.getGreetings("fred"), "Hello fred"); + + } + + @Test + public void testHelloWorldRemote() throws Exception { + + HelloWorldClient helloWorldClientA; + helloWorldClientA = nodeA.getService(HelloWorldClient.class, "AHelloWorldClientRemote"); + + try { + helloWorldClientA.getGreetings("fred"); + } catch (ServiceUnavailableException ex){ + Assert.fail(); + } + } + + @Test + public void testHelloWorldLocalAndRemote() throws Exception { + HelloWorldClient helloWorldClientA = nodeA.getService(HelloWorldClient.class, "AHelloWorldClientLocalAndRemote"); + HelloWorldClient helloWorldClientB = nodeB.getService(HelloWorldClient.class, "BHelloWorldClientLocalAndRemote"); + Assert.assertEquals(helloWorldClientA.getGreetings("fred"), "Hello fred"); + Assert.assertEquals(helloWorldClientB.getGreetings("fred"), "Hello fred"); + } + + @Test + public void testHelloWorldMultipleServices() throws Exception { + HelloWorldClient helloWorldClientA = nodeA.getService(HelloWorldClient.class, "AHelloWorldClientMultipleServices"); + HelloWorldClient helloWorldClientA2 = nodeA.getService(HelloWorldClient.class, "AHelloWorldClientMultipleServices2"); + HelloWorldClient helloWorldClientB = nodeB.getService(HelloWorldClient.class, "BHelloWorldClientMultipleServices"); + Assert.assertEquals(helloWorldClientA.getGreetings("fred"), "Hello fred"); + Assert.assertEquals(helloWorldClientA2.getGreetings("fred"), "Hello fred"); + Assert.assertEquals(helloWorldClientB.getGreetings("fred"), "Hello fred"); + } + + @Test + public void testHelloWorldMultipleBindings() throws Exception { + HelloWorldClient helloWorldClientA; + helloWorldClientA = nodeA.getService(HelloWorldClient.class, "AHelloWorldClientMultipleBindings"); + Assert.assertEquals(helloWorldClientA.getGreetings("fred"), "Hello fred"); + + } + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldCallbackRemote.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldCallbackRemote.java new file mode 100644 index 0000000000..f7ab3dfe98 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldCallbackRemote.java @@ -0,0 +1,30 @@ +/* + * 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.binding.sca.axis2.helloworld; + +import org.oasisopen.sca.annotation.Remotable; + + +@Remotable +public interface HelloWorldCallbackRemote { + + String getGreetingsCallbackRemote(String s); + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldClient.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldClient.java new file mode 100644 index 0000000000..3d25d37708 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldClient.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 org.apache.tuscany.sca.binding.sca.axis2.helloworld; + + +public interface HelloWorldClient { + + String getGreetings(String s); + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceCallbackOnewayRemote.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceCallbackOnewayRemote.java new file mode 100644 index 0000000000..a469d197d6 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceCallbackOnewayRemote.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 org.apache.tuscany.sca.binding.sca.axis2.helloworld; + +import org.oasisopen.sca.annotation.Callback; +import org.oasisopen.sca.annotation.OneWay; +import org.oasisopen.sca.annotation.Remotable; + +@Remotable +@Callback(HelloWorldCallbackRemote.class) +public interface HelloWorldServiceCallbackOnewayRemote { + + @OneWay + void getGreetingsRemote(String s); + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceCallbackRemote.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceCallbackRemote.java new file mode 100644 index 0000000000..3f5a21fddd --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceCallbackRemote.java @@ -0,0 +1,31 @@ +/* + * 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.binding.sca.axis2.helloworld; + +import org.oasisopen.sca.annotation.Callback; +import org.oasisopen.sca.annotation.Remotable; + +@Remotable +@Callback(HelloWorldCallbackRemote.class) +public interface HelloWorldServiceCallbackRemote { + + String getGreetingsRemote(String s); + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceLocal.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceLocal.java new file mode 100644 index 0000000000..49e5232b31 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceLocal.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 org.apache.tuscany.sca.binding.sca.axis2.helloworld; + + +public interface HelloWorldServiceLocal { + + String getGreetingsLocal(String s); + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceRemote.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceRemote.java new file mode 100644 index 0000000000..ccc77c142b --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceRemote.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 org.apache.tuscany.sca.binding.sca.axis2.helloworld; + +import org.oasisopen.sca.annotation.Remotable; + +@Remotable +public interface HelloWorldServiceRemote { + + String getGreetingsRemote(String s); + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceRemote2.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceRemote2.java new file mode 100644 index 0000000000..c2be798d1a --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceRemote2.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 org.apache.tuscany.sca.binding.sca.axis2.helloworld; + +import org.oasisopen.sca.annotation.Remotable; + +@Remotable +public interface HelloWorldServiceRemote2 { + + String getGreetingsRemote2(String s); + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientCallbackOnewayRemoteImpl.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientCallbackOnewayRemoteImpl.java new file mode 100644 index 0000000000..9355aece1f --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientCallbackOnewayRemoteImpl.java @@ -0,0 +1,43 @@ +/* + * 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.binding.sca.axis2.helloworld.impl; + +import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldClient; +import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceCallbackOnewayRemote; +import org.oasisopen.sca.annotation.Reference; + +public class HelloWorldClientCallbackOnewayRemoteImpl implements HelloWorldClient { + + public static String result; + + @Reference + public HelloWorldServiceCallbackOnewayRemote helloWorldService; + + public String getGreetings(String s) { + helloWorldService.getGreetingsRemote(s); + return null; + } + + public String getGreetingsCallbackRemote(String s) { + result = "callback " + s; + return result; + } + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientCallbackRemoteImpl.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientCallbackRemoteImpl.java new file mode 100644 index 0000000000..efc47aa94d --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientCallbackRemoteImpl.java @@ -0,0 +1,42 @@ +/* + * 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.binding.sca.axis2.helloworld.impl; + +import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldClient; +import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceCallbackRemote; +import org.oasisopen.sca.annotation.Reference; + +public class HelloWorldClientCallbackRemoteImpl implements HelloWorldClient { + + public static String result; + + @Reference + public HelloWorldServiceCallbackRemote helloWorldService; + + public String getGreetings(String s) { + return helloWorldService.getGreetingsRemote(s); + } + + public String getGreetingsCallbackRemote(String s) { + result = "callback " + s; + return result; + } + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientLocalImpl.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientLocalImpl.java new file mode 100644 index 0000000000..6ed813ff0a --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientLocalImpl.java @@ -0,0 +1,35 @@ +/* + * 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.binding.sca.axis2.helloworld.impl; + +import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldClient; +import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceLocal; +import org.oasisopen.sca.annotation.Reference; + +public class HelloWorldClientLocalImpl implements HelloWorldClient { + + @Reference + public HelloWorldServiceLocal helloWorldService; + + public String getGreetings(String s) { + return helloWorldService.getGreetingsLocal(s); + } + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientRemote2Impl.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientRemote2Impl.java new file mode 100644 index 0000000000..ba70573efb --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientRemote2Impl.java @@ -0,0 +1,35 @@ +/* + * 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.binding.sca.axis2.helloworld.impl; + +import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldClient; +import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceRemote2; +import org.oasisopen.sca.annotation.Reference; + +public class HelloWorldClientRemote2Impl implements HelloWorldClient { + + @Reference + public HelloWorldServiceRemote2 helloWorldService; + + public String getGreetings(String s) { + return helloWorldService.getGreetingsRemote2(s); + } + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientRemoteImpl.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientRemoteImpl.java new file mode 100644 index 0000000000..a87d6eb49a --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientRemoteImpl.java @@ -0,0 +1,35 @@ +/* + * 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.binding.sca.axis2.helloworld.impl; + +import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldClient; +import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceRemote; +import org.oasisopen.sca.annotation.Reference; + +public class HelloWorldClientRemoteImpl implements HelloWorldClient { + + @Reference + public HelloWorldServiceRemote helloWorldService; + + public String getGreetings(String s) { + return helloWorldService.getGreetingsRemote(s); + } + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceCallbackOnewayRemoteImpl.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceCallbackOnewayRemoteImpl.java new file mode 100644 index 0000000000..3dc0b12b82 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceCallbackOnewayRemoteImpl.java @@ -0,0 +1,35 @@ +/* + * 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.binding.sca.axis2.helloworld.impl; + +import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldCallbackRemote; +import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceCallbackOnewayRemote; +import org.oasisopen.sca.annotation.Callback; + +public class HelloWorldServiceCallbackOnewayRemoteImpl implements HelloWorldServiceCallbackOnewayRemote { + + @Callback + protected HelloWorldCallbackRemote theCallback; + + public void getGreetingsRemote(String s) { + theCallback.getGreetingsCallbackRemote(s); + } + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceCallbackRemoteImpl.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceCallbackRemoteImpl.java new file mode 100644 index 0000000000..b15d6dea80 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceCallbackRemoteImpl.java @@ -0,0 +1,39 @@ +/* + * 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.binding.sca.axis2.helloworld.impl; + +import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldCallbackRemote; +import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceCallbackRemote; +import org.oasisopen.sca.annotation.Callback; + +public class HelloWorldServiceCallbackRemoteImpl implements HelloWorldServiceCallbackRemote { + + @Callback + protected HelloWorldCallbackRemote theCallback; + + public HelloWorldServiceCallbackRemoteImpl() { + System.out.println("Constructor"); + } + + public String getGreetingsRemote(String s) { + return "Hello " + theCallback.getGreetingsCallbackRemote(s); + } + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceLocalImpl.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceLocalImpl.java new file mode 100644 index 0000000000..c4347b084a --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceLocalImpl.java @@ -0,0 +1,30 @@ +/* + * 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.binding.sca.axis2.helloworld.impl; + +import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceLocal; + +public class HelloWorldServiceLocalImpl implements HelloWorldServiceLocal { + + public String getGreetingsLocal(String s) { + return "Hello " + s; + } + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceMultipleServicesImpl.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceMultipleServicesImpl.java new file mode 100644 index 0000000000..846bff02e1 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceMultipleServicesImpl.java @@ -0,0 +1,41 @@ +/* + * 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.binding.sca.axis2.helloworld.impl; + +import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceLocal; +import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceRemote; +import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceRemote2; +import org.oasisopen.sca.annotation.Service; + +@Service({HelloWorldServiceRemote.class, HelloWorldServiceRemote2.class, HelloWorldServiceLocal.class} ) +public class HelloWorldServiceMultipleServicesImpl implements HelloWorldServiceLocal, HelloWorldServiceRemote, HelloWorldServiceRemote2 { + + public String getGreetingsLocal(String s) { + return "Hello " + s; + } + + public String getGreetingsRemote(String s) { + return "Hello " + s; + } + + public String getGreetingsRemote2(String s) { + return "Hello " + s; + } +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceRemoteImpl.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceRemoteImpl.java new file mode 100644 index 0000000000..d69f442879 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceRemoteImpl.java @@ -0,0 +1,30 @@ +/* + * 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.binding.sca.axis2.helloworld.impl; + +import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceRemote; + +public class HelloWorldServiceRemoteImpl implements HelloWorldServiceRemote { + + public String getGreetingsRemote(String s) { + return "Hello " + s; + } + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/AsynchTestCase.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/AsynchTestCase.java new file mode 100644 index 0000000000..cbcc06056a --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/AsynchTestCase.java @@ -0,0 +1,79 @@ +/*
+ * 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.binding.sca.rmi;
+
+
+import junit.framework.Assert;
+
+import org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldClient;
+import org.apache.tuscany.sca.binding.sca.rmi.helloworld.impl.HelloWorldClientCallbackOnewayRemoteImpl;
+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;
+
+public class AsynchTestCase {
+
+ public static Node nodeA;
+ public static Node nodeB;
+
+ @BeforeClass
+ public static void init() throws Exception {
+ System.out.println("Setting up nodes");
+ // System.setProperty("org.apache.tuscany.sca.binding.sca.provider.SCABindingMapper.mappedBinding", RMIBinding.TYPE.toString());
+ try {
+ // create and start nodes
+ Contribution contrib = new Contribution("asynch", "./target/test-classes/rmi/asynchReference");
+ nodeA = NodeFactory.getInstance().createNode("HelloWorld.composite", contrib);
+ nodeA.start();
+
+ contrib = new Contribution("asynch", "./target/test-classes/rmi/asynchService");
+ nodeB = NodeFactory.getInstance().createNode("HelloWorld.composite", contrib);
+ nodeB.start();
+
+ } catch (Exception ex) {
+ System.err.println("Exception when creating domain " + ex.getMessage());
+ ex.printStackTrace(System.err);
+ throw ex;
+ }
+ }
+
+ @AfterClass
+ public static void destroy() throws Exception {
+ nodeA.stop();
+ nodeB.stop();
+ // System.clearProperty("org.apache.tuscany.sca.binding.sca.provider.SCABindingMapper.mappedBinding");
+ }
+
+ @Test
+ public void testHelloWorldAsynch() throws Exception {
+ HelloWorldClient helloWorldClientB;
+ helloWorldClientB = nodeA.getService(HelloWorldClient.class, "AHelloWorldClientCallbackRemote");
+ helloWorldClientB.getGreetings("fred");
+ System.out.println("Sleeping ...");
+ Thread.sleep(2000);
+ System.out.println("... Done");
+ Assert.assertEquals("callback fred", HelloWorldClientCallbackOnewayRemoteImpl.result );
+
+ }
+
+
+}
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/CallbackTestCase.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/CallbackTestCase.java new file mode 100644 index 0000000000..dccd2dace8 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/CallbackTestCase.java @@ -0,0 +1,84 @@ +/*
+ * 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.binding.sca.rmi;
+
+import junit.framework.Assert;
+
+import org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldClient;
+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;
+
+public class CallbackTestCase {
+
+ public static Node nodeA;
+ public static Node nodeB;
+
+ @BeforeClass
+ public static void init() throws Exception {
+ System.out.println("Setting up nodes");
+ // System.setProperty("org.apache.tuscany.sca.binding.sca.provider.SCABindingMapper.mappedBinding", RMIBinding.TYPE.toString());
+
+ try {
+ // create and start nodes
+ Contribution contrib = new Contribution("reference", "./target/test-classes/rmi/callbackReference");
+ nodeA = NodeFactory.getInstance().createNode("HelloWorld.composite", contrib);
+ nodeA.start();
+
+ contrib = new Contribution("service", "./target/test-classes/rmi/callbackService");
+ nodeB = NodeFactory.getInstance().createNode("HelloWorld.composite", contrib);
+ nodeB.start();
+
+ } catch (Exception ex) {
+ System.err.println("Exception when creating domain " + ex.getMessage());
+ ex.printStackTrace(System.err);
+ throw ex;
+ }
+ }
+
+ @AfterClass
+ public static void destroy() throws Exception {
+ nodeA.stop();
+ nodeB.stop();
+ // System.clearProperty("org.apache.tuscany.sca.binding.sca.provider.SCABindingMapper.mappedBinding");
+ }
+
+ //@Test
+ public void testKeepServerRunning() throws Exception {
+ System.out.println("press enter to continue");
+ System.in.read();
+ }
+
+ @Test
+ public void testHelloWorldCallbackLocal() throws Exception {
+ HelloWorldClient helloWorldClientB;
+ helloWorldClientB = nodeB.getService(HelloWorldClient.class, "BHelloWorldClientCallbackLocal");
+ Assert.assertEquals("Hello callback fred", helloWorldClientB.getGreetings("fred"));
+ }
+
+ @Test
+ public void testHelloWorldCallbackRemote() throws Exception {
+ HelloWorldClient helloWorldClientA;
+ helloWorldClientA = nodeA.getService(HelloWorldClient.class, "AHelloWorldClientCallbackRemote");
+ Assert.assertEquals("Hello callback fred", helloWorldClientA.getGreetings("fred"));
+ }
+}
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/PromotionTestCase.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/PromotionTestCase.java new file mode 100644 index 0000000000..7aac95a8ff --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/PromotionTestCase.java @@ -0,0 +1,76 @@ +/*
+ * 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.binding.sca.rmi;
+
+import junit.framework.Assert;
+
+import org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldClient;
+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;
+
+public class PromotionTestCase {
+
+
+ public static Node nodeA;
+ public static Node nodeB;
+
+ @BeforeClass
+ public static void init() throws Exception {
+ System.out.println("Setting up nodes");
+ System.setProperty("org.apache.tuscany.sca.binding.sca.provider.SCABindingMapper.mappedBinding",
+ "{http://tuscany.apache.org/xmlns/sca/1.1}binding.rmi");
+
+ try {
+ // create and start nodes
+ Contribution contrib = new Contribution("reference", "./target/test-classes/rmi/promotionReference");
+ nodeA = NodeFactory.getInstance().createNode("HelloWorld.composite", contrib);
+ nodeA.start();
+
+ contrib = new Contribution("service", "./target/test-classes/rmi/promotionService");
+ nodeB = NodeFactory.getInstance().createNode("HelloWorld.composite", contrib);
+ nodeB.start();
+
+ } catch (Exception ex) {
+ System.err.println("Exception when creating domain " + ex.getMessage());
+ ex.printStackTrace(System.err);
+ throw ex;
+ }
+ }
+
+ @AfterClass
+ public static void destroy() throws Exception {
+ nodeA.stop();
+ nodeB.stop();
+ System.clearProperty("org.apache.tuscany.sca.binding.sca.provider.SCABindingMapper.mappedBinding");
+
+ }
+
+ @Test
+ public void testHelloWorldPromotion() throws Exception {
+ HelloWorldClient helloWorldClientA;
+ helloWorldClientA = nodeA.getService(HelloWorldClient.class, "AHelloWorldClientRemotePromotion");
+ Assert.assertEquals(helloWorldClientA.getGreetings("fred"), "Hello fred");
+
+ }
+
+}
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/SimpleTestCase.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/SimpleTestCase.java new file mode 100644 index 0000000000..f748beb6cb --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/SimpleTestCase.java @@ -0,0 +1,116 @@ +/*
+ * 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.binding.sca.rmi;
+
+import junit.framework.Assert;
+
+import org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldClient;
+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.ServiceUnavailableException;
+
+public class SimpleTestCase {
+
+ private static NodeFactory factory;
+ public static Node nodeA;
+ public static Node nodeB;
+
+ @BeforeClass
+ public static void init() throws Exception {
+ System.out.println("Setting up nodes");
+ System.setProperty("org.apache.tuscany.sca.binding.sca.provider.SCABindingMapper.mappedBinding",
+ "{http://tuscany.apache.org/xmlns/sca/1.1}binding.rmi");
+
+ try {
+ factory = NodeFactory.getInstance();
+ // create and start nodes
+ Contribution contrib = new Contribution("reference", "./target/test-classes/rmi/simpleReference");
+ nodeA = factory.createNode("HelloWorld.composite", contrib);
+ nodeA.start();
+
+ contrib = new Contribution("service", "./target/test-classes/rmi/simpleService");
+ nodeB = factory.createNode("HelloWorld.composite", contrib);
+ nodeB.start();
+
+ } catch (Exception ex) {
+ System.err.println("Exception when creating domain " + ex.getMessage());
+ ex.printStackTrace(System.err);
+ throw ex;
+ }
+ }
+
+ @AfterClass
+ public static void destroy() throws Exception {
+ nodeA.stop();
+ nodeB.stop();
+ factory.destroy();
+ System.clearProperty("org.apache.tuscany.sca.binding.sca.provider.SCABindingMapper.mappedBinding");
+ }
+
+ @Test
+ public void testHelloWorldLocal() throws Exception {
+ HelloWorldClient helloWorldClientA = nodeA.getService(HelloWorldClient.class, "AHelloWorldClientLocal");
+ Assert.assertEquals(helloWorldClientA.getGreetings("fred"), "Hello fred");
+
+ }
+
+ @Test
+ public void testHelloWorldRemote() throws Exception {
+
+ HelloWorldClient helloWorldClientA;
+ helloWorldClientA = nodeA.getService(HelloWorldClient.class, "AHelloWorldClientRemote");
+
+ try {
+ helloWorldClientA.getGreetings("fred");
+ } catch (ServiceUnavailableException ex){
+ Assert.fail();
+ }
+ }
+
+ @Test
+ public void testHelloWorldLocalAndRemote() throws Exception {
+ HelloWorldClient helloWorldClientA = nodeA.getService(HelloWorldClient.class, "AHelloWorldClientLocalAndRemote");
+ HelloWorldClient helloWorldClientB = nodeB.getService(HelloWorldClient.class, "BHelloWorldClientLocalAndRemote");
+ Assert.assertEquals(helloWorldClientA.getGreetings("fred"), "Hello fred");
+ Assert.assertEquals(helloWorldClientB.getGreetings("fred"), "Hello fred");
+ }
+
+ @Test
+ public void testHelloWorldMultipleServices() throws Exception {
+ HelloWorldClient helloWorldClientA = nodeA.getService(HelloWorldClient.class, "AHelloWorldClientMultipleServices");
+ HelloWorldClient helloWorldClientA2 = nodeA.getService(HelloWorldClient.class, "AHelloWorldClientMultipleServices2");
+ HelloWorldClient helloWorldClientB = nodeB.getService(HelloWorldClient.class, "BHelloWorldClientMultipleServices");
+ Assert.assertEquals(helloWorldClientA.getGreetings("fred"), "Hello fred");
+ Assert.assertEquals(helloWorldClientA2.getGreetings("fred"), "Hello fred");
+ Assert.assertEquals(helloWorldClientB.getGreetings("fred"), "Hello fred");
+ }
+
+ @Test
+ public void testHelloWorldMultipleBindings() throws Exception {
+ HelloWorldClient helloWorldClientA;
+ helloWorldClientA = nodeA.getService(HelloWorldClient.class, "AHelloWorldClientMultipleBindings");
+ Assert.assertEquals(helloWorldClientA.getGreetings("fred"), "Hello fred");
+
+ }
+
+}
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldCallbackRemote.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldCallbackRemote.java new file mode 100644 index 0000000000..7c4cf4b0b7 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldCallbackRemote.java @@ -0,0 +1,30 @@ +/*
+ * 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.binding.sca.rmi.helloworld;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+
+@Remotable
+public interface HelloWorldCallbackRemote {
+
+ String getGreetingsCallbackRemote(String s);
+
+}
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldClient.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldClient.java new file mode 100644 index 0000000000..017acee582 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldClient.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 org.apache.tuscany.sca.binding.sca.rmi.helloworld;
+
+
+public interface HelloWorldClient {
+
+ String getGreetings(String s);
+
+}
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceCallbackOnewayRemote.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceCallbackOnewayRemote.java new file mode 100644 index 0000000000..86f984e61a --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceCallbackOnewayRemote.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 org.apache.tuscany.sca.binding.sca.rmi.helloworld;
+
+import org.oasisopen.sca.annotation.Callback;
+import org.oasisopen.sca.annotation.OneWay;
+import org.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+@Callback(HelloWorldCallbackRemote.class)
+public interface HelloWorldServiceCallbackOnewayRemote {
+
+ @OneWay
+ void getGreetingsRemote(String s);
+
+}
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceCallbackRemote.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceCallbackRemote.java new file mode 100644 index 0000000000..8e19fd7382 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceCallbackRemote.java @@ -0,0 +1,31 @@ +/*
+ * 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.binding.sca.rmi.helloworld;
+
+import org.oasisopen.sca.annotation.Callback;
+import org.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+@Callback(HelloWorldCallbackRemote.class)
+public interface HelloWorldServiceCallbackRemote {
+
+ String getGreetingsRemote(String s);
+
+}
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceLocal.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceLocal.java new file mode 100644 index 0000000000..b0d623e2e4 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceLocal.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 org.apache.tuscany.sca.binding.sca.rmi.helloworld;
+
+
+public interface HelloWorldServiceLocal {
+
+ String getGreetingsLocal(String s);
+
+}
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceRemote.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceRemote.java new file mode 100644 index 0000000000..ccb44694d9 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceRemote.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 org.apache.tuscany.sca.binding.sca.rmi.helloworld;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+public interface HelloWorldServiceRemote {
+
+ String getGreetingsRemote(String s);
+
+}
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceRemote2.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceRemote2.java new file mode 100644 index 0000000000..5c8bb13f43 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceRemote2.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 org.apache.tuscany.sca.binding.sca.rmi.helloworld;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+public interface HelloWorldServiceRemote2 {
+
+ String getGreetingsRemote2(String s);
+
+}
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientCallbackOnewayRemoteImpl.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientCallbackOnewayRemoteImpl.java new file mode 100644 index 0000000000..1ff1792bb7 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientCallbackOnewayRemoteImpl.java @@ -0,0 +1,43 @@ +/*
+ * 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.binding.sca.rmi.helloworld.impl;
+
+import org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldClient;
+import org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldServiceCallbackOnewayRemote;
+import org.oasisopen.sca.annotation.Reference;
+
+public class HelloWorldClientCallbackOnewayRemoteImpl implements HelloWorldClient {
+
+ public static String result;
+
+ @Reference
+ public HelloWorldServiceCallbackOnewayRemote helloWorldService;
+
+ public String getGreetings(String s) {
+ helloWorldService.getGreetingsRemote(s);
+ return null;
+ }
+
+ public String getGreetingsCallbackRemote(String s) {
+ result = "callback " + s;
+ return result;
+ }
+
+}
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientCallbackRemoteImpl.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientCallbackRemoteImpl.java new file mode 100644 index 0000000000..b17d8e2016 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientCallbackRemoteImpl.java @@ -0,0 +1,42 @@ +/*
+ * 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.binding.sca.rmi.helloworld.impl;
+
+import org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldClient;
+import org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldServiceCallbackRemote;
+import org.oasisopen.sca.annotation.Reference;
+
+public class HelloWorldClientCallbackRemoteImpl implements HelloWorldClient {
+
+ public static String result;
+
+ @Reference
+ public HelloWorldServiceCallbackRemote helloWorldService;
+
+ public String getGreetings(String s) {
+ return helloWorldService.getGreetingsRemote(s);
+ }
+
+ public String getGreetingsCallbackRemote(String s) {
+ result = "callback " + s;
+ return result;
+ }
+
+}
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientLocalImpl.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientLocalImpl.java new file mode 100644 index 0000000000..e230326f5f --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientLocalImpl.java @@ -0,0 +1,35 @@ +/*
+ * 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.binding.sca.rmi.helloworld.impl;
+
+import org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldClient;
+import org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldServiceLocal;
+import org.oasisopen.sca.annotation.Reference;
+
+public class HelloWorldClientLocalImpl implements HelloWorldClient {
+
+ @Reference
+ public HelloWorldServiceLocal helloWorldService;
+
+ public String getGreetings(String s) {
+ return helloWorldService.getGreetingsLocal(s);
+ }
+
+}
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientRemote2Impl.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientRemote2Impl.java new file mode 100644 index 0000000000..77df8c2c39 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientRemote2Impl.java @@ -0,0 +1,35 @@ +/*
+ * 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.binding.sca.rmi.helloworld.impl;
+
+import org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldClient;
+import org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldServiceRemote2;
+import org.oasisopen.sca.annotation.Reference;
+
+public class HelloWorldClientRemote2Impl implements HelloWorldClient {
+
+ @Reference
+ public HelloWorldServiceRemote2 helloWorldService;
+
+ public String getGreetings(String s) {
+ return helloWorldService.getGreetingsRemote2(s);
+ }
+
+}
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientRemoteImpl.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientRemoteImpl.java new file mode 100644 index 0000000000..8effa3ac36 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientRemoteImpl.java @@ -0,0 +1,35 @@ +/*
+ * 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.binding.sca.rmi.helloworld.impl;
+
+import org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldClient;
+import org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldServiceRemote;
+import org.oasisopen.sca.annotation.Reference;
+
+public class HelloWorldClientRemoteImpl implements HelloWorldClient {
+
+ @Reference
+ public HelloWorldServiceRemote helloWorldService;
+
+ public String getGreetings(String s) {
+ return helloWorldService.getGreetingsRemote(s);
+ }
+
+}
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceCallbackOnewayRemoteImpl.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceCallbackOnewayRemoteImpl.java new file mode 100644 index 0000000000..2467ddab88 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceCallbackOnewayRemoteImpl.java @@ -0,0 +1,35 @@ +/*
+ * 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.binding.sca.rmi.helloworld.impl;
+
+import org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldCallbackRemote;
+import org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldServiceCallbackOnewayRemote;
+import org.oasisopen.sca.annotation.Callback;
+
+public class HelloWorldServiceCallbackOnewayRemoteImpl implements HelloWorldServiceCallbackOnewayRemote {
+
+ @Callback
+ protected HelloWorldCallbackRemote theCallback;
+
+ public void getGreetingsRemote(String s) {
+ theCallback.getGreetingsCallbackRemote(s);
+ }
+
+}
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceCallbackRemoteImpl.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceCallbackRemoteImpl.java new file mode 100644 index 0000000000..d1b75d0a2c --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceCallbackRemoteImpl.java @@ -0,0 +1,39 @@ +/*
+ * 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.binding.sca.rmi.helloworld.impl;
+
+import org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldCallbackRemote;
+import org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldServiceCallbackRemote;
+import org.oasisopen.sca.annotation.Callback;
+
+public class HelloWorldServiceCallbackRemoteImpl implements HelloWorldServiceCallbackRemote {
+
+ @Callback
+ protected HelloWorldCallbackRemote theCallback;
+
+ public HelloWorldServiceCallbackRemoteImpl() {
+ System.out.println("Constructor");
+ }
+
+ public String getGreetingsRemote(String s) {
+ return "Hello " + theCallback.getGreetingsCallbackRemote(s);
+ }
+
+}
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceLocalImpl.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceLocalImpl.java new file mode 100644 index 0000000000..44e7efc668 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceLocalImpl.java @@ -0,0 +1,30 @@ +/*
+ * 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.binding.sca.rmi.helloworld.impl;
+
+import org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldServiceLocal;
+
+public class HelloWorldServiceLocalImpl implements HelloWorldServiceLocal {
+
+ public String getGreetingsLocal(String s) {
+ return "Hello " + s;
+ }
+
+}
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceMultipleServicesImpl.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceMultipleServicesImpl.java new file mode 100644 index 0000000000..88440de023 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceMultipleServicesImpl.java @@ -0,0 +1,41 @@ +/*
+ * 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.binding.sca.rmi.helloworld.impl;
+
+import org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldServiceLocal;
+import org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldServiceRemote;
+import org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldServiceRemote2;
+import org.oasisopen.sca.annotation.Service;
+
+@Service({HelloWorldServiceRemote.class, HelloWorldServiceRemote2.class, HelloWorldServiceLocal.class} )
+public class HelloWorldServiceMultipleServicesImpl implements HelloWorldServiceLocal, HelloWorldServiceRemote, HelloWorldServiceRemote2 {
+
+ public String getGreetingsLocal(String s) {
+ return "Hello " + s;
+ }
+
+ public String getGreetingsRemote(String s) {
+ return "Hello " + s;
+ }
+
+ public String getGreetingsRemote2(String s) {
+ return "Hello " + s;
+ }
+}
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceRemoteImpl.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceRemoteImpl.java new file mode 100644 index 0000000000..06dc2c3f79 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceRemoteImpl.java @@ -0,0 +1,30 @@ +/*
+ * 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.binding.sca.rmi.helloworld.impl;
+
+import org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldServiceRemote;
+
+public class HelloWorldServiceRemoteImpl implements HelloWorldServiceRemote {
+
+ public String getGreetingsRemote(String s) {
+ return "Hello " + s;
+ }
+
+}
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/itest/bindingsca/BindingSCATestCase.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/itest/bindingsca/BindingSCATestCase.java new file mode 100644 index 0000000000..fcd0d39162 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/itest/bindingsca/BindingSCATestCase.java @@ -0,0 +1,170 @@ +/* + * 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.itest.bindingsca; + +import java.io.File; + +import org.apache.tuscany.sca.assembly.SCABinding; +import org.apache.tuscany.sca.binding.ws.WebServiceBinding; +import org.apache.tuscany.sca.node.Node; +import org.apache.tuscany.sca.node.NodeFactory; +import org.apache.tuscany.sca.node.configuration.NodeConfiguration; +import org.junit.Assert; +import org.junit.Test; +import org.oasisopen.sca.ServiceRuntimeException; + +/** + * Test binding.sca in the same classloader + */ +public class BindingSCATestCase { + static final String DOMAIN_URI = "my-domain"; + private static final String REGISTRY_URI = "tuscany:bindingScaTestDomain"; + private static final String PKG = "org/apache/tuscany/sca/itest/bindingsca/"; + private static final String CLIENT = "Client.composite"; + private static final String SERVICE = "Service.composite"; + private static final String ROOT = new File("target/classes/" + PKG).toURI().toString(); + + /** + * One NodeFactory and two nodes + */ + @Test + public void testOneFactoryTwoNodes() { + NodeFactory factory1 = NodeFactory.getInstance(); + Node node1 = createClientNode(factory1); + Node node2 = createServiceNode(factory1); + node1.start(); + node2.start(); + try { + runClient(node1); + } finally { + node2.stop(); + node1.stop(); + factory1.destroy(); + } + } + + /** + * Create the service node + * @param factory + * @return + */ + static Node createServiceNode(NodeFactory factory) { + NodeConfiguration config2 = + factory.createNodeConfiguration().setDomainURI(DOMAIN_URI).setURI("node2").addContribution("c2", ROOT) + .addDeploymentComposite("c2", SERVICE).setDomainRegistryURI(REGISTRY_URI) + .addBinding(WebServiceBinding.TYPE, "http://localhost:8085/").addBinding(SCABinding.TYPE, + "http://localhost:8085/"); + + Node node2 = factory.createNode(config2); + return node2; + } + + /** + * Create the client node + * @param factory + * @return + */ + static Node createClientNode(NodeFactory factory) { + NodeConfiguration config1 = + factory.createNodeConfiguration().setDomainURI(DOMAIN_URI).setURI("node1").addContribution("c1", ROOT) + .addDeploymentComposite("c1", CLIENT).setDomainRegistryURI(REGISTRY_URI) + .addBinding(WebServiceBinding.TYPE, "http://localhost:8085/").addBinding(SCABinding.TYPE, + "http://localhost:8085/"); + Node node1 = factory.createNode(config1); + return node1; + } + + /** + * Two node factories and two nodes + */ + @Test + public void testTwoFactoriesTwoNodes() throws Exception { + NodeFactory factory1 = NodeFactory.newInstance(); + Node node1 = createClientNode(factory1); + NodeFactory factory2 = NodeFactory.newInstance(); + Node node2 = createServiceNode(factory2); + node1.start(); + node2.start(); + Thread.sleep(1000); + try { + // This call doesn't require the Local service, it should be successful + createCustomer(node1); + try { + runClient(node1); + // We cannot make local call to remote endpoints + Assert.fail("ServiceRuntimeException should have been thrown."); + } catch (ServiceRuntimeException e) { + // ignore + } + } finally { + node2.stop(); + node1.stop(); + factory2.destroy(); + factory1.destroy(); + } + } + + /** + * Run the client + * @param node + */ + static void runClient(Node node) { + Client client = node.getService(Client.class, "ClientComponent/Client"); + runClient(client); + } + + static void runClient(Client client) { + String id = client.create("Ray"); + Assert.assertEquals("Ray", client.getName(id)); + } + + static void runClientNotFound(Client client) { + String id = "not-there"; + Assert.assertNull(client.getName(id)); + } + + static String createCustomer(Node node) { + Client client = node.getService(Client.class, "ClientComponent/Client"); + String id = client.create("John"); + Assert.assertNotNull(id); + return id; + } + + /** + * One node factory and one node for both composites + */ + @Test + public void testOneFactoryOneNode() { + NodeFactory factory = NodeFactory.getInstance(); + NodeConfiguration config1 = + factory.createNodeConfiguration().setDomainURI(DOMAIN_URI).setURI("node1").addContribution("c1", ROOT) + .addDeploymentComposite("c1", CLIENT).addDeploymentComposite("c1", SERVICE); + + Node node1 = factory.createNode(config1); + node1.start(); + try { + runClient(node1); + } finally { + node1.stop(); + factory.destroy(); + } + } + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientNodeSharedCustomerTestCase.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientNodeSharedCustomerTestCase.java new file mode 100644 index 0000000000..7255697d4b --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientNodeSharedCustomerTestCase.java @@ -0,0 +1,62 @@ +/* + * 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.itest.bindingsca; + +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; + +/** + * Running the client node and service node with two different classloaders that share the Customer class + */ +public class ClientNodeSharedCustomerTestCase { + private static Node clientNode; + private static TestCaseRunner runner; + private static NodeFactory factory; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + runner = new TestCaseRunner(ServiceNode.class, Remote.class.getName(), RemoteServiceImpl.class.getName()); + runner.beforeClass(); + factory = NodeFactory.getInstance(); + clientNode = BindingSCATestCase.createClientNode(factory).start(); + Thread.sleep(1000); + } + + @Test + public void testClient() throws Exception { + BindingSCATestCase.runClient(clientNode); + } + + @AfterClass + public static void tearDownAfterClass() throws Exception { + if (clientNode != null) { + clientNode.stop(); + } + if (runner != null) { + runner.afterClass(); + } + if (factory != null) { + factory.destroy(); + } + } +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientNodeSharedLocalTestCase.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientNodeSharedLocalTestCase.java new file mode 100644 index 0000000000..51fafae32c --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientNodeSharedLocalTestCase.java @@ -0,0 +1,62 @@ +/* + * 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.itest.bindingsca; + +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; + +/** + * Running the client node and service node with two different classloaders that share the Local class + * (but not Customer) + */ +public class ClientNodeSharedLocalTestCase { + private static Node clientNode; + private static TestCaseRunner runner; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + runner = + new TestCaseRunner(ServiceNode.class, Remote.class.getName(), RemoteServiceImpl.class.getName(), + Customer.class.getName()); + runner.beforeClass(); + NodeFactory factory = NodeFactory.getInstance(); + clientNode = BindingSCATestCase.createClientNode(factory).start(); + Thread.sleep(1000); + } + + @Test + public void testClient() throws Exception { + BindingSCATestCase.runClient(clientNode); + } + + @AfterClass + public static void tearDownAfterClass() throws Exception { + if (clientNode != null) { + clientNode.stop(); + } + if (runner != null) { + runner.afterClass(); + } + NodeFactory.getInstance().destroy(); + } +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientSharedCustomerTestCase.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientSharedCustomerTestCase.java new file mode 100644 index 0000000000..b8ff0c58ba --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientSharedCustomerTestCase.java @@ -0,0 +1,54 @@ +/* + * 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.itest.bindingsca; + +import org.apache.tuscany.sca.node.NodeFactory; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +/** + * Running the client api and service node with two different classloaders that share the Customer class + */ +public class ClientSharedCustomerTestCase { + private static Client client; + private static TestCaseRunner runner; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + runner = new TestCaseRunner(ServiceNode.class, Remote.class.getName(), RemoteServiceImpl.class.getName()); + runner.beforeClass(); + client = new SCAClientImpl(BindingSCATestCase.DOMAIN_URI); + Thread.sleep(1000); + } + + @Test + public void testClient() throws Exception { + BindingSCATestCase.runClient(client); + } + + @AfterClass + public static void tearDownAfterClass() throws Exception { + if (runner != null) { + runner.afterClass(); + } + NodeFactory.getInstance().destroy(); + } +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientSharedLocalTestCase.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientSharedLocalTestCase.java new file mode 100644 index 0000000000..633e1a767c --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientSharedLocalTestCase.java @@ -0,0 +1,63 @@ +/* + * 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.itest.bindingsca; + +import org.apache.tuscany.sca.node.NodeFactory; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +/** + * Running the client api and service node with two different classloaders that share the Local class + * (but not Customer) + */ +public class ClientSharedLocalTestCase { + private static Client client; + private static TestCaseRunner runner; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + runner = + new TestCaseRunner(ServiceNode.class, Remote.class.getName(), RemoteServiceImpl.class.getName(), + Customer.class.getName(), CustomerNotFoundException.class.getName()); + runner.beforeClass(); + client = new SCAClientImpl(BindingSCATestCase.DOMAIN_URI); + Thread.sleep(1000); + } + + @Test + public void testClient() throws Exception { + BindingSCATestCase.runClient(client); + } + + @Test + public void testClientNotFound() throws Exception { + BindingSCATestCase.runClientNotFound(client); + } + + + @AfterClass + public static void tearDownAfterClass() throws Exception { + if (runner != null) { + runner.afterClass(); + } + NodeFactory.getInstance().destroy(); + } +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ServiceNode.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ServiceNode.java new file mode 100644 index 0000000000..1cba2b57c2 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ServiceNode.java @@ -0,0 +1,48 @@ +/* + * 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.itest.bindingsca; + +import org.apache.tuscany.sca.node.Node; +import org.apache.tuscany.sca.node.NodeFactory; +import org.junit.AfterClass; +import org.junit.BeforeClass; + +/** + * This shows how to test the Calculator service component. + */ +public class ServiceNode { + private static Node serviceNode; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + /* System.setProperty("org.apache.tuscany.sca.contribution.processor.ValidationSchemaExtensionPoint.enabled", + "false"); + */ + NodeFactory factory = NodeFactory.getInstance(); + serviceNode = BindingSCATestCase.createServiceNode(factory).start(); + } + + @AfterClass + public static void tearDownAfterClass() throws Exception { + if (serviceNode != null) { + serviceNode.stop(); + } + } +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/itest/bindingsca/TestCaseRunner.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/itest/bindingsca/TestCaseRunner.java new file mode 100644 index 0000000000..c0960ffe95 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/itest/bindingsca/TestCaseRunner.java @@ -0,0 +1,329 @@ +/* + * 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.itest.bindingsca; + +import java.lang.annotation.Annotation; +import java.lang.reflect.Constructor; +import java.lang.reflect.Method; +import java.net.URL; +import java.net.URLClassLoader; +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** + * A helper class that can be used to run an SCA JUnit test case. The test case will run in an isolated class loader. + * + * @version $Rev$ $Date$ + */ +public class TestCaseRunner { + + private ClassLoader classLoader; + private Class<?> testSuiteClass; + private Object testSuite; + private Class<?> testResultClass; + private Class<?> testCaseClass; + private Object testCase; + + private Class<?> beforeAnnotation; + private Class<?> beforeClassAnnotation; + private Class<?> afterAnnotation; + private Class<?> afterClassAnnotation; + private Class<?> junit4AdapterClass; + private Class<?> junit3TestCaseClass; + + /** + * Constructs a new TestCase runner. + * + * @param testClass + */ + public TestCaseRunner(Class<?> testClass, String... isolatedClasses) { + try { + ClassLoader tccl = setupClassLoader(testClass, isolatedClasses); + + try { + // Thread.currentThread().setContextClassLoader(classLoader); + // Allow privileged access to set class loader. Requires RuntimePermission + // setContextClassLoader in security policy. + final ClassLoader finalClassLoader = classLoader; + AccessController.doPrivileged(new PrivilegedAction<Object>() { + public Object run() { + Thread.currentThread().setContextClassLoader(finalClassLoader); + return null; + } + }); + + testCaseClass = Class.forName(testClass.getName(), true, classLoader); + testCase = testCaseClass.newInstance(); + ClassLoader testClassLoader = testCaseClass.getClassLoader(); + + junit3TestCaseClass = Class.forName("junit.framework.TestCase", true, testClassLoader); + + testSuiteClass = Class.forName("junit.framework.TestSuite", true, testClassLoader); + Constructor<?> testSuiteConstructor = testSuiteClass.getConstructor(Class.class); + testSuite = testSuiteConstructor.newInstance(testCaseClass); + + testResultClass = Class.forName("junit.framework.TestResult", true, testClassLoader); + + try { + beforeAnnotation = Class.forName("org.junit.Before", true, testClassLoader); + afterAnnotation = Class.forName("org.junit.After", true, testClassLoader); + beforeClassAnnotation = Class.forName("org.junit.BeforeClass", true, testClassLoader); + afterClassAnnotation = Class.forName("org.junit.AfterClass", true, testClassLoader); + junit4AdapterClass = Class.forName("junit.framework.JUnit4TestAdapter", true, testClassLoader); + } catch (Exception e) { + // Unexpected + throw new AssertionError(e); + } + } catch (Throwable e) { + e.printStackTrace(); + } finally { + // Thread.currentThread().setContextClassLoader(tccl); + // Allow privileged access to set class loader. Requires RuntimePermission + // setContextClassLoader in security policy. + final ClassLoader finaltccl = tccl; + AccessController.doPrivileged(new PrivilegedAction<Object>() { + public Object run() { + Thread.currentThread().setContextClassLoader(finaltccl); + return null; + } + }); + } + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + private ClassLoader setupClassLoader(Class<?> testClass, String... isolatedClasses) { + ClassLoader tccl = Thread.currentThread().getContextClassLoader(); + classLoader = testClass.getClassLoader(); + if (classLoader instanceof URLClassLoader) { + URL[] urls = ((URLClassLoader)classLoader).getURLs(); + classLoader = new ClassLoaderImpl(urls, classLoader, isolatedClasses); + } else if (classLoader == tccl || classLoader.getParent() == tccl) { + classLoader = new URLClassLoader(new URL[0], classLoader); + } else { + classLoader = tccl; + } + return tccl; + } + + /** + * Run the test case + */ + public void run() { + ClassLoader tccl = Thread.currentThread().getContextClassLoader(); + try { + // Thread.currentThread().setContextClassLoader(classLoader); + // Allow privileged access to set class loader. Requires RuntimePermission + // setContextClassLoader in security policy. + final ClassLoader finalClassLoader = classLoader; + AccessController.doPrivileged(new PrivilegedAction<Object>() { + public Object run() { + Thread.currentThread().setContextClassLoader(finalClassLoader); + return null; + } + }); + + if (junit3TestCaseClass.isAssignableFrom(testCaseClass)) { + Object testResult = testResultClass.newInstance(); + Method runMethod = testSuiteClass.getMethod("run", testResultClass); + runMethod.invoke(testSuite, testResult); + } else { + Object junit4Adapter = junit4AdapterClass.getConstructor(Class.class).newInstance(testCaseClass); + Object testResult = testResultClass.newInstance(); + Method runMethod = junit4AdapterClass.getMethod("run", testResultClass); + runMethod.invoke(junit4Adapter, testResult); + } + } catch (Exception e) { + throw new RuntimeException(e); + } finally { + // Thread.currentThread().setContextClassLoader(tccl); + // Allow privileged access to set class loader. Requires RuntimePermission + // setContextClassLoader in security policy. + final ClassLoader finaltccl = tccl; + AccessController.doPrivileged(new PrivilegedAction<Object>() { + public Object run() { + Thread.currentThread().setContextClassLoader(finaltccl); + return null; + } + }); + } + } + + /** + * Invoke the setUp method + */ + public void setUp() { + execute("setUp"); + } + + /** + * Invoke the before methods + */ + public void before() { + execute(beforeAnnotation); + } + + /** + * Invoke the beforeClass methods + */ + public void beforeClass() { + execute(beforeClassAnnotation); + } + + /** + * Invoke the tearDown method + */ + public void tearDown() { + execute("tearDown"); + } + + /** + * Invoke the after methods + */ + public void after() { + execute(afterAnnotation); + } + + /** + * Invoke the afterClass methods + */ + public void afterClass() { + execute(afterClassAnnotation); + } + + /** + * Invoke the specified test method. + */ + public void run(String methodName) { + execute(methodName); + } + + /** + * Invoke the methods annotated with the specified annotation. + */ + private void execute(Class<?> annotationClass) { + if (annotationClass == null) { + throw new RuntimeException(new NoSuchMethodException()); + } + ClassLoader tccl = Thread.currentThread().getContextClassLoader(); + try { + // Thread.currentThread().setContextClassLoader(classLoader); + // Allow privileged access to set class loader. Requires RuntimePermission + // setContextClassLoader in security policy. + final ClassLoader finalClassLoader = classLoader; + AccessController.doPrivileged(new PrivilegedAction<Object>() { + public Object run() { + Thread.currentThread().setContextClassLoader(finalClassLoader); + return null; + } + }); + + for (Method method : testCaseClass.getDeclaredMethods()) { + for (Annotation annotation : method.getAnnotations()) { + if (annotation.annotationType() == annotationClass) { + method.invoke(testCase); + } + } + } + } catch (Exception e) { + throw new RuntimeException(e); + } finally { + // Thread.currentThread().setContextClassLoader(tccl); + // Allow privileged access to set class loader. Requires RuntimePermission + // setContextClassLoader in security policy. + final ClassLoader finaltccl = tccl; + AccessController.doPrivileged(new PrivilegedAction<Object>() { + public Object run() { + Thread.currentThread().setContextClassLoader(finaltccl); + return null; + } + }); + } + } + + /** + * Invoke the specified method + */ + private void execute(String methodName) { + ClassLoader tccl = Thread.currentThread().getContextClassLoader(); + try { + // Thread.currentThread().setContextClassLoader(classLoader); + // Allow privileged access to set class loader. Requires RuntimePermission + // setContextClassLoader in security policy. + final ClassLoader finalClassLoader = classLoader; + AccessController.doPrivileged(new PrivilegedAction<Object>() { + public Object run() { + Thread.currentThread().setContextClassLoader(finalClassLoader); + return null; + } + }); + Method setUpMethod = testCaseClass.getDeclaredMethod(methodName); + setUpMethod.setAccessible(true); + setUpMethod.invoke(testCase); + } catch (Exception e) { + throw new RuntimeException(e); + } finally { + // Thread.currentThread().setContextClassLoader(tccl); + // Allow privileged access to set class loader. Requires RuntimePermission + // setContextClassLoader in security policy. + final ClassLoader finaltccl = tccl; + AccessController.doPrivileged(new PrivilegedAction<Object>() { + public Object run() { + Thread.currentThread().setContextClassLoader(finaltccl); + return null; + } + }); + } + } + + public static class ClassLoaderImpl extends URLClassLoader { + private Set<String> isolatedClasses = new HashSet<String>(); + + /** + * @param urls + * @param parent + */ + public ClassLoaderImpl(URL[] urls, ClassLoader parent, String... sharedClasses) { + super(urls, parent); + this.isolatedClasses.addAll(Arrays.asList(sharedClasses)); + } + + @Override + protected synchronized Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException { + if (!isolatedClasses.contains(name)) { + return super.loadClass(name, resolve); + } else { + Class<?> cls = findLoadedClass(name); + if (cls == null) { + cls = findClass(name); + } + if (resolve) { + resolveClass(cls); + } + return cls; + } + } + + } + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/asynchReference/HelloWorld.composite b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/asynchReference/HelloWorld.composite new file mode 100644 index 0000000000..8c825ca805 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/asynchReference/HelloWorld.composite @@ -0,0 +1,36 @@ +<?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"
+ targetNamespace="http://sample"
+ xmlns:sample="http://sample"
+ name="HelloWorld">
+
+ <!-- callback remote wire -->
+ <component name="AHelloWorldClientCallbackRemote">
+ <implementation.java class="org.apache.tuscany.sca.binding.sca.rmi.helloworld.impl.HelloWorldClientCallbackOnewayRemoteImpl" />
+ <reference name="helloWorldService" target="BHelloWorldServiceCallbackRemote">
+ <binding.sca/>
+ <callback>
+ <binding.sca uri="http://localhost:8084/AHelloWorldClientCallbackRemote"/>
+ </callback>
+ </reference>
+ </component>
+
+</composite>
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/asynchReference/META-INF/sca-contribution.xml b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/asynchReference/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..ab75f7d225 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/asynchReference/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/200912"
+ xmlns:sample="http://sample">
+ <deployable composite="sample:HelloWorld"/>
+</contribution>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/asynchService/HelloWorld.composite b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/asynchService/HelloWorld.composite new file mode 100644 index 0000000000..79b1a5d794 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/asynchService/HelloWorld.composite @@ -0,0 +1,38 @@ +<?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"
+ targetNamespace="http://sample"
+ xmlns:sample="http://sample"
+ name="HelloWorld">
+
+
+ <!-- callback remote wire -->
+ <component name="BHelloWorldServiceCallbackRemote">
+ <implementation.java class="org.apache.tuscany.sca.binding.sca.rmi.helloworld.impl.HelloWorldServiceCallbackOnewayRemoteImpl" />
+ <service name="HelloWorldServiceCallbackOnewayRemote">
+ <binding.sca uri="http://localhost:8085/BHelloWorldServiceCallbackRemote"/>
+ <callback>
+ <binding.sca/>
+ </callback>
+ </service>
+ </component>
+
+
+</composite>
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/asynchService/META-INF/sca-contribution.xml b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/asynchService/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..ab75f7d225 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/asynchService/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/200912"
+ xmlns:sample="http://sample">
+ <deployable composite="sample:HelloWorld"/>
+</contribution>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/callbackReference/HelloWorld.composite b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/callbackReference/HelloWorld.composite new file mode 100644 index 0000000000..e8924d2728 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/callbackReference/HelloWorld.composite @@ -0,0 +1,36 @@ +<?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"
+ targetNamespace="http://sample"
+ xmlns:sample="http://sample"
+ name="HelloWorld">
+
+ <!-- callback remote wire -->
+ <component name="AHelloWorldClientCallbackRemote">
+ <implementation.java class="org.apache.tuscany.sca.binding.sca.rmi.helloworld.impl.HelloWorldClientCallbackRemoteImpl" />
+ <reference name="helloWorldService" target="BHelloWorldServiceCallbackRemote">
+ <binding.sca/>
+ <callback>
+ <binding.sca uri="http://localhost:8084/AHelloWorldClientCallbackRemote"/>
+ </callback>
+ </reference>
+ </component>
+
+</composite>
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/callbackReference/META-INF/sca-contribution.xml b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/callbackReference/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..ab75f7d225 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/callbackReference/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/200912"
+ xmlns:sample="http://sample">
+ <deployable composite="sample:HelloWorld"/>
+</contribution>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/callbackService/HelloWorld.composite b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/callbackService/HelloWorld.composite new file mode 100644 index 0000000000..4edc8df5cd --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/callbackService/HelloWorld.composite @@ -0,0 +1,43 @@ +<?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"
+ targetNamespace="http://sample"
+ xmlns:sample="http://sample"
+ name="HelloWorld">
+
+
+ <!-- callback remote wire -->
+ <component name="BHelloWorldServiceCallbackRemote">
+ <implementation.java class="org.apache.tuscany.sca.binding.sca.rmi.helloworld.impl.HelloWorldServiceCallbackRemoteImpl" />
+ <service name="HelloWorldServiceCallbackRemote">
+ <binding.sca uri="http://localhost:8085/BHelloWorldServiceCallbackRemote"/>
+ <callback>
+ <binding.sca/>
+ </callback>
+ </service>
+ </component>
+
+ <!-- callback local wire -->
+ <component name="BHelloWorldClientCallbackLocal">
+ <implementation.java class="org.apache.tuscany.sca.binding.sca.rmi.helloworld.impl.HelloWorldClientCallbackRemoteImpl" />
+ <reference name="helloWorldService" target="BHelloWorldServiceCallbackRemote" />
+ </component>
+
+</composite>
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/callbackService/META-INF/sca-contribution.xml b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/callbackService/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..ab75f7d225 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/callbackService/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/200912"
+ xmlns:sample="http://sample">
+ <deployable composite="sample:HelloWorld"/>
+</contribution>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/promotionReference/HelloWorld.composite b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/promotionReference/HelloWorld.composite new file mode 100644 index 0000000000..823cab4f56 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/promotionReference/HelloWorld.composite @@ -0,0 +1,33 @@ +<?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"
+ targetNamespace="http://sample"
+ xmlns:sample="http://sample"
+ name="HelloWorld">
+
+
+ <!-- composite hierarchy -->
+ <component name="AHelloWorldClientRemotePromotion">
+ <implementation.composite name="sample:HelloWorldComponent" />
+ <reference name="AHelloWorldClientRemoteReference" target="BHelloWorldServiceRemotePromotion"/>
+ </component>
+
+
+</composite>
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/promotionReference/HelloWorldComponent.composite b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/promotionReference/HelloWorldComponent.composite new file mode 100644 index 0000000000..088fd616f4 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/promotionReference/HelloWorldComponent.composite @@ -0,0 +1,37 @@ +<?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"
+ targetNamespace="http://sample"
+ xmlns:sample="http://sample"
+ name="HelloWorldComponent">
+
+ <service name="AHelloWorldClientRemoteService" promote="AHelloWorldClientRemoteComponent">
+ <interface.java interface="org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldClient"/>
+ </service>
+
+ <reference name="AHelloWorldClientRemoteReference" promote="AHelloWorldClientRemoteComponent/helloWorldService" multiplicity="1..1">
+ <interface.java interface="org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldServiceRemote"/>
+ </reference>
+
+ <component name="AHelloWorldClientRemoteComponent">
+ <implementation.java class="org.apache.tuscany.sca.binding.sca.rmi.helloworld.impl.HelloWorldClientRemoteImpl"/>
+ </component>
+
+</composite>
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/promotionReference/META-INF/sca-contribution.xml b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/promotionReference/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..ab75f7d225 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/promotionReference/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/200912"
+ xmlns:sample="http://sample">
+ <deployable composite="sample:HelloWorld"/>
+</contribution>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/promotionService/HelloWorld.composite b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/promotionService/HelloWorld.composite new file mode 100644 index 0000000000..454e9c55cf --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/promotionService/HelloWorld.composite @@ -0,0 +1,35 @@ +<?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"
+ targetNamespace="http://sample"
+ xmlns:sample="http://sample"
+ name="HelloWorld">
+
+
+ <!-- composite hierarchy -->
+ <component name="BHelloWorldServiceRemotePromotion">
+ <implementation.composite name="sample:HelloWorldComponent" />
+ <service name="BHelloWorldServiceRemoteService">
+ <binding.sca uri="http://localhost:8085/BHelloWorldServiceRemotePromotion"/>
+ </service>
+ </component>
+
+
+</composite>
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/promotionService/HelloWorldComponent.composite b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/promotionService/HelloWorldComponent.composite new file mode 100644 index 0000000000..a313fb8f68 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/promotionService/HelloWorldComponent.composite @@ -0,0 +1,37 @@ +<?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"
+ targetNamespace="http://sample"
+ xmlns:sample="http://sample"
+ name="HelloWorldComponent">
+
+ <service name="BHelloWorldServiceRemoteService"
+ promote="BHelloWorldServiceRemoteComponent/HelloWorldServiceRemote"/>
+
+ <component name="BHelloWorldServiceRemoteComponent">
+ <implementation.java class="org.apache.tuscany.sca.binding.sca.rmi.helloworld.impl.HelloWorldServiceRemoteImpl"/>
+ </component>
+
+ <component name="BHelloWorldServiceLocalAndRemoteNested">
+ <implementation.java class="org.apache.tuscany.sca.binding.sca.rmi.helloworld.impl.HelloWorldServiceRemoteImpl" />
+ </component>
+
+
+</composite>
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/promotionService/META-INF/sca-contribution.xml b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/promotionService/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..ab75f7d225 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/promotionService/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/200912"
+ xmlns:sample="http://sample">
+ <deployable composite="sample:HelloWorld"/>
+</contribution>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/simpleReference/HelloWorld.composite b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/simpleReference/HelloWorld.composite new file mode 100644 index 0000000000..4151749523 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/simpleReference/HelloWorld.composite @@ -0,0 +1,67 @@ +<?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"
+ targetNamespace="http://sample"
+ xmlns:sample="http://sample"
+ name="HelloWorld">
+
+
+ <!-- local only wire -->
+ <component name="AHelloWorldClientLocal">
+ <implementation.java class="org.apache.tuscany.sca.binding.sca.rmi.helloworld.impl.HelloWorldClientLocalImpl"/>
+ <reference name="helloWorldService" target="AHelloWorldServiceLocal" />
+ </component>
+
+ <component name="AHelloWorldServiceLocal">
+ <implementation.java class="org.apache.tuscany.sca.binding.sca.rmi.helloworld.impl.HelloWorldServiceLocalImpl" />
+ </component>
+
+ <!-- unresolved remote wire -->
+ <component name="AHelloWorldClientRemote">
+ <implementation.java class="org.apache.tuscany.sca.binding.sca.rmi.helloworld.impl.HelloWorldClientRemoteImpl" />
+ <reference name="helloWorldService" target="BHelloWorldServiceRemote" />
+ </component>
+
+ <!-- local and remote wires -->
+ <component name="AHelloWorldClientLocalAndRemote">
+ <implementation.java class="org.apache.tuscany.sca.binding.sca.rmi.helloworld.impl.HelloWorldClientRemoteImpl" />
+ <reference name="helloWorldService" target="BHelloWorldServiceLocalAndRemote"/>
+ </component>
+
+ <!-- multiple services -->
+ <component name="AHelloWorldClientMultipleServices">
+ <implementation.java class="org.apache.tuscany.sca.binding.sca.rmi.helloworld.impl.HelloWorldClientRemoteImpl" />
+ <reference name="helloWorldService" target="BHelloWorldServiceMultipleServices/HelloWorldServiceRemote"/>
+ </component>
+
+ <component name="AHelloWorldClientMultipleServices2">
+ <implementation.java class="org.apache.tuscany.sca.binding.sca.rmi.helloworld.impl.HelloWorldClientRemote2Impl" />
+ <reference name="helloWorldService" target="BHelloWorldServiceMultipleServices/HelloWorldServiceRemote2"/>
+ </component>
+
+ <!-- multiple bindings -->
+ <component name="AHelloWorldClientMultipleBindings">
+ <implementation.java class="org.apache.tuscany.sca.binding.sca.rmi.helloworld.impl.HelloWorldClientRemoteImpl" />
+ <reference name="helloWorldService" target="BHelloWorldMultipleBindings/HelloWorldServiceRemote/scaBinding">
+ <interface.java interface="org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldServiceRemote" />
+ </reference>
+ </component>
+
+</composite>
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/simpleReference/META-INF/sca-contribution.xml b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/simpleReference/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..ab75f7d225 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/simpleReference/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/200912"
+ xmlns:sample="http://sample">
+ <deployable composite="sample:HelloWorld"/>
+</contribution>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/simpleService/HelloWorld.composite b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/simpleService/HelloWorld.composite new file mode 100644 index 0000000000..37af7625ff --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/simpleService/HelloWorld.composite @@ -0,0 +1,85 @@ +<?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"
+ xmlns:sample="http://sample"
+ name="HelloWorld">
+
+
+ <!-- local only wire -->
+
+
+ <!-- unresolved remote wire -->
+ <component name="BHelloWorldServiceRemote">
+ <implementation.java class="org.apache.tuscany.sca.binding.sca.rmi.helloworld.impl.HelloWorldServiceRemoteImpl" />
+ <service name="HelloWorldServiceRemote">
+ <binding.sca uri="http://localhost:8085/BHelloWorldServiceRemote"/>
+ </service>
+ </component>
+
+ <!-- local and remote wires -->
+ <component name="BHelloWorldServiceLocalAndRemote">
+ <implementation.java class="org.apache.tuscany.sca.binding.sca.rmi.helloworld.impl.HelloWorldServiceRemoteImpl" />
+ <service name="HelloWorldServiceRemote">
+ <binding.sca uri="http://localhost:8085/BHelloWorldServiceLocalAndRemote"/>
+ </service>
+ </component>
+
+ <component name="BHelloWorldClientLocalAndRemote">
+ <implementation.java class="org.apache.tuscany.sca.binding.sca.rmi.helloworld.impl.HelloWorldClientRemoteImpl" />
+ <reference name="helloWorldService" target="BHelloWorldServiceLocalAndRemote" />
+ </component>
+
+ <!-- multiple services -->
+ <component name="BHelloWorldServiceMultipleServices">
+ <implementation.java class="org.apache.tuscany.sca.binding.sca.rmi.helloworld.impl.HelloWorldServiceMultipleServicesImpl" />
+ <service name="HelloWorldServiceLocal">
+ </service>
+ <service name="HelloWorldServiceRemote">
+ <binding.sca uri="http://localhost:8085/BHelloWorldServiceMultipleServices/HelloWorldServiceRemote"/>
+ </service>
+ <service name="HelloWorldServiceRemote2">
+ <binding.sca uri="http://localhost:8085/BHelloWorldServiceMultipleServices/HelloWorldServiceRemote2"/>
+ </service>
+ </component>
+
+ <component name="BHelloWorldClientMultipleServices">
+ <implementation.java class="org.apache.tuscany.sca.binding.sca.rmi.helloworld.impl.HelloWorldClientLocalImpl" />
+ <reference name="helloWorldService" target="BHelloWorldServiceMultipleServices/HelloWorldServiceLocal" />
+ </component>
+
+ <!-- multiple bindings -->
+ <component name="BHelloWorldMultipleBindings">
+ <implementation.java class="org.apache.tuscany.sca.binding.sca.rmi.helloworld.impl.HelloWorldServiceRemoteImpl" />
+ <service name="HelloWorldServiceRemote">
+ <interface.java interface="org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldServiceRemote" />
+ <!-- tuscany:binding.rmi name="rmiBinding" uri="http://localhost:8085/BHelloWorldMultipleBindings/HelloWorldServiceRemote-wsbinding"/ -->
+ <binding.sca name="scaBinding" uri="http://localhost:8085/BHelloWorldMultipleBindings/HelloWorldServiceRemote-scabinding"/>
+ </service>
+ </component>
+
+
+ <!-- Dynamic interfaces -->
+ <!--component name="BHelloWorldServiceScript">
+ <implementation.script script="calculator/AddServiceImpl.js"/>
+ </component-->
+
+</composite>
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/simpleService/META-INF/sca-contribution.xml b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/simpleService/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..ab75f7d225 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/simpleService/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/200912"
+ xmlns:sample="http://sample">
+ <deployable composite="sample:HelloWorld"/>
+</contribution>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/asynchReference/HelloWorld.composite b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/asynchReference/HelloWorld.composite new file mode 100644 index 0000000000..e797a0aa9c --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/asynchReference/HelloWorld.composite @@ -0,0 +1,36 @@ +<?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" + targetNamespace="http://sample" + xmlns:sample="http://sample" + name="HelloWorld"> + + <!-- callback remote wire --> + <component name="AHelloWorldClientCallbackRemote"> + <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldClientCallbackOnewayRemoteImpl" /> + <reference name="helloWorldService" target="BHelloWorldServiceCallbackRemote"> + <binding.sca/> + <callback> + <binding.sca uri="http://localhost:8084/AHelloWorldClientCallbackRemote"/> + </callback> + </reference> + </component> + +</composite> diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/asynchReference/META-INF/sca-contribution.xml b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/asynchReference/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..e6ccae5c73 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/asynchReference/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/200912" + xmlns:sample="http://sample"> + <deployable composite="sample:HelloWorld"/> +</contribution>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/asynchService/HelloWorld.composite b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/asynchService/HelloWorld.composite new file mode 100644 index 0000000000..079ee49380 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/asynchService/HelloWorld.composite @@ -0,0 +1,38 @@ +<?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" + targetNamespace="http://sample" + xmlns:sample="http://sample" + name="HelloWorld"> + + + <!-- callback remote wire --> + <component name="BHelloWorldServiceCallbackRemote"> + <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldServiceCallbackOnewayRemoteImpl" /> + <service name="HelloWorldServiceCallbackOnewayRemote"> + <binding.sca uri="http://localhost:8085/BHelloWorldServiceCallbackRemote"/> + <callback> + <binding.sca/> + </callback> + </service> + </component> + + +</composite> diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/asynchService/META-INF/sca-contribution.xml b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/asynchService/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..e6ccae5c73 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/asynchService/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/200912" + xmlns:sample="http://sample"> + <deployable composite="sample:HelloWorld"/> +</contribution>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/callbackReference/HelloWorld.composite b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/callbackReference/HelloWorld.composite new file mode 100644 index 0000000000..1d5630f3d0 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/callbackReference/HelloWorld.composite @@ -0,0 +1,36 @@ +<?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" + targetNamespace="http://sample" + xmlns:sample="http://sample" + name="HelloWorld"> + + <!-- callback remote wire --> + <component name="AHelloWorldClientCallbackRemote"> + <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldClientCallbackRemoteImpl" /> + <reference name="helloWorldService" target="BHelloWorldServiceCallbackRemote"> + <binding.sca/> + <callback> + <binding.sca uri="http://localhost:8084/AHelloWorldClientCallbackRemote"/> + </callback> + </reference> + </component> + +</composite> diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/callbackReference/META-INF/sca-contribution.xml b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/callbackReference/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..e6ccae5c73 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/callbackReference/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/200912" + xmlns:sample="http://sample"> + <deployable composite="sample:HelloWorld"/> +</contribution>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/callbackService/HelloWorld.composite b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/callbackService/HelloWorld.composite new file mode 100644 index 0000000000..ded3766d49 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/callbackService/HelloWorld.composite @@ -0,0 +1,43 @@ +<?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" + targetNamespace="http://sample" + xmlns:sample="http://sample" + name="HelloWorld"> + + + <!-- callback remote wire --> + <component name="BHelloWorldServiceCallbackRemote"> + <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldServiceCallbackRemoteImpl" /> + <service name="HelloWorldServiceCallbackRemote"> + <binding.sca uri="http://localhost:8085/BHelloWorldServiceCallbackRemote"/> + <callback> + <binding.sca/> + </callback> + </service> + </component> + + <!-- callback local wire --> + <component name="BHelloWorldClientCallbackLocal"> + <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldClientCallbackRemoteImpl" /> + <reference name="helloWorldService" target="BHelloWorldServiceCallbackRemote" /> + </component> + +</composite> diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/callbackService/META-INF/sca-contribution.xml b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/callbackService/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..e6ccae5c73 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/callbackService/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/200912" + xmlns:sample="http://sample"> + <deployable composite="sample:HelloWorld"/> +</contribution>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/promotionReference/HelloWorld.composite b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/promotionReference/HelloWorld.composite new file mode 100644 index 0000000000..4513f21acf --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/promotionReference/HelloWorld.composite @@ -0,0 +1,33 @@ +<?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" + targetNamespace="http://sample" + xmlns:sample="http://sample" + name="HelloWorld"> + + + <!-- composite hierarchy --> + <component name="AHelloWorldClientRemotePromotion"> + <implementation.composite name="sample:HelloWorldComponent" /> + <reference name="AHelloWorldClientRemoteReference" target="BHelloWorldServiceRemotePromotion"/> + </component> + + +</composite> diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/promotionReference/HelloWorldComponent.composite b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/promotionReference/HelloWorldComponent.composite new file mode 100644 index 0000000000..22c20ff94a --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/promotionReference/HelloWorldComponent.composite @@ -0,0 +1,37 @@ +<?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" + targetNamespace="http://sample" + xmlns:sample="http://sample" + name="HelloWorldComponent"> + + <service name="AHelloWorldClientRemoteService" promote="AHelloWorldClientRemoteComponent"> + <interface.java interface="org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldClient"/> + </service> + + <reference name="AHelloWorldClientRemoteReference" promote="AHelloWorldClientRemoteComponent/helloWorldService" multiplicity="1..1"> + <interface.java interface="org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceRemote"/> + </reference> + + <component name="AHelloWorldClientRemoteComponent"> + <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldClientRemoteImpl"/> + </component> + +</composite> diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/promotionReference/META-INF/sca-contribution.xml b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/promotionReference/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..e6ccae5c73 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/promotionReference/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/200912" + xmlns:sample="http://sample"> + <deployable composite="sample:HelloWorld"/> +</contribution>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/promotionService/HelloWorld.composite b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/promotionService/HelloWorld.composite new file mode 100644 index 0000000000..e6a7d776c9 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/promotionService/HelloWorld.composite @@ -0,0 +1,35 @@ +<?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" + targetNamespace="http://sample" + xmlns:sample="http://sample" + name="HelloWorld"> + + + <!-- composite hierarchy --> + <component name="BHelloWorldServiceRemotePromotion"> + <implementation.composite name="sample:HelloWorldComponent" /> + <service name="BHelloWorldServiceRemoteService"> + <binding.sca uri="http://localhost:8085/BHelloWorldServiceRemotePromotion"/> + </service> + </component> + + +</composite> diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/promotionService/HelloWorldComponent.composite b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/promotionService/HelloWorldComponent.composite new file mode 100644 index 0000000000..0393280625 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/promotionService/HelloWorldComponent.composite @@ -0,0 +1,37 @@ +<?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" + targetNamespace="http://sample" + xmlns:sample="http://sample" + name="HelloWorldComponent"> + + <service name="BHelloWorldServiceRemoteService" + promote="BHelloWorldServiceRemoteComponent/HelloWorldServiceRemote"/> + + <component name="BHelloWorldServiceRemoteComponent"> + <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldServiceRemoteImpl"/> + </component> + + <component name="BHelloWorldServiceLocalAndRemoteNested"> + <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldServiceRemoteImpl" /> + </component> + + +</composite> diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/promotionService/META-INF/sca-contribution.xml b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/promotionService/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..e6ccae5c73 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/promotionService/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/200912" + xmlns:sample="http://sample"> + <deployable composite="sample:HelloWorld"/> +</contribution>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/simpleReference/HelloWorld.composite b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/simpleReference/HelloWorld.composite new file mode 100644 index 0000000000..f4d2789ff7 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/simpleReference/HelloWorld.composite @@ -0,0 +1,67 @@ +<?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" + targetNamespace="http://sample" + xmlns:sample="http://sample" + name="HelloWorld"> + + + <!-- local only wire --> + <component name="AHelloWorldClientLocal"> + <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldClientLocalImpl"/> + <reference name="helloWorldService" target="AHelloWorldServiceLocal" /> + </component> + + <component name="AHelloWorldServiceLocal"> + <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldServiceLocalImpl" /> + </component> + + <!-- unresolved remote wire --> + <component name="AHelloWorldClientRemote"> + <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldClientRemoteImpl" /> + <reference name="helloWorldService" target="BHelloWorldServiceRemote" /> + </component> + + <!-- local and remote wires --> + <component name="AHelloWorldClientLocalAndRemote"> + <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldClientRemoteImpl" /> + <reference name="helloWorldService" target="BHelloWorldServiceLocalAndRemote"/> + </component> + + <!-- multiple services --> + <component name="AHelloWorldClientMultipleServices"> + <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldClientRemoteImpl" /> + <reference name="helloWorldService" target="BHelloWorldServiceMultipleServices/HelloWorldServiceRemote"/> + </component> + + <component name="AHelloWorldClientMultipleServices2"> + <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldClientRemote2Impl" /> + <reference name="helloWorldService" target="BHelloWorldServiceMultipleServices/HelloWorldServiceRemote2"/> + </component> + + <!-- multiple bindings --> + <component name="AHelloWorldClientMultipleBindings"> + <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldClientRemoteImpl" /> + <reference name="helloWorldService" target="BHelloWorldMultipleBindings/HelloWorldServiceRemote/scaBinding"> + <interface.java interface="org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceRemote" /> + </reference> + </component> + +</composite> diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/simpleReference/META-INF/sca-contribution.xml b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/simpleReference/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..e6ccae5c73 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/simpleReference/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/200912" + xmlns:sample="http://sample"> + <deployable composite="sample:HelloWorld"/> +</contribution>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/simpleService/HelloWorld.composite b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/simpleService/HelloWorld.composite new file mode 100644 index 0000000000..7e6311a22d --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/simpleService/HelloWorld.composite @@ -0,0 +1,84 @@ +<?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" + targetNamespace="http://sample" + xmlns:sample="http://sample" + name="HelloWorld"> + + + <!-- local only wire --> + + + <!-- unresolved remote wire --> + <component name="BHelloWorldServiceRemote"> + <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldServiceRemoteImpl" /> + <service name="HelloWorldServiceRemote"> + <binding.sca uri="http://localhost:8085/BHelloWorldServiceRemote"/> + </service> + </component> + + <!-- local and remote wires --> + <component name="BHelloWorldServiceLocalAndRemote"> + <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldServiceRemoteImpl" /> + <service name="HelloWorldServiceRemote"> + <binding.sca uri="http://localhost:8085/BHelloWorldServiceLocalAndRemote"/> + </service> + </component> + + <component name="BHelloWorldClientLocalAndRemote"> + <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldClientRemoteImpl" /> + <reference name="helloWorldService" target="BHelloWorldServiceLocalAndRemote" /> + </component> + + <!-- multiple services --> + <component name="BHelloWorldServiceMultipleServices"> + <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldServiceMultipleServicesImpl" /> + <service name="HelloWorldServiceLocal"> + </service> + <service name="HelloWorldServiceRemote"> + <binding.sca uri="http://localhost:8085/BHelloWorldServiceMultipleServices/HelloWorldServiceRemote"/> + </service> + <service name="HelloWorldServiceRemote2"> + <binding.sca uri="http://localhost:8085/BHelloWorldServiceMultipleServices/HelloWorldServiceRemote2"/> + </service> + </component> + + <component name="BHelloWorldClientMultipleServices"> + <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldClientLocalImpl" /> + <reference name="helloWorldService" target="BHelloWorldServiceMultipleServices/HelloWorldServiceLocal" /> + </component> + + <!-- multiple bindings --> + <component name="BHelloWorldMultipleBindings"> + <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldServiceRemoteImpl" /> + <service name="HelloWorldServiceRemote"> + <interface.java interface="org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceRemote" /> + <binding.ws name="wsBinding" uri="http://localhost:8085/BHelloWorldMultipleBindings/HelloWorldServiceRemote-wsbinding"/> + <binding.sca name="scaBinding" uri="http://localhost:8085/BHelloWorldMultipleBindings/HelloWorldServiceRemote-scabinding"/> + </service> + </component> + + + <!-- Dynamic interfaces --> + <!--component name="BHelloWorldServiceScript"> + <implementation.script script="calculator/AddServiceImpl.js"/> + </component--> + +</composite> diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/simpleService/META-INF/sca-contribution.xml b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/simpleService/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..e6ccae5c73 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/simpleService/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/200912" + xmlns:sample="http://sample"> + <deployable composite="sample:HelloWorld"/> +</contribution>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/pom.xml b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/pom.xml new file mode 100644 index 0000000000..0cfb13dd46 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/pom.xml @@ -0,0 +1,70 @@ +<?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-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-nodes-binding-sca-tribes</artifactId>
+ <name>Apache Tuscany SCA iTest Nodes binding.sca Using Tribes Registry</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-client-impl</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-endpoint-tribes</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-rmi-runtime</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-jetty</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Client.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Client.java new file mode 100644 index 0000000000..ef2565b750 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Client.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 org.apache.tuscany.sca.itest.bindingsca; + +/** + * + */ +public interface Client { + String getName(String id); + + String create(String name); +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/ClientImpl.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/ClientImpl.java new file mode 100644 index 0000000000..96a0f2dadd --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/ClientImpl.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 org.apache.tuscany.sca.itest.bindingsca; + +import org.oasisopen.sca.annotation.Reference; +import org.oasisopen.sca.annotation.Service; + +/** + * + */ +@Service(Client.class) +public class ClientImpl implements Client { + @Reference + protected Local local; + + @Reference + protected Remote remote; + + public String getName(String id) { + Customer customer = null; + try { + customer = remote.getCustomer(id); + } catch (CustomerNotFoundException e) { + return null; + } + customer.dump("Client.getName()"); + return local.getName(customer); + } + + public String create(String name) { + String id = remote.generateId(); + Customer customer = remote.createCustomer(id, name); + customer.dump("Client.create()"); + return remote.getId(customer); + } +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Customer.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Customer.java new file mode 100644 index 0000000000..f2b7b1e41d --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Customer.java @@ -0,0 +1,70 @@ +/* + * 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.itest.bindingsca; + +/** + * + */ +public class Customer { + private String id; + private String name; + + public Customer() { + } + + /** + * @param id + * @param name + */ + public Customer(String id, String name) { + super(); + this.id = id; + this.name = name; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public String toString() { + return "Customer [id=" + id + ", name=" + name + "]"; + } + + public void dump(String prefix) { + System.out.print(prefix); + System.out.print(": "); + System.out.print(toString()); + System.out.println(" @" + System.identityHashCode(this)); + System.out.println(getClass().getClassLoader()); + } +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/CustomerNotFoundException.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/CustomerNotFoundException.java new file mode 100644 index 0000000000..a6e80c9eca --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/CustomerNotFoundException.java @@ -0,0 +1,64 @@ +/* + * 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.itest.bindingsca; + +/** + * + */ +public class CustomerNotFoundException extends Exception { + private String customerId; + + /** + * + */ + public CustomerNotFoundException() { + } + + /** + * @param message + */ + public CustomerNotFoundException(String message) { + super(message); + } + + /** + * @param cause + */ + public CustomerNotFoundException(Throwable cause) { + super(cause); + } + + /** + * @param message + * @param cause + */ + public CustomerNotFoundException(String message, Throwable cause) { + super(message, cause); + } + + public String getCustomerId() { + return customerId; + } + + public void setCustomerId(String customerId) { + this.customerId = customerId; + } + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Local.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Local.java new file mode 100644 index 0000000000..0fe30c9d53 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Local.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 org.apache.tuscany.sca.itest.bindingsca; + +/** + * + */ +public interface Local { + String getName(Customer customer); +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/LocalServiceImpl.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/LocalServiceImpl.java new file mode 100644 index 0000000000..8783808334 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/LocalServiceImpl.java @@ -0,0 +1,38 @@ +/* + * 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.itest.bindingsca; + +import org.oasisopen.sca.annotation.Service; + +/** + * + */ +@Service(Local.class) +public class LocalServiceImpl implements Local { + + public String getName(Customer customer) { + if (customer == null) { + return null; + } + customer.dump("Local.getName()"); + return customer.getName(); + } + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Remote.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Remote.java new file mode 100644 index 0000000000..050d35007b --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Remote.java @@ -0,0 +1,36 @@ +/* + * 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.itest.bindingsca; + +import org.oasisopen.sca.annotation.Remotable; + +/** + * + */ +@Remotable +public interface Remote { + String generateId(); + + String getId(Customer customer); + + Customer getCustomer(String id) throws CustomerNotFoundException; + + Customer createCustomer(String id, String name); +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/RemoteServiceImpl.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/RemoteServiceImpl.java new file mode 100644 index 0000000000..6c432a500a --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/RemoteServiceImpl.java @@ -0,0 +1,66 @@ +/* + * 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.itest.bindingsca; + +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +import org.oasisopen.sca.annotation.AllowsPassByReference; +import org.oasisopen.sca.annotation.Scope; +import org.oasisopen.sca.annotation.Service; + +/** + * + */ +@Service(Remote.class) +@Scope("COMPOSITE") +public class RemoteServiceImpl implements Remote { + private Map<String, Customer> customers = new HashMap<String, Customer>(); + + public String generateId() { + return UUID.randomUUID().toString(); + } + + @AllowsPassByReference + public String getId(Customer customer) { + customer.dump("Remote.getId()"); + return customer.getId(); + } + + public Customer getCustomer(String id) throws CustomerNotFoundException { + Customer customer = customers.get(id); + if (customer == null) { + CustomerNotFoundException ex = new CustomerNotFoundException("Customer not found"); + ex.setCustomerId(id); + throw ex; + } + customer.dump("Remote.getCustomer()"); + return customer; + } + + public Customer createCustomer(String id, String name) { + Customer customer = new Customer(id, name); + customer.dump("Remote.createCustomer()"); + customers.put(id, customer); + return customer; + } + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/SCAClientImpl.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/SCAClientImpl.java new file mode 100644 index 0000000000..3573eea978 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/SCAClientImpl.java @@ -0,0 +1,57 @@ +/* + * 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.itest.bindingsca; + +import java.net.URI; + +import org.oasisopen.sca.client.SCAClientFactory; + +/** + * + */ +public class SCAClientImpl implements Client { + private Local local; + private Remote remote; + + public SCAClientImpl(String domainURI) throws Exception { + SCAClientFactory factory = SCAClientFactory.newInstance(URI.create(domainURI)); + local = factory.getService(Local.class, "LocalComponent/Local"); + remote = factory.getService(Remote.class, "RemoteComponent/Remote"); + } + + public String getName(String id) { + Customer customer = null; + try { + customer = remote.getCustomer(id); + } catch (CustomerNotFoundException e) { + return null; + } + customer.dump("Client.getName()"); + return local.getName(customer); + } + + public String create(String name) { + String id = remote.generateId(); + Customer customer = remote.createCustomer(id, name); + customer.dump("Client.create()"); + return remote.getId(customer); + } + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/main/resources/org/apache/tuscany/sca/itest/bindingsca/Client.composite b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/main/resources/org/apache/tuscany/sca/itest/bindingsca/Client.composite new file mode 100644 index 0000000000..b04cc33023 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/main/resources/org/apache/tuscany/sca/itest/bindingsca/Client.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 + * 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" + targetNamespace="http://client" + name="Client"> + + <component name="ClientComponent"> + <implementation.java class="org.apache.tuscany.sca.itest.bindingsca.ClientImpl" /> + <reference name="local" target="LocalComponent" /> + <reference name="remote" target="RemoteComponent" /> + </component> + + +</composite>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/main/resources/org/apache/tuscany/sca/itest/bindingsca/Service.composite b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/main/resources/org/apache/tuscany/sca/itest/bindingsca/Service.composite new file mode 100644 index 0000000000..fe282d291c --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/main/resources/org/apache/tuscany/sca/itest/bindingsca/Service.composite @@ -0,0 +1,31 @@ +<?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 + * 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" + targetNamespace="http://service" + name="Service"> + + <component name="LocalComponent"> + <implementation.java class="org.apache.tuscany.sca.itest.bindingsca.LocalServiceImpl" /> + </component> + + <component name="RemoteComponent"> + <implementation.java class="org.apache.tuscany.sca.itest.bindingsca.RemoteServiceImpl" /> + </component> + +</composite>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/AsynchTestCase.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/AsynchTestCase.java new file mode 100644 index 0000000000..9efa1a99ec --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/AsynchTestCase.java @@ -0,0 +1,79 @@ +/* + * 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.binding.sca.axis2; + + +import junit.framework.Assert; + +import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldClient; +import org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldClientCallbackOnewayRemoteImpl; +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; + +// @Ignore("TUSCANY-3138") +public class AsynchTestCase { + + public static Node nodeA; + public static Node nodeB; + + @BeforeClass + public static void init() throws Exception { + System.out.println("Setting up nodes"); + + try { + // create and start nodes + Contribution contrib = new Contribution("asynch", "./target/test-classes/ws/asynchReference"); + nodeA = NodeFactory.getInstance().createNode("HelloWorld.composite", contrib); + nodeA.start(); + + contrib = new Contribution("asynch", "./target/test-classes/ws/asynchService"); + nodeB = NodeFactory.getInstance().createNode("HelloWorld.composite", contrib); + nodeB.start(); + + } catch (Exception ex) { + System.err.println("Exception when creating domain " + ex.getMessage()); + ex.printStackTrace(System.err); + throw ex; + } + } + + @AfterClass + public static void destroy() throws Exception { + nodeA.stop(); + nodeB.stop(); + } + + @Test + public void testHelloWorldAsynch() throws Exception { + HelloWorldClient helloWorldClientB; + helloWorldClientB = nodeA.getService(HelloWorldClient.class, "AHelloWorldClientCallbackRemote"); + helloWorldClientB.getGreetings("fred"); + System.out.println("Sleeping ..."); + Thread.sleep(2000); + System.out.println("... Done"); + Assert.assertEquals("callback fred", HelloWorldClientCallbackOnewayRemoteImpl.result ); + + } + + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/CallbackTestCase.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/CallbackTestCase.java new file mode 100644 index 0000000000..efa84e92a5 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/CallbackTestCase.java @@ -0,0 +1,83 @@ +/* + * 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.binding.sca.axis2; + +import junit.framework.Assert; + +import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldClient; +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; + +// @Ignore("TUSCANY-3138") +public class CallbackTestCase { + + public static Node nodeA; + public static Node nodeB; + + @BeforeClass + public static void init() throws Exception { + System.out.println("Setting up nodes"); + + try { + // create and start nodes + Contribution contrib = new Contribution("reference", "./target/test-classes/ws/callbackReference"); + nodeA = NodeFactory.getInstance().createNode("HelloWorld.composite", contrib); + nodeA.start(); + + contrib = new Contribution("service", "./target/test-classes/ws/callbackService"); + nodeB = NodeFactory.getInstance().createNode("HelloWorld.composite", contrib); + nodeB.start(); + + } catch (Exception ex) { + System.err.println("Exception when creating domain " + ex.getMessage()); + ex.printStackTrace(System.err); + throw ex; + } + } + + @AfterClass + public static void destroy() throws Exception { + nodeA.stop(); + nodeB.stop(); + } + + //@Test + public void testKeepServerRunning() throws Exception { + System.out.println("press enter to continue"); + System.in.read(); + } + + @Test + public void testHelloWorldCallbackLocal() throws Exception { + HelloWorldClient helloWorldClientB; + helloWorldClientB = nodeB.getService(HelloWorldClient.class, "BHelloWorldClientCallbackLocal"); + Assert.assertEquals("Hello callback fred", helloWorldClientB.getGreetings("fred")); + } + + @Test + public void testHelloWorldCallbackRemote() throws Exception { + HelloWorldClient helloWorldClientA; + helloWorldClientA = nodeA.getService(HelloWorldClient.class, "AHelloWorldClientCallbackRemote"); + Assert.assertEquals("Hello callback fred", helloWorldClientA.getGreetings("fred")); + } +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/PromotionTestCase.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/PromotionTestCase.java new file mode 100644 index 0000000000..45d28140b4 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/PromotionTestCase.java @@ -0,0 +1,74 @@ +/* + * 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.binding.sca.axis2; + +import junit.framework.Assert; + +import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldClient; +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.Ignore; +import org.junit.Test; + +public class PromotionTestCase { + + + public static Node nodeA; + public static Node nodeB; + + @BeforeClass + public static void init() throws Exception { + System.out.println("Setting up nodes"); + + try { + // create and start nodes + Contribution contrib = new Contribution("reference", "./target/test-classes/ws/promotionReference"); + nodeA = NodeFactory.getInstance().createNode("HelloWorld.composite", contrib); + nodeA.start(); + + contrib = new Contribution("service", "./target/test-classes/ws/promotionService"); + nodeB = NodeFactory.getInstance().createNode("HelloWorld.composite", contrib); + nodeB.start(); + + } catch (Exception ex) { + System.err.println("Exception when creating domain " + ex.getMessage()); + ex.printStackTrace(System.err); + throw ex; + } + } + + @AfterClass + public static void destroy() throws Exception { + nodeA.stop(); + nodeB.stop(); + } + + @Test + @Ignore + public void testHelloWorldPromotion() throws Exception { + HelloWorldClient helloWorldClientA; + helloWorldClientA = nodeA.getService(HelloWorldClient.class, "AHelloWorldClientRemotePromotion"); + Assert.assertEquals(helloWorldClientA.getGreetings("fred"), "Hello fred"); + + } + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/SimpleTestCase.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/SimpleTestCase.java new file mode 100644 index 0000000000..a5d6529895 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/SimpleTestCase.java @@ -0,0 +1,110 @@ +/* + * 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.binding.sca.axis2; + +import junit.framework.Assert; + +import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldClient; +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.ServiceUnavailableException; + +public class SimpleTestCase { + + public static Node nodeA; + public static Node nodeB; + + @BeforeClass + public static void init() throws Exception { + System.out.println("Setting up nodes"); + + try { + // create and start nodes + Contribution contrib = new Contribution("reference", "./target/test-classes/ws/simpleReference"); + nodeA = NodeFactory.getInstance().createNode("HelloWorld.composite", contrib); + nodeA.start(); + + contrib = new Contribution("service", "./target/test-classes/ws/simpleService"); + nodeB = NodeFactory.getInstance().createNode("HelloWorld.composite", contrib); + nodeB.start(); + + } catch (Exception ex) { + System.err.println("Exception when creating domain " + ex.getMessage()); + ex.printStackTrace(System.err); + throw ex; + } + } + + @AfterClass + public static void destroy() throws Exception { + nodeA.stop(); + nodeB.stop(); + } + + @Test + public void testHelloWorldLocal() throws Exception { + HelloWorldClient helloWorldClientA = nodeA.getService(HelloWorldClient.class, "AHelloWorldClientLocal"); + Assert.assertEquals(helloWorldClientA.getGreetings("fred"), "Hello fred"); + + } + + @Test + public void testHelloWorldRemote() throws Exception { + + HelloWorldClient helloWorldClientA; + helloWorldClientA = nodeA.getService(HelloWorldClient.class, "AHelloWorldClientRemote"); + + try { + helloWorldClientA.getGreetings("fred"); + } catch (ServiceUnavailableException ex){ + Assert.fail(); + } + } + + @Test + public void testHelloWorldLocalAndRemote() throws Exception { + HelloWorldClient helloWorldClientA = nodeA.getService(HelloWorldClient.class, "AHelloWorldClientLocalAndRemote"); + HelloWorldClient helloWorldClientB = nodeB.getService(HelloWorldClient.class, "BHelloWorldClientLocalAndRemote"); + Assert.assertEquals(helloWorldClientA.getGreetings("fred"), "Hello fred"); + Assert.assertEquals(helloWorldClientB.getGreetings("fred"), "Hello fred"); + } + + @Test + public void testHelloWorldMultipleServices() throws Exception { + HelloWorldClient helloWorldClientA = nodeA.getService(HelloWorldClient.class, "AHelloWorldClientMultipleServices"); + HelloWorldClient helloWorldClientA2 = nodeA.getService(HelloWorldClient.class, "AHelloWorldClientMultipleServices2"); + HelloWorldClient helloWorldClientB = nodeB.getService(HelloWorldClient.class, "BHelloWorldClientMultipleServices"); + Assert.assertEquals(helloWorldClientA.getGreetings("fred"), "Hello fred"); + Assert.assertEquals(helloWorldClientA2.getGreetings("fred"), "Hello fred"); + Assert.assertEquals(helloWorldClientB.getGreetings("fred"), "Hello fred"); + } + + @Test + public void testHelloWorldMultipleBindings() throws Exception { + HelloWorldClient helloWorldClientA; + helloWorldClientA = nodeA.getService(HelloWorldClient.class, "AHelloWorldClientMultipleBindings"); + Assert.assertEquals(helloWorldClientA.getGreetings("fred"), "Hello fred"); + + } + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldCallbackRemote.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldCallbackRemote.java new file mode 100644 index 0000000000..f7ab3dfe98 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldCallbackRemote.java @@ -0,0 +1,30 @@ +/* + * 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.binding.sca.axis2.helloworld; + +import org.oasisopen.sca.annotation.Remotable; + + +@Remotable +public interface HelloWorldCallbackRemote { + + String getGreetingsCallbackRemote(String s); + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldClient.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldClient.java new file mode 100644 index 0000000000..3d25d37708 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldClient.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 org.apache.tuscany.sca.binding.sca.axis2.helloworld; + + +public interface HelloWorldClient { + + String getGreetings(String s); + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceCallbackOnewayRemote.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceCallbackOnewayRemote.java new file mode 100644 index 0000000000..a469d197d6 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceCallbackOnewayRemote.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 org.apache.tuscany.sca.binding.sca.axis2.helloworld; + +import org.oasisopen.sca.annotation.Callback; +import org.oasisopen.sca.annotation.OneWay; +import org.oasisopen.sca.annotation.Remotable; + +@Remotable +@Callback(HelloWorldCallbackRemote.class) +public interface HelloWorldServiceCallbackOnewayRemote { + + @OneWay + void getGreetingsRemote(String s); + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceCallbackRemote.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceCallbackRemote.java new file mode 100644 index 0000000000..3f5a21fddd --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceCallbackRemote.java @@ -0,0 +1,31 @@ +/* + * 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.binding.sca.axis2.helloworld; + +import org.oasisopen.sca.annotation.Callback; +import org.oasisopen.sca.annotation.Remotable; + +@Remotable +@Callback(HelloWorldCallbackRemote.class) +public interface HelloWorldServiceCallbackRemote { + + String getGreetingsRemote(String s); + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceLocal.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceLocal.java new file mode 100644 index 0000000000..49e5232b31 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceLocal.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 org.apache.tuscany.sca.binding.sca.axis2.helloworld; + + +public interface HelloWorldServiceLocal { + + String getGreetingsLocal(String s); + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceRemote.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceRemote.java new file mode 100644 index 0000000000..ccc77c142b --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceRemote.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 org.apache.tuscany.sca.binding.sca.axis2.helloworld; + +import org.oasisopen.sca.annotation.Remotable; + +@Remotable +public interface HelloWorldServiceRemote { + + String getGreetingsRemote(String s); + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceRemote2.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceRemote2.java new file mode 100644 index 0000000000..c2be798d1a --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceRemote2.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 org.apache.tuscany.sca.binding.sca.axis2.helloworld; + +import org.oasisopen.sca.annotation.Remotable; + +@Remotable +public interface HelloWorldServiceRemote2 { + + String getGreetingsRemote2(String s); + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientCallbackOnewayRemoteImpl.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientCallbackOnewayRemoteImpl.java new file mode 100644 index 0000000000..9355aece1f --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientCallbackOnewayRemoteImpl.java @@ -0,0 +1,43 @@ +/* + * 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.binding.sca.axis2.helloworld.impl; + +import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldClient; +import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceCallbackOnewayRemote; +import org.oasisopen.sca.annotation.Reference; + +public class HelloWorldClientCallbackOnewayRemoteImpl implements HelloWorldClient { + + public static String result; + + @Reference + public HelloWorldServiceCallbackOnewayRemote helloWorldService; + + public String getGreetings(String s) { + helloWorldService.getGreetingsRemote(s); + return null; + } + + public String getGreetingsCallbackRemote(String s) { + result = "callback " + s; + return result; + } + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientCallbackRemoteImpl.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientCallbackRemoteImpl.java new file mode 100644 index 0000000000..efc47aa94d --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientCallbackRemoteImpl.java @@ -0,0 +1,42 @@ +/* + * 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.binding.sca.axis2.helloworld.impl; + +import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldClient; +import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceCallbackRemote; +import org.oasisopen.sca.annotation.Reference; + +public class HelloWorldClientCallbackRemoteImpl implements HelloWorldClient { + + public static String result; + + @Reference + public HelloWorldServiceCallbackRemote helloWorldService; + + public String getGreetings(String s) { + return helloWorldService.getGreetingsRemote(s); + } + + public String getGreetingsCallbackRemote(String s) { + result = "callback " + s; + return result; + } + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientLocalImpl.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientLocalImpl.java new file mode 100644 index 0000000000..6ed813ff0a --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientLocalImpl.java @@ -0,0 +1,35 @@ +/* + * 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.binding.sca.axis2.helloworld.impl; + +import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldClient; +import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceLocal; +import org.oasisopen.sca.annotation.Reference; + +public class HelloWorldClientLocalImpl implements HelloWorldClient { + + @Reference + public HelloWorldServiceLocal helloWorldService; + + public String getGreetings(String s) { + return helloWorldService.getGreetingsLocal(s); + } + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientRemote2Impl.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientRemote2Impl.java new file mode 100644 index 0000000000..ba70573efb --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientRemote2Impl.java @@ -0,0 +1,35 @@ +/* + * 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.binding.sca.axis2.helloworld.impl; + +import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldClient; +import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceRemote2; +import org.oasisopen.sca.annotation.Reference; + +public class HelloWorldClientRemote2Impl implements HelloWorldClient { + + @Reference + public HelloWorldServiceRemote2 helloWorldService; + + public String getGreetings(String s) { + return helloWorldService.getGreetingsRemote2(s); + } + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientRemoteImpl.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientRemoteImpl.java new file mode 100644 index 0000000000..a87d6eb49a --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientRemoteImpl.java @@ -0,0 +1,35 @@ +/* + * 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.binding.sca.axis2.helloworld.impl; + +import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldClient; +import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceRemote; +import org.oasisopen.sca.annotation.Reference; + +public class HelloWorldClientRemoteImpl implements HelloWorldClient { + + @Reference + public HelloWorldServiceRemote helloWorldService; + + public String getGreetings(String s) { + return helloWorldService.getGreetingsRemote(s); + } + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceCallbackOnewayRemoteImpl.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceCallbackOnewayRemoteImpl.java new file mode 100644 index 0000000000..3dc0b12b82 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceCallbackOnewayRemoteImpl.java @@ -0,0 +1,35 @@ +/* + * 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.binding.sca.axis2.helloworld.impl; + +import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldCallbackRemote; +import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceCallbackOnewayRemote; +import org.oasisopen.sca.annotation.Callback; + +public class HelloWorldServiceCallbackOnewayRemoteImpl implements HelloWorldServiceCallbackOnewayRemote { + + @Callback + protected HelloWorldCallbackRemote theCallback; + + public void getGreetingsRemote(String s) { + theCallback.getGreetingsCallbackRemote(s); + } + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceCallbackRemoteImpl.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceCallbackRemoteImpl.java new file mode 100644 index 0000000000..b15d6dea80 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceCallbackRemoteImpl.java @@ -0,0 +1,39 @@ +/* + * 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.binding.sca.axis2.helloworld.impl; + +import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldCallbackRemote; +import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceCallbackRemote; +import org.oasisopen.sca.annotation.Callback; + +public class HelloWorldServiceCallbackRemoteImpl implements HelloWorldServiceCallbackRemote { + + @Callback + protected HelloWorldCallbackRemote theCallback; + + public HelloWorldServiceCallbackRemoteImpl() { + System.out.println("Constructor"); + } + + public String getGreetingsRemote(String s) { + return "Hello " + theCallback.getGreetingsCallbackRemote(s); + } + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceLocalImpl.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceLocalImpl.java new file mode 100644 index 0000000000..c4347b084a --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceLocalImpl.java @@ -0,0 +1,30 @@ +/* + * 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.binding.sca.axis2.helloworld.impl; + +import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceLocal; + +public class HelloWorldServiceLocalImpl implements HelloWorldServiceLocal { + + public String getGreetingsLocal(String s) { + return "Hello " + s; + } + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceMultipleServicesImpl.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceMultipleServicesImpl.java new file mode 100644 index 0000000000..846bff02e1 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceMultipleServicesImpl.java @@ -0,0 +1,41 @@ +/* + * 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.binding.sca.axis2.helloworld.impl; + +import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceLocal; +import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceRemote; +import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceRemote2; +import org.oasisopen.sca.annotation.Service; + +@Service({HelloWorldServiceRemote.class, HelloWorldServiceRemote2.class, HelloWorldServiceLocal.class} ) +public class HelloWorldServiceMultipleServicesImpl implements HelloWorldServiceLocal, HelloWorldServiceRemote, HelloWorldServiceRemote2 { + + public String getGreetingsLocal(String s) { + return "Hello " + s; + } + + public String getGreetingsRemote(String s) { + return "Hello " + s; + } + + public String getGreetingsRemote2(String s) { + return "Hello " + s; + } +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceRemoteImpl.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceRemoteImpl.java new file mode 100644 index 0000000000..d69f442879 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceRemoteImpl.java @@ -0,0 +1,30 @@ +/* + * 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.binding.sca.axis2.helloworld.impl; + +import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceRemote; + +public class HelloWorldServiceRemoteImpl implements HelloWorldServiceRemote { + + public String getGreetingsRemote(String s) { + return "Hello " + s; + } + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/AsynchTestCase.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/AsynchTestCase.java new file mode 100644 index 0000000000..cbcc06056a --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/AsynchTestCase.java @@ -0,0 +1,79 @@ +/*
+ * 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.binding.sca.rmi;
+
+
+import junit.framework.Assert;
+
+import org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldClient;
+import org.apache.tuscany.sca.binding.sca.rmi.helloworld.impl.HelloWorldClientCallbackOnewayRemoteImpl;
+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;
+
+public class AsynchTestCase {
+
+ public static Node nodeA;
+ public static Node nodeB;
+
+ @BeforeClass
+ public static void init() throws Exception {
+ System.out.println("Setting up nodes");
+ // System.setProperty("org.apache.tuscany.sca.binding.sca.provider.SCABindingMapper.mappedBinding", RMIBinding.TYPE.toString());
+ try {
+ // create and start nodes
+ Contribution contrib = new Contribution("asynch", "./target/test-classes/rmi/asynchReference");
+ nodeA = NodeFactory.getInstance().createNode("HelloWorld.composite", contrib);
+ nodeA.start();
+
+ contrib = new Contribution("asynch", "./target/test-classes/rmi/asynchService");
+ nodeB = NodeFactory.getInstance().createNode("HelloWorld.composite", contrib);
+ nodeB.start();
+
+ } catch (Exception ex) {
+ System.err.println("Exception when creating domain " + ex.getMessage());
+ ex.printStackTrace(System.err);
+ throw ex;
+ }
+ }
+
+ @AfterClass
+ public static void destroy() throws Exception {
+ nodeA.stop();
+ nodeB.stop();
+ // System.clearProperty("org.apache.tuscany.sca.binding.sca.provider.SCABindingMapper.mappedBinding");
+ }
+
+ @Test
+ public void testHelloWorldAsynch() throws Exception {
+ HelloWorldClient helloWorldClientB;
+ helloWorldClientB = nodeA.getService(HelloWorldClient.class, "AHelloWorldClientCallbackRemote");
+ helloWorldClientB.getGreetings("fred");
+ System.out.println("Sleeping ...");
+ Thread.sleep(2000);
+ System.out.println("... Done");
+ Assert.assertEquals("callback fred", HelloWorldClientCallbackOnewayRemoteImpl.result );
+
+ }
+
+
+}
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/CallbackTestCase.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/CallbackTestCase.java new file mode 100644 index 0000000000..dccd2dace8 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/CallbackTestCase.java @@ -0,0 +1,84 @@ +/*
+ * 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.binding.sca.rmi;
+
+import junit.framework.Assert;
+
+import org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldClient;
+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;
+
+public class CallbackTestCase {
+
+ public static Node nodeA;
+ public static Node nodeB;
+
+ @BeforeClass
+ public static void init() throws Exception {
+ System.out.println("Setting up nodes");
+ // System.setProperty("org.apache.tuscany.sca.binding.sca.provider.SCABindingMapper.mappedBinding", RMIBinding.TYPE.toString());
+
+ try {
+ // create and start nodes
+ Contribution contrib = new Contribution("reference", "./target/test-classes/rmi/callbackReference");
+ nodeA = NodeFactory.getInstance().createNode("HelloWorld.composite", contrib);
+ nodeA.start();
+
+ contrib = new Contribution("service", "./target/test-classes/rmi/callbackService");
+ nodeB = NodeFactory.getInstance().createNode("HelloWorld.composite", contrib);
+ nodeB.start();
+
+ } catch (Exception ex) {
+ System.err.println("Exception when creating domain " + ex.getMessage());
+ ex.printStackTrace(System.err);
+ throw ex;
+ }
+ }
+
+ @AfterClass
+ public static void destroy() throws Exception {
+ nodeA.stop();
+ nodeB.stop();
+ // System.clearProperty("org.apache.tuscany.sca.binding.sca.provider.SCABindingMapper.mappedBinding");
+ }
+
+ //@Test
+ public void testKeepServerRunning() throws Exception {
+ System.out.println("press enter to continue");
+ System.in.read();
+ }
+
+ @Test
+ public void testHelloWorldCallbackLocal() throws Exception {
+ HelloWorldClient helloWorldClientB;
+ helloWorldClientB = nodeB.getService(HelloWorldClient.class, "BHelloWorldClientCallbackLocal");
+ Assert.assertEquals("Hello callback fred", helloWorldClientB.getGreetings("fred"));
+ }
+
+ @Test
+ public void testHelloWorldCallbackRemote() throws Exception {
+ HelloWorldClient helloWorldClientA;
+ helloWorldClientA = nodeA.getService(HelloWorldClient.class, "AHelloWorldClientCallbackRemote");
+ Assert.assertEquals("Hello callback fred", helloWorldClientA.getGreetings("fred"));
+ }
+}
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/PromotionTestCase.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/PromotionTestCase.java new file mode 100644 index 0000000000..7aac95a8ff --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/PromotionTestCase.java @@ -0,0 +1,76 @@ +/*
+ * 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.binding.sca.rmi;
+
+import junit.framework.Assert;
+
+import org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldClient;
+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;
+
+public class PromotionTestCase {
+
+
+ public static Node nodeA;
+ public static Node nodeB;
+
+ @BeforeClass
+ public static void init() throws Exception {
+ System.out.println("Setting up nodes");
+ System.setProperty("org.apache.tuscany.sca.binding.sca.provider.SCABindingMapper.mappedBinding",
+ "{http://tuscany.apache.org/xmlns/sca/1.1}binding.rmi");
+
+ try {
+ // create and start nodes
+ Contribution contrib = new Contribution("reference", "./target/test-classes/rmi/promotionReference");
+ nodeA = NodeFactory.getInstance().createNode("HelloWorld.composite", contrib);
+ nodeA.start();
+
+ contrib = new Contribution("service", "./target/test-classes/rmi/promotionService");
+ nodeB = NodeFactory.getInstance().createNode("HelloWorld.composite", contrib);
+ nodeB.start();
+
+ } catch (Exception ex) {
+ System.err.println("Exception when creating domain " + ex.getMessage());
+ ex.printStackTrace(System.err);
+ throw ex;
+ }
+ }
+
+ @AfterClass
+ public static void destroy() throws Exception {
+ nodeA.stop();
+ nodeB.stop();
+ System.clearProperty("org.apache.tuscany.sca.binding.sca.provider.SCABindingMapper.mappedBinding");
+
+ }
+
+ @Test
+ public void testHelloWorldPromotion() throws Exception {
+ HelloWorldClient helloWorldClientA;
+ helloWorldClientA = nodeA.getService(HelloWorldClient.class, "AHelloWorldClientRemotePromotion");
+ Assert.assertEquals(helloWorldClientA.getGreetings("fred"), "Hello fred");
+
+ }
+
+}
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/SimpleTestCase.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/SimpleTestCase.java new file mode 100644 index 0000000000..f748beb6cb --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/SimpleTestCase.java @@ -0,0 +1,116 @@ +/*
+ * 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.binding.sca.rmi;
+
+import junit.framework.Assert;
+
+import org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldClient;
+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.ServiceUnavailableException;
+
+public class SimpleTestCase {
+
+ private static NodeFactory factory;
+ public static Node nodeA;
+ public static Node nodeB;
+
+ @BeforeClass
+ public static void init() throws Exception {
+ System.out.println("Setting up nodes");
+ System.setProperty("org.apache.tuscany.sca.binding.sca.provider.SCABindingMapper.mappedBinding",
+ "{http://tuscany.apache.org/xmlns/sca/1.1}binding.rmi");
+
+ try {
+ factory = NodeFactory.getInstance();
+ // create and start nodes
+ Contribution contrib = new Contribution("reference", "./target/test-classes/rmi/simpleReference");
+ nodeA = factory.createNode("HelloWorld.composite", contrib);
+ nodeA.start();
+
+ contrib = new Contribution("service", "./target/test-classes/rmi/simpleService");
+ nodeB = factory.createNode("HelloWorld.composite", contrib);
+ nodeB.start();
+
+ } catch (Exception ex) {
+ System.err.println("Exception when creating domain " + ex.getMessage());
+ ex.printStackTrace(System.err);
+ throw ex;
+ }
+ }
+
+ @AfterClass
+ public static void destroy() throws Exception {
+ nodeA.stop();
+ nodeB.stop();
+ factory.destroy();
+ System.clearProperty("org.apache.tuscany.sca.binding.sca.provider.SCABindingMapper.mappedBinding");
+ }
+
+ @Test
+ public void testHelloWorldLocal() throws Exception {
+ HelloWorldClient helloWorldClientA = nodeA.getService(HelloWorldClient.class, "AHelloWorldClientLocal");
+ Assert.assertEquals(helloWorldClientA.getGreetings("fred"), "Hello fred");
+
+ }
+
+ @Test
+ public void testHelloWorldRemote() throws Exception {
+
+ HelloWorldClient helloWorldClientA;
+ helloWorldClientA = nodeA.getService(HelloWorldClient.class, "AHelloWorldClientRemote");
+
+ try {
+ helloWorldClientA.getGreetings("fred");
+ } catch (ServiceUnavailableException ex){
+ Assert.fail();
+ }
+ }
+
+ @Test
+ public void testHelloWorldLocalAndRemote() throws Exception {
+ HelloWorldClient helloWorldClientA = nodeA.getService(HelloWorldClient.class, "AHelloWorldClientLocalAndRemote");
+ HelloWorldClient helloWorldClientB = nodeB.getService(HelloWorldClient.class, "BHelloWorldClientLocalAndRemote");
+ Assert.assertEquals(helloWorldClientA.getGreetings("fred"), "Hello fred");
+ Assert.assertEquals(helloWorldClientB.getGreetings("fred"), "Hello fred");
+ }
+
+ @Test
+ public void testHelloWorldMultipleServices() throws Exception {
+ HelloWorldClient helloWorldClientA = nodeA.getService(HelloWorldClient.class, "AHelloWorldClientMultipleServices");
+ HelloWorldClient helloWorldClientA2 = nodeA.getService(HelloWorldClient.class, "AHelloWorldClientMultipleServices2");
+ HelloWorldClient helloWorldClientB = nodeB.getService(HelloWorldClient.class, "BHelloWorldClientMultipleServices");
+ Assert.assertEquals(helloWorldClientA.getGreetings("fred"), "Hello fred");
+ Assert.assertEquals(helloWorldClientA2.getGreetings("fred"), "Hello fred");
+ Assert.assertEquals(helloWorldClientB.getGreetings("fred"), "Hello fred");
+ }
+
+ @Test
+ public void testHelloWorldMultipleBindings() throws Exception {
+ HelloWorldClient helloWorldClientA;
+ helloWorldClientA = nodeA.getService(HelloWorldClient.class, "AHelloWorldClientMultipleBindings");
+ Assert.assertEquals(helloWorldClientA.getGreetings("fred"), "Hello fred");
+
+ }
+
+}
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldCallbackRemote.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldCallbackRemote.java new file mode 100644 index 0000000000..7c4cf4b0b7 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldCallbackRemote.java @@ -0,0 +1,30 @@ +/*
+ * 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.binding.sca.rmi.helloworld;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+
+@Remotable
+public interface HelloWorldCallbackRemote {
+
+ String getGreetingsCallbackRemote(String s);
+
+}
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldClient.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldClient.java new file mode 100644 index 0000000000..017acee582 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldClient.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 org.apache.tuscany.sca.binding.sca.rmi.helloworld;
+
+
+public interface HelloWorldClient {
+
+ String getGreetings(String s);
+
+}
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceCallbackOnewayRemote.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceCallbackOnewayRemote.java new file mode 100644 index 0000000000..86f984e61a --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceCallbackOnewayRemote.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 org.apache.tuscany.sca.binding.sca.rmi.helloworld;
+
+import org.oasisopen.sca.annotation.Callback;
+import org.oasisopen.sca.annotation.OneWay;
+import org.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+@Callback(HelloWorldCallbackRemote.class)
+public interface HelloWorldServiceCallbackOnewayRemote {
+
+ @OneWay
+ void getGreetingsRemote(String s);
+
+}
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceCallbackRemote.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceCallbackRemote.java new file mode 100644 index 0000000000..8e19fd7382 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceCallbackRemote.java @@ -0,0 +1,31 @@ +/*
+ * 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.binding.sca.rmi.helloworld;
+
+import org.oasisopen.sca.annotation.Callback;
+import org.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+@Callback(HelloWorldCallbackRemote.class)
+public interface HelloWorldServiceCallbackRemote {
+
+ String getGreetingsRemote(String s);
+
+}
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceLocal.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceLocal.java new file mode 100644 index 0000000000..b0d623e2e4 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceLocal.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 org.apache.tuscany.sca.binding.sca.rmi.helloworld;
+
+
+public interface HelloWorldServiceLocal {
+
+ String getGreetingsLocal(String s);
+
+}
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceRemote.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceRemote.java new file mode 100644 index 0000000000..ccb44694d9 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceRemote.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 org.apache.tuscany.sca.binding.sca.rmi.helloworld;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+public interface HelloWorldServiceRemote {
+
+ String getGreetingsRemote(String s);
+
+}
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceRemote2.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceRemote2.java new file mode 100644 index 0000000000..5c8bb13f43 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceRemote2.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 org.apache.tuscany.sca.binding.sca.rmi.helloworld;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+public interface HelloWorldServiceRemote2 {
+
+ String getGreetingsRemote2(String s);
+
+}
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientCallbackOnewayRemoteImpl.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientCallbackOnewayRemoteImpl.java new file mode 100644 index 0000000000..1ff1792bb7 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientCallbackOnewayRemoteImpl.java @@ -0,0 +1,43 @@ +/*
+ * 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.binding.sca.rmi.helloworld.impl;
+
+import org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldClient;
+import org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldServiceCallbackOnewayRemote;
+import org.oasisopen.sca.annotation.Reference;
+
+public class HelloWorldClientCallbackOnewayRemoteImpl implements HelloWorldClient {
+
+ public static String result;
+
+ @Reference
+ public HelloWorldServiceCallbackOnewayRemote helloWorldService;
+
+ public String getGreetings(String s) {
+ helloWorldService.getGreetingsRemote(s);
+ return null;
+ }
+
+ public String getGreetingsCallbackRemote(String s) {
+ result = "callback " + s;
+ return result;
+ }
+
+}
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientCallbackRemoteImpl.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientCallbackRemoteImpl.java new file mode 100644 index 0000000000..b17d8e2016 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientCallbackRemoteImpl.java @@ -0,0 +1,42 @@ +/*
+ * 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.binding.sca.rmi.helloworld.impl;
+
+import org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldClient;
+import org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldServiceCallbackRemote;
+import org.oasisopen.sca.annotation.Reference;
+
+public class HelloWorldClientCallbackRemoteImpl implements HelloWorldClient {
+
+ public static String result;
+
+ @Reference
+ public HelloWorldServiceCallbackRemote helloWorldService;
+
+ public String getGreetings(String s) {
+ return helloWorldService.getGreetingsRemote(s);
+ }
+
+ public String getGreetingsCallbackRemote(String s) {
+ result = "callback " + s;
+ return result;
+ }
+
+}
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientLocalImpl.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientLocalImpl.java new file mode 100644 index 0000000000..e230326f5f --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientLocalImpl.java @@ -0,0 +1,35 @@ +/*
+ * 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.binding.sca.rmi.helloworld.impl;
+
+import org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldClient;
+import org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldServiceLocal;
+import org.oasisopen.sca.annotation.Reference;
+
+public class HelloWorldClientLocalImpl implements HelloWorldClient {
+
+ @Reference
+ public HelloWorldServiceLocal helloWorldService;
+
+ public String getGreetings(String s) {
+ return helloWorldService.getGreetingsLocal(s);
+ }
+
+}
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientRemote2Impl.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientRemote2Impl.java new file mode 100644 index 0000000000..77df8c2c39 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientRemote2Impl.java @@ -0,0 +1,35 @@ +/*
+ * 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.binding.sca.rmi.helloworld.impl;
+
+import org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldClient;
+import org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldServiceRemote2;
+import org.oasisopen.sca.annotation.Reference;
+
+public class HelloWorldClientRemote2Impl implements HelloWorldClient {
+
+ @Reference
+ public HelloWorldServiceRemote2 helloWorldService;
+
+ public String getGreetings(String s) {
+ return helloWorldService.getGreetingsRemote2(s);
+ }
+
+}
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientRemoteImpl.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientRemoteImpl.java new file mode 100644 index 0000000000..8effa3ac36 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientRemoteImpl.java @@ -0,0 +1,35 @@ +/*
+ * 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.binding.sca.rmi.helloworld.impl;
+
+import org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldClient;
+import org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldServiceRemote;
+import org.oasisopen.sca.annotation.Reference;
+
+public class HelloWorldClientRemoteImpl implements HelloWorldClient {
+
+ @Reference
+ public HelloWorldServiceRemote helloWorldService;
+
+ public String getGreetings(String s) {
+ return helloWorldService.getGreetingsRemote(s);
+ }
+
+}
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceCallbackOnewayRemoteImpl.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceCallbackOnewayRemoteImpl.java new file mode 100644 index 0000000000..2467ddab88 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceCallbackOnewayRemoteImpl.java @@ -0,0 +1,35 @@ +/*
+ * 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.binding.sca.rmi.helloworld.impl;
+
+import org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldCallbackRemote;
+import org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldServiceCallbackOnewayRemote;
+import org.oasisopen.sca.annotation.Callback;
+
+public class HelloWorldServiceCallbackOnewayRemoteImpl implements HelloWorldServiceCallbackOnewayRemote {
+
+ @Callback
+ protected HelloWorldCallbackRemote theCallback;
+
+ public void getGreetingsRemote(String s) {
+ theCallback.getGreetingsCallbackRemote(s);
+ }
+
+}
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceCallbackRemoteImpl.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceCallbackRemoteImpl.java new file mode 100644 index 0000000000..d1b75d0a2c --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceCallbackRemoteImpl.java @@ -0,0 +1,39 @@ +/*
+ * 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.binding.sca.rmi.helloworld.impl;
+
+import org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldCallbackRemote;
+import org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldServiceCallbackRemote;
+import org.oasisopen.sca.annotation.Callback;
+
+public class HelloWorldServiceCallbackRemoteImpl implements HelloWorldServiceCallbackRemote {
+
+ @Callback
+ protected HelloWorldCallbackRemote theCallback;
+
+ public HelloWorldServiceCallbackRemoteImpl() {
+ System.out.println("Constructor");
+ }
+
+ public String getGreetingsRemote(String s) {
+ return "Hello " + theCallback.getGreetingsCallbackRemote(s);
+ }
+
+}
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceLocalImpl.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceLocalImpl.java new file mode 100644 index 0000000000..44e7efc668 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceLocalImpl.java @@ -0,0 +1,30 @@ +/*
+ * 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.binding.sca.rmi.helloworld.impl;
+
+import org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldServiceLocal;
+
+public class HelloWorldServiceLocalImpl implements HelloWorldServiceLocal {
+
+ public String getGreetingsLocal(String s) {
+ return "Hello " + s;
+ }
+
+}
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceMultipleServicesImpl.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceMultipleServicesImpl.java new file mode 100644 index 0000000000..88440de023 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceMultipleServicesImpl.java @@ -0,0 +1,41 @@ +/*
+ * 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.binding.sca.rmi.helloworld.impl;
+
+import org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldServiceLocal;
+import org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldServiceRemote;
+import org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldServiceRemote2;
+import org.oasisopen.sca.annotation.Service;
+
+@Service({HelloWorldServiceRemote.class, HelloWorldServiceRemote2.class, HelloWorldServiceLocal.class} )
+public class HelloWorldServiceMultipleServicesImpl implements HelloWorldServiceLocal, HelloWorldServiceRemote, HelloWorldServiceRemote2 {
+
+ public String getGreetingsLocal(String s) {
+ return "Hello " + s;
+ }
+
+ public String getGreetingsRemote(String s) {
+ return "Hello " + s;
+ }
+
+ public String getGreetingsRemote2(String s) {
+ return "Hello " + s;
+ }
+}
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceRemoteImpl.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceRemoteImpl.java new file mode 100644 index 0000000000..06dc2c3f79 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceRemoteImpl.java @@ -0,0 +1,30 @@ +/*
+ * 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.binding.sca.rmi.helloworld.impl;
+
+import org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldServiceRemote;
+
+public class HelloWorldServiceRemoteImpl implements HelloWorldServiceRemote {
+
+ public String getGreetingsRemote(String s) {
+ return "Hello " + s;
+ }
+
+}
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/BindingSCATestCase.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/BindingSCATestCase.java new file mode 100644 index 0000000000..05a8c3455c --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/BindingSCATestCase.java @@ -0,0 +1,170 @@ +/* + * 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.itest.bindingsca; + +import java.io.File; + +import org.apache.tuscany.sca.assembly.SCABinding; +import org.apache.tuscany.sca.binding.ws.WebServiceBinding; +import org.apache.tuscany.sca.node.Node; +import org.apache.tuscany.sca.node.NodeFactory; +import org.apache.tuscany.sca.node.configuration.NodeConfiguration; +import org.junit.Assert; +import org.junit.Test; +import org.oasisopen.sca.ServiceRuntimeException; + +/** + * Test binding.sca in the same classloader + */ +public class BindingSCATestCase { + static final String DOMAIN_URI = "my-domain"; + private static final String REGISTRY_URI = "tribes://228.0.0.100:50000"; + private static final String PKG = "org/apache/tuscany/sca/itest/bindingsca/"; + private static final String CLIENT = "Client.composite"; + private static final String SERVICE = "Service.composite"; + private static final String ROOT = new File("target/classes/" + PKG).toURI().toString(); + + /** + * One NodeFactory and two nodes + */ + @Test + public void testOneFactoryTwoNodes() { + NodeFactory factory1 = NodeFactory.getInstance(); + Node node1 = createClientNode(factory1); + Node node2 = createServiceNode(factory1); + node1.start(); + node2.start(); + try { + runClient(node1); + } finally { + node2.stop(); + node1.stop(); + factory1.destroy(); + } + } + + /** + * Create the service node + * @param factory + * @return + */ + static Node createServiceNode(NodeFactory factory) { + NodeConfiguration config2 = + factory.createNodeConfiguration().setDomainURI(DOMAIN_URI).setURI("node2").addContribution("c2", ROOT) + .addDeploymentComposite("c2", SERVICE).setDomainRegistryURI(REGISTRY_URI) + .addBinding(WebServiceBinding.TYPE, "http://localhost:8085/").addBinding(SCABinding.TYPE, + "http://localhost:8085/"); + + Node node2 = factory.createNode(config2); + return node2; + } + + /** + * Create the client node + * @param factory + * @return + */ + static Node createClientNode(NodeFactory factory) { + NodeConfiguration config1 = + factory.createNodeConfiguration().setDomainURI(DOMAIN_URI).setURI("node1").addContribution("c1", ROOT) + .addDeploymentComposite("c1", CLIENT).setDomainRegistryURI(REGISTRY_URI) + .addBinding(WebServiceBinding.TYPE, "http://localhost:8085/").addBinding(SCABinding.TYPE, + "http://localhost:8085/"); + Node node1 = factory.createNode(config1); + return node1; + } + + /** + * Two node factories and two nodes + */ + @Test + public void testTwoFactoriesTwoNodes() throws Exception { + NodeFactory factory1 = NodeFactory.newInstance(); + Node node1 = createClientNode(factory1); + NodeFactory factory2 = NodeFactory.newInstance(); + Node node2 = createServiceNode(factory2); + node1.start(); + node2.start(); + Thread.sleep(1000); + try { + // This call doesn't require the Local service, it should be successful + createCustomer(node1); + try { + runClient(node1); + // We cannot make local call to remote endpoints + Assert.fail("ServiceRuntimeException should have been thrown."); + } catch (ServiceRuntimeException e) { + // ignore + } + } finally { + node2.stop(); + node1.stop(); + factory2.destroy(); + factory1.destroy(); + } + } + + /** + * Run the client + * @param node + */ + static void runClient(Node node) { + Client client = node.getService(Client.class, "ClientComponent/Client"); + runClient(client); + } + + static void runClient(Client client) { + String id = client.create("Ray"); + Assert.assertEquals("Ray", client.getName(id)); + } + + static void runClientNotFound(Client client) { + String id = "not-there"; + Assert.assertNull(client.getName(id)); + } + + static String createCustomer(Node node) { + Client client = node.getService(Client.class, "ClientComponent/Client"); + String id = client.create("John"); + Assert.assertNotNull(id); + return id; + } + + /** + * One node factory and one node for both composites + */ + @Test + public void testOneFactoryOneNode() { + NodeFactory factory = NodeFactory.getInstance(); + NodeConfiguration config1 = + factory.createNodeConfiguration().setDomainURI(DOMAIN_URI).setURI("node1").addContribution("c1", ROOT) + .addDeploymentComposite("c1", CLIENT).addDeploymentComposite("c1", SERVICE); + + Node node1 = factory.createNode(config1); + node1.start(); + try { + runClient(node1); + } finally { + node1.stop(); + factory.destroy(); + } + } + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientNodeSharedCustomerTestCase.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientNodeSharedCustomerTestCase.java new file mode 100644 index 0000000000..7255697d4b --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientNodeSharedCustomerTestCase.java @@ -0,0 +1,62 @@ +/* + * 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.itest.bindingsca; + +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; + +/** + * Running the client node and service node with two different classloaders that share the Customer class + */ +public class ClientNodeSharedCustomerTestCase { + private static Node clientNode; + private static TestCaseRunner runner; + private static NodeFactory factory; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + runner = new TestCaseRunner(ServiceNode.class, Remote.class.getName(), RemoteServiceImpl.class.getName()); + runner.beforeClass(); + factory = NodeFactory.getInstance(); + clientNode = BindingSCATestCase.createClientNode(factory).start(); + Thread.sleep(1000); + } + + @Test + public void testClient() throws Exception { + BindingSCATestCase.runClient(clientNode); + } + + @AfterClass + public static void tearDownAfterClass() throws Exception { + if (clientNode != null) { + clientNode.stop(); + } + if (runner != null) { + runner.afterClass(); + } + if (factory != null) { + factory.destroy(); + } + } +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientNodeSharedLocalTestCase.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientNodeSharedLocalTestCase.java new file mode 100644 index 0000000000..51fafae32c --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientNodeSharedLocalTestCase.java @@ -0,0 +1,62 @@ +/* + * 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.itest.bindingsca; + +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; + +/** + * Running the client node and service node with two different classloaders that share the Local class + * (but not Customer) + */ +public class ClientNodeSharedLocalTestCase { + private static Node clientNode; + private static TestCaseRunner runner; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + runner = + new TestCaseRunner(ServiceNode.class, Remote.class.getName(), RemoteServiceImpl.class.getName(), + Customer.class.getName()); + runner.beforeClass(); + NodeFactory factory = NodeFactory.getInstance(); + clientNode = BindingSCATestCase.createClientNode(factory).start(); + Thread.sleep(1000); + } + + @Test + public void testClient() throws Exception { + BindingSCATestCase.runClient(clientNode); + } + + @AfterClass + public static void tearDownAfterClass() throws Exception { + if (clientNode != null) { + clientNode.stop(); + } + if (runner != null) { + runner.afterClass(); + } + NodeFactory.getInstance().destroy(); + } +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientSharedCustomerTestCase.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientSharedCustomerTestCase.java new file mode 100644 index 0000000000..b8ff0c58ba --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientSharedCustomerTestCase.java @@ -0,0 +1,54 @@ +/* + * 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.itest.bindingsca; + +import org.apache.tuscany.sca.node.NodeFactory; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +/** + * Running the client api and service node with two different classloaders that share the Customer class + */ +public class ClientSharedCustomerTestCase { + private static Client client; + private static TestCaseRunner runner; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + runner = new TestCaseRunner(ServiceNode.class, Remote.class.getName(), RemoteServiceImpl.class.getName()); + runner.beforeClass(); + client = new SCAClientImpl(BindingSCATestCase.DOMAIN_URI); + Thread.sleep(1000); + } + + @Test + public void testClient() throws Exception { + BindingSCATestCase.runClient(client); + } + + @AfterClass + public static void tearDownAfterClass() throws Exception { + if (runner != null) { + runner.afterClass(); + } + NodeFactory.getInstance().destroy(); + } +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientSharedLocalTestCase.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientSharedLocalTestCase.java new file mode 100644 index 0000000000..633e1a767c --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientSharedLocalTestCase.java @@ -0,0 +1,63 @@ +/* + * 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.itest.bindingsca; + +import org.apache.tuscany.sca.node.NodeFactory; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +/** + * Running the client api and service node with two different classloaders that share the Local class + * (but not Customer) + */ +public class ClientSharedLocalTestCase { + private static Client client; + private static TestCaseRunner runner; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + runner = + new TestCaseRunner(ServiceNode.class, Remote.class.getName(), RemoteServiceImpl.class.getName(), + Customer.class.getName(), CustomerNotFoundException.class.getName()); + runner.beforeClass(); + client = new SCAClientImpl(BindingSCATestCase.DOMAIN_URI); + Thread.sleep(1000); + } + + @Test + public void testClient() throws Exception { + BindingSCATestCase.runClient(client); + } + + @Test + public void testClientNotFound() throws Exception { + BindingSCATestCase.runClientNotFound(client); + } + + + @AfterClass + public static void tearDownAfterClass() throws Exception { + if (runner != null) { + runner.afterClass(); + } + NodeFactory.getInstance().destroy(); + } +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ServiceNode.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ServiceNode.java new file mode 100644 index 0000000000..1cba2b57c2 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ServiceNode.java @@ -0,0 +1,48 @@ +/* + * 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.itest.bindingsca; + +import org.apache.tuscany.sca.node.Node; +import org.apache.tuscany.sca.node.NodeFactory; +import org.junit.AfterClass; +import org.junit.BeforeClass; + +/** + * This shows how to test the Calculator service component. + */ +public class ServiceNode { + private static Node serviceNode; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + /* System.setProperty("org.apache.tuscany.sca.contribution.processor.ValidationSchemaExtensionPoint.enabled", + "false"); + */ + NodeFactory factory = NodeFactory.getInstance(); + serviceNode = BindingSCATestCase.createServiceNode(factory).start(); + } + + @AfterClass + public static void tearDownAfterClass() throws Exception { + if (serviceNode != null) { + serviceNode.stop(); + } + } +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/TestCaseRunner.java b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/TestCaseRunner.java new file mode 100644 index 0000000000..c0960ffe95 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/TestCaseRunner.java @@ -0,0 +1,329 @@ +/* + * 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.itest.bindingsca; + +import java.lang.annotation.Annotation; +import java.lang.reflect.Constructor; +import java.lang.reflect.Method; +import java.net.URL; +import java.net.URLClassLoader; +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** + * A helper class that can be used to run an SCA JUnit test case. The test case will run in an isolated class loader. + * + * @version $Rev$ $Date$ + */ +public class TestCaseRunner { + + private ClassLoader classLoader; + private Class<?> testSuiteClass; + private Object testSuite; + private Class<?> testResultClass; + private Class<?> testCaseClass; + private Object testCase; + + private Class<?> beforeAnnotation; + private Class<?> beforeClassAnnotation; + private Class<?> afterAnnotation; + private Class<?> afterClassAnnotation; + private Class<?> junit4AdapterClass; + private Class<?> junit3TestCaseClass; + + /** + * Constructs a new TestCase runner. + * + * @param testClass + */ + public TestCaseRunner(Class<?> testClass, String... isolatedClasses) { + try { + ClassLoader tccl = setupClassLoader(testClass, isolatedClasses); + + try { + // Thread.currentThread().setContextClassLoader(classLoader); + // Allow privileged access to set class loader. Requires RuntimePermission + // setContextClassLoader in security policy. + final ClassLoader finalClassLoader = classLoader; + AccessController.doPrivileged(new PrivilegedAction<Object>() { + public Object run() { + Thread.currentThread().setContextClassLoader(finalClassLoader); + return null; + } + }); + + testCaseClass = Class.forName(testClass.getName(), true, classLoader); + testCase = testCaseClass.newInstance(); + ClassLoader testClassLoader = testCaseClass.getClassLoader(); + + junit3TestCaseClass = Class.forName("junit.framework.TestCase", true, testClassLoader); + + testSuiteClass = Class.forName("junit.framework.TestSuite", true, testClassLoader); + Constructor<?> testSuiteConstructor = testSuiteClass.getConstructor(Class.class); + testSuite = testSuiteConstructor.newInstance(testCaseClass); + + testResultClass = Class.forName("junit.framework.TestResult", true, testClassLoader); + + try { + beforeAnnotation = Class.forName("org.junit.Before", true, testClassLoader); + afterAnnotation = Class.forName("org.junit.After", true, testClassLoader); + beforeClassAnnotation = Class.forName("org.junit.BeforeClass", true, testClassLoader); + afterClassAnnotation = Class.forName("org.junit.AfterClass", true, testClassLoader); + junit4AdapterClass = Class.forName("junit.framework.JUnit4TestAdapter", true, testClassLoader); + } catch (Exception e) { + // Unexpected + throw new AssertionError(e); + } + } catch (Throwable e) { + e.printStackTrace(); + } finally { + // Thread.currentThread().setContextClassLoader(tccl); + // Allow privileged access to set class loader. Requires RuntimePermission + // setContextClassLoader in security policy. + final ClassLoader finaltccl = tccl; + AccessController.doPrivileged(new PrivilegedAction<Object>() { + public Object run() { + Thread.currentThread().setContextClassLoader(finaltccl); + return null; + } + }); + } + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + private ClassLoader setupClassLoader(Class<?> testClass, String... isolatedClasses) { + ClassLoader tccl = Thread.currentThread().getContextClassLoader(); + classLoader = testClass.getClassLoader(); + if (classLoader instanceof URLClassLoader) { + URL[] urls = ((URLClassLoader)classLoader).getURLs(); + classLoader = new ClassLoaderImpl(urls, classLoader, isolatedClasses); + } else if (classLoader == tccl || classLoader.getParent() == tccl) { + classLoader = new URLClassLoader(new URL[0], classLoader); + } else { + classLoader = tccl; + } + return tccl; + } + + /** + * Run the test case + */ + public void run() { + ClassLoader tccl = Thread.currentThread().getContextClassLoader(); + try { + // Thread.currentThread().setContextClassLoader(classLoader); + // Allow privileged access to set class loader. Requires RuntimePermission + // setContextClassLoader in security policy. + final ClassLoader finalClassLoader = classLoader; + AccessController.doPrivileged(new PrivilegedAction<Object>() { + public Object run() { + Thread.currentThread().setContextClassLoader(finalClassLoader); + return null; + } + }); + + if (junit3TestCaseClass.isAssignableFrom(testCaseClass)) { + Object testResult = testResultClass.newInstance(); + Method runMethod = testSuiteClass.getMethod("run", testResultClass); + runMethod.invoke(testSuite, testResult); + } else { + Object junit4Adapter = junit4AdapterClass.getConstructor(Class.class).newInstance(testCaseClass); + Object testResult = testResultClass.newInstance(); + Method runMethod = junit4AdapterClass.getMethod("run", testResultClass); + runMethod.invoke(junit4Adapter, testResult); + } + } catch (Exception e) { + throw new RuntimeException(e); + } finally { + // Thread.currentThread().setContextClassLoader(tccl); + // Allow privileged access to set class loader. Requires RuntimePermission + // setContextClassLoader in security policy. + final ClassLoader finaltccl = tccl; + AccessController.doPrivileged(new PrivilegedAction<Object>() { + public Object run() { + Thread.currentThread().setContextClassLoader(finaltccl); + return null; + } + }); + } + } + + /** + * Invoke the setUp method + */ + public void setUp() { + execute("setUp"); + } + + /** + * Invoke the before methods + */ + public void before() { + execute(beforeAnnotation); + } + + /** + * Invoke the beforeClass methods + */ + public void beforeClass() { + execute(beforeClassAnnotation); + } + + /** + * Invoke the tearDown method + */ + public void tearDown() { + execute("tearDown"); + } + + /** + * Invoke the after methods + */ + public void after() { + execute(afterAnnotation); + } + + /** + * Invoke the afterClass methods + */ + public void afterClass() { + execute(afterClassAnnotation); + } + + /** + * Invoke the specified test method. + */ + public void run(String methodName) { + execute(methodName); + } + + /** + * Invoke the methods annotated with the specified annotation. + */ + private void execute(Class<?> annotationClass) { + if (annotationClass == null) { + throw new RuntimeException(new NoSuchMethodException()); + } + ClassLoader tccl = Thread.currentThread().getContextClassLoader(); + try { + // Thread.currentThread().setContextClassLoader(classLoader); + // Allow privileged access to set class loader. Requires RuntimePermission + // setContextClassLoader in security policy. + final ClassLoader finalClassLoader = classLoader; + AccessController.doPrivileged(new PrivilegedAction<Object>() { + public Object run() { + Thread.currentThread().setContextClassLoader(finalClassLoader); + return null; + } + }); + + for (Method method : testCaseClass.getDeclaredMethods()) { + for (Annotation annotation : method.getAnnotations()) { + if (annotation.annotationType() == annotationClass) { + method.invoke(testCase); + } + } + } + } catch (Exception e) { + throw new RuntimeException(e); + } finally { + // Thread.currentThread().setContextClassLoader(tccl); + // Allow privileged access to set class loader. Requires RuntimePermission + // setContextClassLoader in security policy. + final ClassLoader finaltccl = tccl; + AccessController.doPrivileged(new PrivilegedAction<Object>() { + public Object run() { + Thread.currentThread().setContextClassLoader(finaltccl); + return null; + } + }); + } + } + + /** + * Invoke the specified method + */ + private void execute(String methodName) { + ClassLoader tccl = Thread.currentThread().getContextClassLoader(); + try { + // Thread.currentThread().setContextClassLoader(classLoader); + // Allow privileged access to set class loader. Requires RuntimePermission + // setContextClassLoader in security policy. + final ClassLoader finalClassLoader = classLoader; + AccessController.doPrivileged(new PrivilegedAction<Object>() { + public Object run() { + Thread.currentThread().setContextClassLoader(finalClassLoader); + return null; + } + }); + Method setUpMethod = testCaseClass.getDeclaredMethod(methodName); + setUpMethod.setAccessible(true); + setUpMethod.invoke(testCase); + } catch (Exception e) { + throw new RuntimeException(e); + } finally { + // Thread.currentThread().setContextClassLoader(tccl); + // Allow privileged access to set class loader. Requires RuntimePermission + // setContextClassLoader in security policy. + final ClassLoader finaltccl = tccl; + AccessController.doPrivileged(new PrivilegedAction<Object>() { + public Object run() { + Thread.currentThread().setContextClassLoader(finaltccl); + return null; + } + }); + } + } + + public static class ClassLoaderImpl extends URLClassLoader { + private Set<String> isolatedClasses = new HashSet<String>(); + + /** + * @param urls + * @param parent + */ + public ClassLoaderImpl(URL[] urls, ClassLoader parent, String... sharedClasses) { + super(urls, parent); + this.isolatedClasses.addAll(Arrays.asList(sharedClasses)); + } + + @Override + protected synchronized Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException { + if (!isolatedClasses.contains(name)) { + return super.loadClass(name, resolve); + } else { + Class<?> cls = findLoadedClass(name); + if (cls == null) { + cls = findClass(name); + } + if (resolve) { + resolveClass(cls); + } + return cls; + } + } + + } + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/asynchReference/HelloWorld.composite b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/asynchReference/HelloWorld.composite new file mode 100644 index 0000000000..8c825ca805 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/asynchReference/HelloWorld.composite @@ -0,0 +1,36 @@ +<?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"
+ targetNamespace="http://sample"
+ xmlns:sample="http://sample"
+ name="HelloWorld">
+
+ <!-- callback remote wire -->
+ <component name="AHelloWorldClientCallbackRemote">
+ <implementation.java class="org.apache.tuscany.sca.binding.sca.rmi.helloworld.impl.HelloWorldClientCallbackOnewayRemoteImpl" />
+ <reference name="helloWorldService" target="BHelloWorldServiceCallbackRemote">
+ <binding.sca/>
+ <callback>
+ <binding.sca uri="http://localhost:8084/AHelloWorldClientCallbackRemote"/>
+ </callback>
+ </reference>
+ </component>
+
+</composite>
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/asynchReference/META-INF/sca-contribution.xml b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/asynchReference/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..ab75f7d225 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/asynchReference/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/200912"
+ xmlns:sample="http://sample">
+ <deployable composite="sample:HelloWorld"/>
+</contribution>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/asynchService/HelloWorld.composite b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/asynchService/HelloWorld.composite new file mode 100644 index 0000000000..79b1a5d794 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/asynchService/HelloWorld.composite @@ -0,0 +1,38 @@ +<?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"
+ targetNamespace="http://sample"
+ xmlns:sample="http://sample"
+ name="HelloWorld">
+
+
+ <!-- callback remote wire -->
+ <component name="BHelloWorldServiceCallbackRemote">
+ <implementation.java class="org.apache.tuscany.sca.binding.sca.rmi.helloworld.impl.HelloWorldServiceCallbackOnewayRemoteImpl" />
+ <service name="HelloWorldServiceCallbackOnewayRemote">
+ <binding.sca uri="http://localhost:8085/BHelloWorldServiceCallbackRemote"/>
+ <callback>
+ <binding.sca/>
+ </callback>
+ </service>
+ </component>
+
+
+</composite>
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/asynchService/META-INF/sca-contribution.xml b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/asynchService/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..ab75f7d225 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/asynchService/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/200912"
+ xmlns:sample="http://sample">
+ <deployable composite="sample:HelloWorld"/>
+</contribution>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/callbackReference/HelloWorld.composite b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/callbackReference/HelloWorld.composite new file mode 100644 index 0000000000..e8924d2728 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/callbackReference/HelloWorld.composite @@ -0,0 +1,36 @@ +<?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"
+ targetNamespace="http://sample"
+ xmlns:sample="http://sample"
+ name="HelloWorld">
+
+ <!-- callback remote wire -->
+ <component name="AHelloWorldClientCallbackRemote">
+ <implementation.java class="org.apache.tuscany.sca.binding.sca.rmi.helloworld.impl.HelloWorldClientCallbackRemoteImpl" />
+ <reference name="helloWorldService" target="BHelloWorldServiceCallbackRemote">
+ <binding.sca/>
+ <callback>
+ <binding.sca uri="http://localhost:8084/AHelloWorldClientCallbackRemote"/>
+ </callback>
+ </reference>
+ </component>
+
+</composite>
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/callbackReference/META-INF/sca-contribution.xml b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/callbackReference/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..ab75f7d225 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/callbackReference/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/200912"
+ xmlns:sample="http://sample">
+ <deployable composite="sample:HelloWorld"/>
+</contribution>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/callbackService/HelloWorld.composite b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/callbackService/HelloWorld.composite new file mode 100644 index 0000000000..4edc8df5cd --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/callbackService/HelloWorld.composite @@ -0,0 +1,43 @@ +<?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"
+ targetNamespace="http://sample"
+ xmlns:sample="http://sample"
+ name="HelloWorld">
+
+
+ <!-- callback remote wire -->
+ <component name="BHelloWorldServiceCallbackRemote">
+ <implementation.java class="org.apache.tuscany.sca.binding.sca.rmi.helloworld.impl.HelloWorldServiceCallbackRemoteImpl" />
+ <service name="HelloWorldServiceCallbackRemote">
+ <binding.sca uri="http://localhost:8085/BHelloWorldServiceCallbackRemote"/>
+ <callback>
+ <binding.sca/>
+ </callback>
+ </service>
+ </component>
+
+ <!-- callback local wire -->
+ <component name="BHelloWorldClientCallbackLocal">
+ <implementation.java class="org.apache.tuscany.sca.binding.sca.rmi.helloworld.impl.HelloWorldClientCallbackRemoteImpl" />
+ <reference name="helloWorldService" target="BHelloWorldServiceCallbackRemote" />
+ </component>
+
+</composite>
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/callbackService/META-INF/sca-contribution.xml b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/callbackService/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..ab75f7d225 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/callbackService/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/200912"
+ xmlns:sample="http://sample">
+ <deployable composite="sample:HelloWorld"/>
+</contribution>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/promotionReference/HelloWorld.composite b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/promotionReference/HelloWorld.composite new file mode 100644 index 0000000000..823cab4f56 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/promotionReference/HelloWorld.composite @@ -0,0 +1,33 @@ +<?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"
+ targetNamespace="http://sample"
+ xmlns:sample="http://sample"
+ name="HelloWorld">
+
+
+ <!-- composite hierarchy -->
+ <component name="AHelloWorldClientRemotePromotion">
+ <implementation.composite name="sample:HelloWorldComponent" />
+ <reference name="AHelloWorldClientRemoteReference" target="BHelloWorldServiceRemotePromotion"/>
+ </component>
+
+
+</composite>
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/promotionReference/HelloWorldComponent.composite b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/promotionReference/HelloWorldComponent.composite new file mode 100644 index 0000000000..54fb359ba0 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/promotionReference/HelloWorldComponent.composite @@ -0,0 +1,37 @@ +<?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"
+ targetNamespace="http://sample"
+ xmlns:sample="http://sample"
+ name="HelloWorldComponent">
+
+ <service name="AHelloWorldClientRemoteService" promote="AHelloWorldClientRemoteComponent">
+ <interface.java interface="org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldClient"/>
+ </service>
+
+ <reference name="AHelloWorldClientRemoteReference" promote="AHelloWorldClientRemoteComponent/helloWorldService" multiplicity="1..1">
+ <interface.java interface="org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldServiceRemote"/>
+ </reference>
+
+ <component name="AHelloWorldClientRemoteComponent">
+ <implementation.java class="org.apache.tuscany.sca.binding.sca.rmi.helloworld.impl.HelloWorldClientRemoteImpl"/>
+ </component>
+
+</composite>
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/promotionReference/META-INF/sca-contribution.xml b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/promotionReference/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..ab75f7d225 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/promotionReference/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/200912"
+ xmlns:sample="http://sample">
+ <deployable composite="sample:HelloWorld"/>
+</contribution>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/promotionService/HelloWorld.composite b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/promotionService/HelloWorld.composite new file mode 100644 index 0000000000..454e9c55cf --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/promotionService/HelloWorld.composite @@ -0,0 +1,35 @@ +<?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"
+ targetNamespace="http://sample"
+ xmlns:sample="http://sample"
+ name="HelloWorld">
+
+
+ <!-- composite hierarchy -->
+ <component name="BHelloWorldServiceRemotePromotion">
+ <implementation.composite name="sample:HelloWorldComponent" />
+ <service name="BHelloWorldServiceRemoteService">
+ <binding.sca uri="http://localhost:8085/BHelloWorldServiceRemotePromotion"/>
+ </service>
+ </component>
+
+
+</composite>
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/promotionService/HelloWorldComponent.composite b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/promotionService/HelloWorldComponent.composite new file mode 100644 index 0000000000..a313fb8f68 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/promotionService/HelloWorldComponent.composite @@ -0,0 +1,37 @@ +<?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"
+ targetNamespace="http://sample"
+ xmlns:sample="http://sample"
+ name="HelloWorldComponent">
+
+ <service name="BHelloWorldServiceRemoteService"
+ promote="BHelloWorldServiceRemoteComponent/HelloWorldServiceRemote"/>
+
+ <component name="BHelloWorldServiceRemoteComponent">
+ <implementation.java class="org.apache.tuscany.sca.binding.sca.rmi.helloworld.impl.HelloWorldServiceRemoteImpl"/>
+ </component>
+
+ <component name="BHelloWorldServiceLocalAndRemoteNested">
+ <implementation.java class="org.apache.tuscany.sca.binding.sca.rmi.helloworld.impl.HelloWorldServiceRemoteImpl" />
+ </component>
+
+
+</composite>
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/promotionService/META-INF/sca-contribution.xml b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/promotionService/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..ab75f7d225 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/promotionService/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/200912"
+ xmlns:sample="http://sample">
+ <deployable composite="sample:HelloWorld"/>
+</contribution>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/simpleReference/HelloWorld.composite b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/simpleReference/HelloWorld.composite new file mode 100644 index 0000000000..4151749523 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/simpleReference/HelloWorld.composite @@ -0,0 +1,67 @@ +<?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"
+ targetNamespace="http://sample"
+ xmlns:sample="http://sample"
+ name="HelloWorld">
+
+
+ <!-- local only wire -->
+ <component name="AHelloWorldClientLocal">
+ <implementation.java class="org.apache.tuscany.sca.binding.sca.rmi.helloworld.impl.HelloWorldClientLocalImpl"/>
+ <reference name="helloWorldService" target="AHelloWorldServiceLocal" />
+ </component>
+
+ <component name="AHelloWorldServiceLocal">
+ <implementation.java class="org.apache.tuscany.sca.binding.sca.rmi.helloworld.impl.HelloWorldServiceLocalImpl" />
+ </component>
+
+ <!-- unresolved remote wire -->
+ <component name="AHelloWorldClientRemote">
+ <implementation.java class="org.apache.tuscany.sca.binding.sca.rmi.helloworld.impl.HelloWorldClientRemoteImpl" />
+ <reference name="helloWorldService" target="BHelloWorldServiceRemote" />
+ </component>
+
+ <!-- local and remote wires -->
+ <component name="AHelloWorldClientLocalAndRemote">
+ <implementation.java class="org.apache.tuscany.sca.binding.sca.rmi.helloworld.impl.HelloWorldClientRemoteImpl" />
+ <reference name="helloWorldService" target="BHelloWorldServiceLocalAndRemote"/>
+ </component>
+
+ <!-- multiple services -->
+ <component name="AHelloWorldClientMultipleServices">
+ <implementation.java class="org.apache.tuscany.sca.binding.sca.rmi.helloworld.impl.HelloWorldClientRemoteImpl" />
+ <reference name="helloWorldService" target="BHelloWorldServiceMultipleServices/HelloWorldServiceRemote"/>
+ </component>
+
+ <component name="AHelloWorldClientMultipleServices2">
+ <implementation.java class="org.apache.tuscany.sca.binding.sca.rmi.helloworld.impl.HelloWorldClientRemote2Impl" />
+ <reference name="helloWorldService" target="BHelloWorldServiceMultipleServices/HelloWorldServiceRemote2"/>
+ </component>
+
+ <!-- multiple bindings -->
+ <component name="AHelloWorldClientMultipleBindings">
+ <implementation.java class="org.apache.tuscany.sca.binding.sca.rmi.helloworld.impl.HelloWorldClientRemoteImpl" />
+ <reference name="helloWorldService" target="BHelloWorldMultipleBindings/HelloWorldServiceRemote/scaBinding">
+ <interface.java interface="org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldServiceRemote" />
+ </reference>
+ </component>
+
+</composite>
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/simpleReference/META-INF/sca-contribution.xml b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/simpleReference/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..ab75f7d225 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/simpleReference/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/200912"
+ xmlns:sample="http://sample">
+ <deployable composite="sample:HelloWorld"/>
+</contribution>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/simpleService/HelloWorld.composite b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/simpleService/HelloWorld.composite new file mode 100644 index 0000000000..37af7625ff --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/simpleService/HelloWorld.composite @@ -0,0 +1,85 @@ +<?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"
+ xmlns:sample="http://sample"
+ name="HelloWorld">
+
+
+ <!-- local only wire -->
+
+
+ <!-- unresolved remote wire -->
+ <component name="BHelloWorldServiceRemote">
+ <implementation.java class="org.apache.tuscany.sca.binding.sca.rmi.helloworld.impl.HelloWorldServiceRemoteImpl" />
+ <service name="HelloWorldServiceRemote">
+ <binding.sca uri="http://localhost:8085/BHelloWorldServiceRemote"/>
+ </service>
+ </component>
+
+ <!-- local and remote wires -->
+ <component name="BHelloWorldServiceLocalAndRemote">
+ <implementation.java class="org.apache.tuscany.sca.binding.sca.rmi.helloworld.impl.HelloWorldServiceRemoteImpl" />
+ <service name="HelloWorldServiceRemote">
+ <binding.sca uri="http://localhost:8085/BHelloWorldServiceLocalAndRemote"/>
+ </service>
+ </component>
+
+ <component name="BHelloWorldClientLocalAndRemote">
+ <implementation.java class="org.apache.tuscany.sca.binding.sca.rmi.helloworld.impl.HelloWorldClientRemoteImpl" />
+ <reference name="helloWorldService" target="BHelloWorldServiceLocalAndRemote" />
+ </component>
+
+ <!-- multiple services -->
+ <component name="BHelloWorldServiceMultipleServices">
+ <implementation.java class="org.apache.tuscany.sca.binding.sca.rmi.helloworld.impl.HelloWorldServiceMultipleServicesImpl" />
+ <service name="HelloWorldServiceLocal">
+ </service>
+ <service name="HelloWorldServiceRemote">
+ <binding.sca uri="http://localhost:8085/BHelloWorldServiceMultipleServices/HelloWorldServiceRemote"/>
+ </service>
+ <service name="HelloWorldServiceRemote2">
+ <binding.sca uri="http://localhost:8085/BHelloWorldServiceMultipleServices/HelloWorldServiceRemote2"/>
+ </service>
+ </component>
+
+ <component name="BHelloWorldClientMultipleServices">
+ <implementation.java class="org.apache.tuscany.sca.binding.sca.rmi.helloworld.impl.HelloWorldClientLocalImpl" />
+ <reference name="helloWorldService" target="BHelloWorldServiceMultipleServices/HelloWorldServiceLocal" />
+ </component>
+
+ <!-- multiple bindings -->
+ <component name="BHelloWorldMultipleBindings">
+ <implementation.java class="org.apache.tuscany.sca.binding.sca.rmi.helloworld.impl.HelloWorldServiceRemoteImpl" />
+ <service name="HelloWorldServiceRemote">
+ <interface.java interface="org.apache.tuscany.sca.binding.sca.rmi.helloworld.HelloWorldServiceRemote" />
+ <!-- tuscany:binding.rmi name="rmiBinding" uri="http://localhost:8085/BHelloWorldMultipleBindings/HelloWorldServiceRemote-wsbinding"/ -->
+ <binding.sca name="scaBinding" uri="http://localhost:8085/BHelloWorldMultipleBindings/HelloWorldServiceRemote-scabinding"/>
+ </service>
+ </component>
+
+
+ <!-- Dynamic interfaces -->
+ <!--component name="BHelloWorldServiceScript">
+ <implementation.script script="calculator/AddServiceImpl.js"/>
+ </component-->
+
+</composite>
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/simpleService/META-INF/sca-contribution.xml b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/simpleService/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..ab75f7d225 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/simpleService/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/200912"
+ xmlns:sample="http://sample">
+ <deployable composite="sample:HelloWorld"/>
+</contribution>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/asynchReference/HelloWorld.composite b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/asynchReference/HelloWorld.composite new file mode 100644 index 0000000000..e797a0aa9c --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/asynchReference/HelloWorld.composite @@ -0,0 +1,36 @@ +<?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" + targetNamespace="http://sample" + xmlns:sample="http://sample" + name="HelloWorld"> + + <!-- callback remote wire --> + <component name="AHelloWorldClientCallbackRemote"> + <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldClientCallbackOnewayRemoteImpl" /> + <reference name="helloWorldService" target="BHelloWorldServiceCallbackRemote"> + <binding.sca/> + <callback> + <binding.sca uri="http://localhost:8084/AHelloWorldClientCallbackRemote"/> + </callback> + </reference> + </component> + +</composite> diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/asynchReference/META-INF/sca-contribution.xml b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/asynchReference/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..e6ccae5c73 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/asynchReference/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/200912" + xmlns:sample="http://sample"> + <deployable composite="sample:HelloWorld"/> +</contribution>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/asynchService/HelloWorld.composite b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/asynchService/HelloWorld.composite new file mode 100644 index 0000000000..079ee49380 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/asynchService/HelloWorld.composite @@ -0,0 +1,38 @@ +<?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" + targetNamespace="http://sample" + xmlns:sample="http://sample" + name="HelloWorld"> + + + <!-- callback remote wire --> + <component name="BHelloWorldServiceCallbackRemote"> + <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldServiceCallbackOnewayRemoteImpl" /> + <service name="HelloWorldServiceCallbackOnewayRemote"> + <binding.sca uri="http://localhost:8085/BHelloWorldServiceCallbackRemote"/> + <callback> + <binding.sca/> + </callback> + </service> + </component> + + +</composite> diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/asynchService/META-INF/sca-contribution.xml b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/asynchService/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..e6ccae5c73 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/asynchService/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/200912" + xmlns:sample="http://sample"> + <deployable composite="sample:HelloWorld"/> +</contribution>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/callbackReference/HelloWorld.composite b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/callbackReference/HelloWorld.composite new file mode 100644 index 0000000000..1d5630f3d0 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/callbackReference/HelloWorld.composite @@ -0,0 +1,36 @@ +<?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" + targetNamespace="http://sample" + xmlns:sample="http://sample" + name="HelloWorld"> + + <!-- callback remote wire --> + <component name="AHelloWorldClientCallbackRemote"> + <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldClientCallbackRemoteImpl" /> + <reference name="helloWorldService" target="BHelloWorldServiceCallbackRemote"> + <binding.sca/> + <callback> + <binding.sca uri="http://localhost:8084/AHelloWorldClientCallbackRemote"/> + </callback> + </reference> + </component> + +</composite> diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/callbackReference/META-INF/sca-contribution.xml b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/callbackReference/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..e6ccae5c73 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/callbackReference/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/200912" + xmlns:sample="http://sample"> + <deployable composite="sample:HelloWorld"/> +</contribution>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/callbackService/HelloWorld.composite b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/callbackService/HelloWorld.composite new file mode 100644 index 0000000000..ded3766d49 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/callbackService/HelloWorld.composite @@ -0,0 +1,43 @@ +<?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" + targetNamespace="http://sample" + xmlns:sample="http://sample" + name="HelloWorld"> + + + <!-- callback remote wire --> + <component name="BHelloWorldServiceCallbackRemote"> + <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldServiceCallbackRemoteImpl" /> + <service name="HelloWorldServiceCallbackRemote"> + <binding.sca uri="http://localhost:8085/BHelloWorldServiceCallbackRemote"/> + <callback> + <binding.sca/> + </callback> + </service> + </component> + + <!-- callback local wire --> + <component name="BHelloWorldClientCallbackLocal"> + <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldClientCallbackRemoteImpl" /> + <reference name="helloWorldService" target="BHelloWorldServiceCallbackRemote" /> + </component> + +</composite> diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/callbackService/META-INF/sca-contribution.xml b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/callbackService/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..e6ccae5c73 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/callbackService/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/200912" + xmlns:sample="http://sample"> + <deployable composite="sample:HelloWorld"/> +</contribution>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/promotionReference/HelloWorld.composite b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/promotionReference/HelloWorld.composite new file mode 100644 index 0000000000..4513f21acf --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/promotionReference/HelloWorld.composite @@ -0,0 +1,33 @@ +<?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" + targetNamespace="http://sample" + xmlns:sample="http://sample" + name="HelloWorld"> + + + <!-- composite hierarchy --> + <component name="AHelloWorldClientRemotePromotion"> + <implementation.composite name="sample:HelloWorldComponent" /> + <reference name="AHelloWorldClientRemoteReference" target="BHelloWorldServiceRemotePromotion"/> + </component> + + +</composite> diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/promotionReference/HelloWorldComponent.composite b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/promotionReference/HelloWorldComponent.composite new file mode 100644 index 0000000000..22c20ff94a --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/promotionReference/HelloWorldComponent.composite @@ -0,0 +1,37 @@ +<?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" + targetNamespace="http://sample" + xmlns:sample="http://sample" + name="HelloWorldComponent"> + + <service name="AHelloWorldClientRemoteService" promote="AHelloWorldClientRemoteComponent"> + <interface.java interface="org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldClient"/> + </service> + + <reference name="AHelloWorldClientRemoteReference" promote="AHelloWorldClientRemoteComponent/helloWorldService" multiplicity="1..1"> + <interface.java interface="org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceRemote"/> + </reference> + + <component name="AHelloWorldClientRemoteComponent"> + <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldClientRemoteImpl"/> + </component> + +</composite> diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/promotionReference/META-INF/sca-contribution.xml b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/promotionReference/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..e6ccae5c73 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/promotionReference/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/200912" + xmlns:sample="http://sample"> + <deployable composite="sample:HelloWorld"/> +</contribution>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/promotionService/HelloWorld.composite b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/promotionService/HelloWorld.composite new file mode 100644 index 0000000000..e6a7d776c9 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/promotionService/HelloWorld.composite @@ -0,0 +1,35 @@ +<?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" + targetNamespace="http://sample" + xmlns:sample="http://sample" + name="HelloWorld"> + + + <!-- composite hierarchy --> + <component name="BHelloWorldServiceRemotePromotion"> + <implementation.composite name="sample:HelloWorldComponent" /> + <service name="BHelloWorldServiceRemoteService"> + <binding.sca uri="http://localhost:8085/BHelloWorldServiceRemotePromotion"/> + </service> + </component> + + +</composite> diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/promotionService/HelloWorldComponent.composite b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/promotionService/HelloWorldComponent.composite new file mode 100644 index 0000000000..0393280625 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/promotionService/HelloWorldComponent.composite @@ -0,0 +1,37 @@ +<?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" + targetNamespace="http://sample" + xmlns:sample="http://sample" + name="HelloWorldComponent"> + + <service name="BHelloWorldServiceRemoteService" + promote="BHelloWorldServiceRemoteComponent/HelloWorldServiceRemote"/> + + <component name="BHelloWorldServiceRemoteComponent"> + <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldServiceRemoteImpl"/> + </component> + + <component name="BHelloWorldServiceLocalAndRemoteNested"> + <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldServiceRemoteImpl" /> + </component> + + +</composite> diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/promotionService/META-INF/sca-contribution.xml b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/promotionService/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..e6ccae5c73 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/promotionService/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/200912" + xmlns:sample="http://sample"> + <deployable composite="sample:HelloWorld"/> +</contribution>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/simpleReference/HelloWorld.composite b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/simpleReference/HelloWorld.composite new file mode 100644 index 0000000000..f4d2789ff7 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/simpleReference/HelloWorld.composite @@ -0,0 +1,67 @@ +<?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" + targetNamespace="http://sample" + xmlns:sample="http://sample" + name="HelloWorld"> + + + <!-- local only wire --> + <component name="AHelloWorldClientLocal"> + <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldClientLocalImpl"/> + <reference name="helloWorldService" target="AHelloWorldServiceLocal" /> + </component> + + <component name="AHelloWorldServiceLocal"> + <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldServiceLocalImpl" /> + </component> + + <!-- unresolved remote wire --> + <component name="AHelloWorldClientRemote"> + <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldClientRemoteImpl" /> + <reference name="helloWorldService" target="BHelloWorldServiceRemote" /> + </component> + + <!-- local and remote wires --> + <component name="AHelloWorldClientLocalAndRemote"> + <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldClientRemoteImpl" /> + <reference name="helloWorldService" target="BHelloWorldServiceLocalAndRemote"/> + </component> + + <!-- multiple services --> + <component name="AHelloWorldClientMultipleServices"> + <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldClientRemoteImpl" /> + <reference name="helloWorldService" target="BHelloWorldServiceMultipleServices/HelloWorldServiceRemote"/> + </component> + + <component name="AHelloWorldClientMultipleServices2"> + <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldClientRemote2Impl" /> + <reference name="helloWorldService" target="BHelloWorldServiceMultipleServices/HelloWorldServiceRemote2"/> + </component> + + <!-- multiple bindings --> + <component name="AHelloWorldClientMultipleBindings"> + <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldClientRemoteImpl" /> + <reference name="helloWorldService" target="BHelloWorldMultipleBindings/HelloWorldServiceRemote/scaBinding"> + <interface.java interface="org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceRemote" /> + </reference> + </component> + +</composite> diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/simpleReference/META-INF/sca-contribution.xml b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/simpleReference/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..e6ccae5c73 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/simpleReference/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/200912" + xmlns:sample="http://sample"> + <deployable composite="sample:HelloWorld"/> +</contribution>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/simpleService/HelloWorld.composite b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/simpleService/HelloWorld.composite new file mode 100644 index 0000000000..7e6311a22d --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/simpleService/HelloWorld.composite @@ -0,0 +1,84 @@ +<?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" + targetNamespace="http://sample" + xmlns:sample="http://sample" + name="HelloWorld"> + + + <!-- local only wire --> + + + <!-- unresolved remote wire --> + <component name="BHelloWorldServiceRemote"> + <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldServiceRemoteImpl" /> + <service name="HelloWorldServiceRemote"> + <binding.sca uri="http://localhost:8085/BHelloWorldServiceRemote"/> + </service> + </component> + + <!-- local and remote wires --> + <component name="BHelloWorldServiceLocalAndRemote"> + <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldServiceRemoteImpl" /> + <service name="HelloWorldServiceRemote"> + <binding.sca uri="http://localhost:8085/BHelloWorldServiceLocalAndRemote"/> + </service> + </component> + + <component name="BHelloWorldClientLocalAndRemote"> + <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldClientRemoteImpl" /> + <reference name="helloWorldService" target="BHelloWorldServiceLocalAndRemote" /> + </component> + + <!-- multiple services --> + <component name="BHelloWorldServiceMultipleServices"> + <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldServiceMultipleServicesImpl" /> + <service name="HelloWorldServiceLocal"> + </service> + <service name="HelloWorldServiceRemote"> + <binding.sca uri="http://localhost:8085/BHelloWorldServiceMultipleServices/HelloWorldServiceRemote"/> + </service> + <service name="HelloWorldServiceRemote2"> + <binding.sca uri="http://localhost:8085/BHelloWorldServiceMultipleServices/HelloWorldServiceRemote2"/> + </service> + </component> + + <component name="BHelloWorldClientMultipleServices"> + <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldClientLocalImpl" /> + <reference name="helloWorldService" target="BHelloWorldServiceMultipleServices/HelloWorldServiceLocal" /> + </component> + + <!-- multiple bindings --> + <component name="BHelloWorldMultipleBindings"> + <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldServiceRemoteImpl" /> + <service name="HelloWorldServiceRemote"> + <interface.java interface="org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceRemote" /> + <binding.ws name="wsBinding" uri="http://localhost:8085/BHelloWorldMultipleBindings/HelloWorldServiceRemote-wsbinding"/> + <binding.sca name="scaBinding" uri="http://localhost:8085/BHelloWorldMultipleBindings/HelloWorldServiceRemote-scabinding"/> + </service> + </component> + + + <!-- Dynamic interfaces --> + <!--component name="BHelloWorldServiceScript"> + <implementation.script script="calculator/AddServiceImpl.js"/> + </component--> + +</composite> diff --git a/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/simpleService/META-INF/sca-contribution.xml b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/simpleService/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..e6ccae5c73 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/simpleService/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/200912" + xmlns:sample="http://sample"> + <deployable composite="sample:HelloWorld"/> +</contribution>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/helloworld-client/pom.xml b/sca-java-2.x/trunk/testing/itest/nodes/helloworld-client/pom.xml new file mode 100644 index 0000000000..8367550f5a --- /dev/null +++ b/sca-java-2.x/trunk/testing/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-SNAPSHOT</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-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-sca-api</artifactId> + <version>2.0-SNAPSHOT</version> + <scope>provided</scope> + </dependency> + </dependencies> +</project> diff --git a/sca-java-2.x/trunk/testing/itest/nodes/helloworld-client/src/main/java/itest/nodes/HelloworldImpl.java b/sca-java-2.x/trunk/testing/itest/nodes/helloworld-client/src/main/java/itest/nodes/HelloworldImpl.java new file mode 100644 index 0000000000..2619dc269b --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/helloworld-client/src/main/java/itest/nodes/HelloworldImpl.java @@ -0,0 +1,43 @@ +/* + * 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.EagerInit; +import org.oasisopen.sca.annotation.Init; +import org.oasisopen.sca.annotation.Reference; +import org.oasisopen.sca.annotation.Scope; + +@EagerInit +@Scope("COMPOSITE") +public class HelloworldImpl implements Helloworld { + + @Reference + public Helloworld service; + + @Init + public void initialize() throws Exception{ + System.out.println(">>>>>> " + sayHello("init")); + } + + public String sayHello(String name) throws Exception { + return "Hi " + service.sayHello(name); + } + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/helloworld-client/src/main/resources/META-INF/sca-contribution.xml b/sca-java-2.x/trunk/testing/itest/nodes/helloworld-client/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..7e062cc14e --- /dev/null +++ b/sca-java-2.x/trunk/testing/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/200912" + xmlns:itest="http://itest"> + <deployable composite="itest:HelloworldClient"/> +</contribution>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/helloworld-client/src/main/resources/helloworld-client.composite b/sca-java-2.x/trunk/testing/itest/nodes/helloworld-client/src/main/resources/helloworld-client.composite new file mode 100644 index 0000000000..3c4ed03448 --- /dev/null +++ b/sca-java-2.x/trunk/testing/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/200912" + targetNamespace="http://itest" + name="HelloworldClient"> + + <component name="HelloworldClient"> + <implementation.java class="itest.nodes.HelloworldImpl"/> + <reference name="service" target="HelloworldService"/> + </component> + +</composite> diff --git a/sca-java-2.x/trunk/testing/itest/nodes/helloworld-iface/pom.xml b/sca-java-2.x/trunk/testing/itest/nodes/helloworld-iface/pom.xml new file mode 100644 index 0000000000..87b6a4fc51 --- /dev/null +++ b/sca-java-2.x/trunk/testing/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-SNAPSHOT</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-SNAPSHOT</version> + <scope>provided</scope> + </dependency> + </dependencies> +</project> diff --git a/sca-java-2.x/trunk/testing/itest/nodes/helloworld-iface/src/main/java/itest/nodes/Helloworld.java b/sca-java-2.x/trunk/testing/itest/nodes/helloworld-iface/src/main/java/itest/nodes/Helloworld.java new file mode 100644 index 0000000000..a0710281c9 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/helloworld-iface/src/main/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) throws Exception; + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-a/pom.xml b/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-a/pom.xml new file mode 100644 index 0000000000..e981d2dc4d --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-a/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-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + <artifactId>itest-nodes-helloworld-service-a</artifactId> + <name>Apache Tuscany SCA iTest Nodes Helloworld Service A</name> + + <dependencies> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>itest-nodes-helloworld-iface</artifactId> + <version>2.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-sca-api</artifactId> + <version>2.0-SNAPSHOT</version> + <scope>provided</scope> + </dependency> + </dependencies> +</project> diff --git a/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-a/src/main/java/itest/nodes/HelloworldImpl.java b/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-a/src/main/java/itest/nodes/HelloworldImpl.java new file mode 100644 index 0000000000..2619dc269b --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-a/src/main/java/itest/nodes/HelloworldImpl.java @@ -0,0 +1,43 @@ +/* + * 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.EagerInit; +import org.oasisopen.sca.annotation.Init; +import org.oasisopen.sca.annotation.Reference; +import org.oasisopen.sca.annotation.Scope; + +@EagerInit +@Scope("COMPOSITE") +public class HelloworldImpl implements Helloworld { + + @Reference + public Helloworld service; + + @Init + public void initialize() throws Exception{ + System.out.println(">>>>>> " + sayHello("init")); + } + + public String sayHello(String name) throws Exception { + return "Hi " + service.sayHello(name); + } + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-a/src/main/resources/META-INF/sca-contribution.xml b/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-a/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..bba92e6ca3 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-a/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:ServiceA"/> +</contribution>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-a/src/main/resources/service-a.composite b/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-a/src/main/resources/service-a.composite new file mode 100644 index 0000000000..55122d2d6c --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-a/src/main/resources/service-a.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="ServiceA"> + + <component name="ServiceA"> + <implementation.java class="itest.nodes.HelloworldImpl"/> + <reference name="service" target="ServiceA"/> + </component> + +</composite> diff --git a/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-and-client/pom.xml b/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-and-client/pom.xml new file mode 100644 index 0000000000..862475b534 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-and-client/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-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + <artifactId>itest-nodes-helloworld-service-and-client</artifactId> + <name>Apache Tuscany SCA iTest Nodes Helloworld Service and Client</name> + + <dependencies> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-sca-api</artifactId> + <version>2.0-SNAPSHOT</version> + <scope>provided</scope> + </dependency> + </dependencies> +</project> diff --git a/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-and-client/src/main/java/itest/nodes/sac/Helloworld.java b/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-and-client/src/main/java/itest/nodes/sac/Helloworld.java new file mode 100644 index 0000000000..1cb9b813f2 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-and-client/src/main/java/itest/nodes/sac/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.sac; + +public interface Helloworld { + + String sayHello(String name) throws Exception; + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-and-client/src/main/java/itest/nodes/sac/HelloworldClientImpl.java b/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-and-client/src/main/java/itest/nodes/sac/HelloworldClientImpl.java new file mode 100644 index 0000000000..d64536a998 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-and-client/src/main/java/itest/nodes/sac/HelloworldClientImpl.java @@ -0,0 +1,34 @@ +/* + * 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.sac; + +import org.oasisopen.sca.annotation.Reference; + +public class HelloworldClientImpl implements Helloworld { + + @Reference + public Helloworld service; + + + public String sayHello(String name) throws Exception { + return "Hi " + service.sayHello(name); + } + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-and-client/src/main/java/itest/nodes/sac/HelloworldServiceImpl.java b/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-and-client/src/main/java/itest/nodes/sac/HelloworldServiceImpl.java new file mode 100644 index 0000000000..728804b08c --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-and-client/src/main/java/itest/nodes/sac/HelloworldServiceImpl.java @@ -0,0 +1,30 @@ +/* + * 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.sac; + +public class HelloworldServiceImpl implements Helloworld { + + public String sayHello(String name) { + String response = "Hello " + name; + System.out.println("At service - " + response); + return response; + } + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-and-client/src/main/resources/META-INF/sca-contribution.xml b/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-and-client/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..555824a94e --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-and-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/200912" + xmlns:itest="http://itest"> + <deployable composite="itest:HelloworldServiceAndClient"/> +</contribution>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-and-client/src/main/resources/helloworld-service.composite b/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-and-client/src/main/resources/helloworld-service.composite new file mode 100644 index 0000000000..38ac479275 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-and-client/src/main/resources/helloworld-service.composite @@ -0,0 +1,33 @@ +<?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" + targetNamespace="http://itest" + name="HelloworldServiceAndClient"> + + <component name="HelloworldClient"> + <implementation.java class="itest.nodes.sac.HelloworldClientImpl"/> + <reference name="service" target="HelloworldService"/> + </component> + + <component name="HelloworldService"> + <implementation.java class="itest.nodes.sac.HelloworldServiceImpl"/> + </component> + +</composite> diff --git a/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-b/pom.xml b/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-b/pom.xml new file mode 100644 index 0000000000..49fdb9b562 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-b/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-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + <artifactId>itest-nodes-helloworld-service-b</artifactId> + <name>Apache Tuscany SCA iTest Nodes Helloworld Service B</name> + + <dependencies> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>itest-nodes-helloworld-iface</artifactId> + <version>2.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-sca-api</artifactId> + <version>2.0-SNAPSHOT</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-sca-api</artifactId> + <version>2.0-SNAPSHOT</version> + </dependency> + </dependencies> +</project> diff --git a/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-b/src/main/java/itest/nodes/HelloworldImpl.java b/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-b/src/main/java/itest/nodes/HelloworldImpl.java new file mode 100644 index 0000000000..b1d5a8235a --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-b/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 + protected Helloworld service; + + public String sayHello(String name) throws Exception { + return service.sayHello(name); + } + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-b/src/main/resources/META-INF/sca-contribution.xml b/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-b/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..4405cca18e --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-b/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:ServiceB"/> +</contribution>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-b/src/main/resources/service-b.composite b/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-b/src/main/resources/service-b.composite new file mode 100644 index 0000000000..02cff882a7 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-b/src/main/resources/service-b.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="ServiceB"> + + <component name="ServiceB"> + <implementation.java class="itest.nodes.HelloworldImpl"/> + <reference name="service" target="ServiceC"/> + </component> + +</composite> diff --git a/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-c/pom.xml b/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-c/pom.xml new file mode 100644 index 0000000000..ef7068e0e8 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-c/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-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + <artifactId>itest-nodes-helloworld-Serivce-c</artifactId> + <name>Apache Tuscany SCA iTest Nodes Helloworld Service C</name> + + <dependencies> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>itest-nodes-helloworld-iface</artifactId> + <version>2.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-sca-api</artifactId> + <version>2.0-SNAPSHOT</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-sca-api</artifactId> + <version>2.0-SNAPSHOT</version> + </dependency> + </dependencies> +</project> diff --git a/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-c/src/main/java/itest/nodes/HelloworldImpl.java b/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-c/src/main/java/itest/nodes/HelloworldImpl.java new file mode 100644 index 0000000000..81f7e1747d --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-c/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/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-c/src/main/resources/META-INF/sca-contribution.xml b/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-c/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..3ff86f946b --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-c/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:ServiceC"/> +</contribution>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-c/src/main/resources/service-c.composite b/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-c/src/main/resources/service-c.composite new file mode 100644 index 0000000000..d88db09b43 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service-c/src/main/resources/service-c.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="ServiceC"> + + <component name="ServiceC"> + <implementation.java class="itest.nodes.HelloworldImpl"/> + </component> + +</composite> diff --git a/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service/pom.xml b/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service/pom.xml new file mode 100644 index 0000000000..e5e84571cd --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service/pom.xml @@ -0,0 +1,43 @@ +<?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-SNAPSHOT</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-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-sca-api</artifactId> + <version>2.0-SNAPSHOT</version> + </dependency> + </dependencies> +</project> diff --git a/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service/src/main/java/itest/nodes/HelloworldImpl.java b/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service/src/main/java/itest/nodes/HelloworldImpl.java new file mode 100644 index 0000000000..a27e752fd7 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service/src/main/java/itest/nodes/HelloworldImpl.java @@ -0,0 +1,30 @@ +/* + * 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) { + String response = "Hello " + name; + System.out.println("At service - " + response); + return response; + } + +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service/src/main/resources/META-INF/sca-contribution.xml b/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..829ece9f7c --- /dev/null +++ b/sca-java-2.x/trunk/testing/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/200912" + xmlns:itest="http://itest"> + <deployable composite="itest:HelloworldService"/> +</contribution>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service/src/main/resources/helloworld-service.composite b/sca-java-2.x/trunk/testing/itest/nodes/helloworld-service/src/main/resources/helloworld-service.composite new file mode 100644 index 0000000000..5334caeb55 --- /dev/null +++ b/sca-java-2.x/trunk/testing/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/200912" + targetNamespace="http://itest" + name="HelloworldService"> + + <component name="HelloworldService"> + <implementation.java class="itest.nodes.HelloworldImpl"/> + </component> + +</composite> diff --git a/sca-java-2.x/trunk/testing/itest/nodes/one-jvm-hazelcast-client/pom.xml b/sca-java-2.x/trunk/testing/itest/nodes/one-jvm-hazelcast-client/pom.xml new file mode 100644 index 0000000000..30d509ecc6 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/one-jvm-hazelcast-client/pom.xml @@ -0,0 +1,70 @@ +<?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-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-nodes-one-jvm-hazelcast-client</artifactId>
+ <name>Apache Tuscany SCA iTest Nodes One JVM Using Hazelcast and client</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-nodes-helloworld-iface</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-client-impl</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-endpoint-hazelcast</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-hazelcast-runtime</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>com.hazelcast</groupId>
+ <artifactId>hazelcast-client</artifactId>
+ <version>1.8.3</version>
+ </dependency>
+ </dependencies>
+ <build>
+ </build>
+</project>
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/one-jvm-hazelcast-client/src/test/java/itest/ClientTestCase.java b/sca-java-2.x/trunk/testing/itest/nodes/one-jvm-hazelcast-client/src/test/java/itest/ClientTestCase.java new file mode 100644 index 0000000000..cf99c970db --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/one-jvm-hazelcast-client/src/test/java/itest/ClientTestCase.java @@ -0,0 +1,110 @@ +/*
+ * 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 static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.net.URI;
+
+import org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl;
+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 com.hazelcast.client.HazelcastClient;
+import com.hazelcast.core.IMap;
+
+/**
+ */
+public class ClientTestCase{
+
+ private static String domainURI = "uri:OneNodeTestCase?bind=127.0.0.1:14829";
+ private static Node node;
+ private static HazelcastClient client;
+
+ @BeforeClass
+ public static void setUpBeforeClass() throws Exception {
+ node = NodeFactory.newInstance(domainURI).createNode((String)null, new String[]{"../helloworld-service/target/classes", "../helloworld-client/target/classes"});
+ node.start();
+ }
+
+ @Test
+ public void testNode() throws Exception {
+
+ client = HazelcastClient.newHazelcastClient("OneNodeTestCase", "tuscany", "127.0.0.1:14829");
+ IMap<Object, Object> map = client.getMap("OneNodeTestCase/Endpoints");
+
+ assertNotNull(map);
+ assertEquals(2, map.size());
+ Object ep1 = map.get("HelloworldService#service-binding(Helloworld/Helloworld)");
+// System.out.println((RuntimeEndpointImpl)ep1);
+ assertNotNull(ep1);
+ assertTrue(ep1 instanceof RuntimeEndpointImpl);
+ Object ep2 = map.get("HelloworldClient#service-binding(Helloworld/Helloworld)");
+ assertNotNull(ep2);
+ }
+
+ //@Test
+ public void testTime() throws Exception {
+ long start = System.currentTimeMillis();
+ long count = 100;
+ for (int i=0; i<count; i++) {
+ testNode();
+ client.shutdown();
+ }
+ long avg = (System.currentTimeMillis() - start) / count;
+ System.out.println("Average for " + count + " client connects " + avg);
+ }
+
+ @Test
+ public void testBadPassword() throws Exception {
+ try {
+ client = HazelcastClient.newHazelcastClient("OneNodeTestCase", "IncorrectPassword", "127.0.0.1:14829");
+ fail();
+ } catch (Exception e) {
+ //expected
+ }
+ }
+
+ @Test
+ public void testBadIP() throws Exception {
+ try {
+ client = HazelcastClient.newHazelcastClient("OneNodeTestCase", "IncorrectPassword", "127.0.0.99:9999");
+ fail();
+ } catch (Exception e) {
+ //expected
+ }
+ }
+
+ @AfterClass
+ public static void tearDownAfterClass() throws Exception {
+ if (client != null) {
+ client.shutdown();
+ }
+ if (node != null) {
+ node.stop();
+ }
+ }
+}
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/one-jvm-hazelcast/pom.xml b/sca-java-2.x/trunk/testing/itest/nodes/one-jvm-hazelcast/pom.xml new file mode 100644 index 0000000000..4d5fb61d2b --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/one-jvm-hazelcast/pom.xml @@ -0,0 +1,68 @@ +<?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-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + <artifactId>itest-nodes-one-jvm-hazelcast</artifactId> + <name>Apache Tuscany SCA iTest Nodes One JVM Using Hazelcast Registry</name> + + <dependencies> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>itest-nodes-helloworld-service-and-client</artifactId> + <version>2.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>itest-nodes-helloworld-iface</artifactId> + <version>2.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-sca-client-impl</artifactId> + <version>2.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-endpoint-hazelcast</artifactId> + <version>2.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-hazelcast-runtime</artifactId> + <version>2.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-node-impl</artifactId> + <version>2.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-java-runtime</artifactId> + <version>2.0-SNAPSHOT</version> + </dependency> + </dependencies> +</project> diff --git a/sca-java-2.x/trunk/testing/itest/nodes/one-jvm-hazelcast/src/test/java/itest/OneNodeOneContributionTestCase.java b/sca-java-2.x/trunk/testing/itest/nodes/one-jvm-hazelcast/src/test/java/itest/OneNodeOneContributionTestCase.java new file mode 100644 index 0000000000..3755d0b365 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/one-jvm-hazelcast/src/test/java/itest/OneNodeOneContributionTestCase.java @@ -0,0 +1,64 @@ +/* + * 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.sac.Helloworld; + +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; +import org.oasisopen.sca.client.SCAClientFactory; + +/** + * This shows how to test the Calculator service component. + */ +public class OneNodeOneContributionTestCase{ + + private static URI domainURI = URI.create("tuscany:OneNodeTestCase"); + private static Node node; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + node = NodeFactory.getInstance().createNode(domainURI, "../helloworld-service-and-client/target/classes"); + node.start(); + } + + @Test + public void testNode() throws Exception { + + 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/sca-java-2.x/trunk/testing/itest/nodes/one-jvm-hazelcast/src/test/java/itest/OneNodeTestCase.java b/sca-java-2.x/trunk/testing/itest/nodes/one-jvm-hazelcast/src/test/java/itest/OneNodeTestCase.java new file mode 100644 index 0000000000..1c6b2ce754 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/one-jvm-hazelcast/src/test/java/itest/OneNodeTestCase.java @@ -0,0 +1,76 @@ +/* + * 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.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; +import org.oasisopen.sca.client.SCAClientFactory; + +/** + * This shows how to test the Calculator service component. + */ +public class OneNodeTestCase{ + + private static URI domainURI = URI.create("OneNodeTestCase"); + private static Node node; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + node = NodeFactory.getInstance().createNode(domainURI, "../helloworld-service/target/classes", "../helloworld-client/target/classes"); + node.start(); + } + + @Test + public void testNode() throws Exception { + + 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")); + + Helloworld scaClientService = SCAClientFactory.newInstance(domainURI).getService(Helloworld.class, "HelloworldService"); + assertNotNull(scaClientService); + assertEquals("Hello Petra", scaClientService.sayHello("Petra")); + + Helloworld scaClientClient = SCAClientFactory.newInstance(domainURI).getService(Helloworld.class, "HelloworldClient"); + assertNotNull(scaClientClient); + assertEquals("Hi Hello Petra", scaClientClient.sayHello("Petra")); + + } + + @AfterClass + public static void tearDownAfterClass() throws Exception { + if (node != null) { + node.stop(); + } + } +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/one-jvm-hazelcast/src/test/java/itest/TwoNodeTestCase.java b/sca-java-2.x/trunk/testing/itest/nodes/one-jvm-hazelcast/src/test/java/itest/TwoNodeTestCase.java new file mode 100644 index 0000000000..558afda077 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/one-jvm-hazelcast/src/test/java/itest/TwoNodeTestCase.java @@ -0,0 +1,82 @@ +/* + * 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.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; +import org.oasisopen.sca.client.SCAClientFactory; + +/** + * This shows how to test the Calculator service component. + */ +public class TwoNodeTestCase{ + + private static URI domainURI = URI.create("TwoNodeTestCase"); + private static Node serviceNode; + private static Node clientNode; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + serviceNode = NodeFactory.getInstance().createNode(domainURI, "../helloworld-service/target/classes"); + serviceNode.start(); + clientNode = NodeFactory.getInstance().createNode(domainURI, "../helloworld-client/target/classes"); + clientNode.start(); + } + + @Test + public void testNode() 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")); + + Helloworld scaClientService = SCAClientFactory.newInstance(domainURI).getService(Helloworld.class, "HelloworldService"); + assertNotNull(scaClientService); + assertEquals("Hello Petra", scaClientService.sayHello("Petra")); + + Helloworld scaClientClient = SCAClientFactory.newInstance(domainURI).getService(Helloworld.class, "HelloworldClient"); + assertNotNull(scaClientClient); + assertEquals("Hi Hello Petra", scaClientClient.sayHello("Petra")); + + } + + @AfterClass + public static void tearDownAfterClass() throws Exception { + if (serviceNode != null) { + serviceNode.stop(); + } + if (clientNode != null) { + clientNode.stop(); + } + } +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/one-jvm-hazelcast/src/test/java/itest/TwoRemoteNodesTestCase.java b/sca-java-2.x/trunk/testing/itest/nodes/one-jvm-hazelcast/src/test/java/itest/TwoRemoteNodesTestCase.java new file mode 100644 index 0000000000..841621964f --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/one-jvm-hazelcast/src/test/java/itest/TwoRemoteNodesTestCase.java @@ -0,0 +1,82 @@ +/*
+ * 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.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;
+import org.oasisopen.sca.client.SCAClientFactory;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class TwoRemoteNodesTestCase{
+
+ private static Node serviceNode;
+ private static Node clientNode;
+
+ @BeforeClass
+ public static void setUpBeforeClass() throws Exception {
+ serviceNode = NodeFactory.newInstance().createNode(URI.create("tuscany:TwoRemoteNodesTestCase"), "../helloworld-service/target/classes");
+ serviceNode.start();
+
+ clientNode = NodeFactory.getInstance().createNode(URI.create("tuscany:TwoRemoteNodesTestCase"), "../helloworld-client/target/classes");
+ clientNode.start();
+ }
+
+ @Test
+ public void testNode() 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"));
+
+ Helloworld scaClientService = SCAClientFactory.newInstance(URI.create("TwoRemoteNodesTestCase")).getService(Helloworld.class, "HelloworldService");
+ assertNotNull(scaClientService);
+ assertEquals("Hello Petra", scaClientService.sayHello("Petra"));
+
+ Helloworld scaClientClient = SCAClientFactory.newInstance(URI.create("TwoRemoteNodesTestCase")).getService(Helloworld.class, "HelloworldClient");
+ assertNotNull(scaClientClient);
+ assertEquals("Hi Hello Petra", scaClientClient.sayHello("Petra"));
+
+ }
+
+ @AfterClass
+ public static void tearDownAfterClass() throws Exception {
+ if (serviceNode != null) {
+ serviceNode.stop();
+ }
+ if (clientNode != null) {
+ clientNode.stop();
+ }
+ }
+}
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/one-jvm-tribes/pom.xml b/sca-java-2.x/trunk/testing/itest/nodes/one-jvm-tribes/pom.xml new file mode 100644 index 0000000000..ff52b60103 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/one-jvm-tribes/pom.xml @@ -0,0 +1,82 @@ +<?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-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-nodes-one-jvm-tribes</artifactId>
+ <name>Apache Tuscany SCA iTest Nodes One JVM Using Tribes Registry</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-nodes-helloworld-iface</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-client-impl</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-endpoint-tribes</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-rmi-runtime</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.5</version>
+ <configuration>
+ <includes>
+ <include>**/*TestCase.java</include>
+ </includes>
+ <reportFormat>brief</reportFormat>
+ <useFile>false</useFile>
+ <forkMode>once</forkMode>
+ <argLine>-ea -Xmx256m</argLine>
+ <parallel>off</parallel>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/one-jvm-tribes/src/test/java/itest/OneNodeTestCase.java b/sca-java-2.x/trunk/testing/itest/nodes/one-jvm-tribes/src/test/java/itest/OneNodeTestCase.java new file mode 100644 index 0000000000..e55e8f63e4 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/one-jvm-tribes/src/test/java/itest/OneNodeTestCase.java @@ -0,0 +1,76 @@ +/*
+ * 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.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;
+import org.oasisopen.sca.client.SCAClientFactory;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class OneNodeTestCase{
+
+ private static URI domainURI = URI.create("OneNodeTestCase");
+ private static Node node;
+
+ @BeforeClass
+ public static void setUpBeforeClass() throws Exception {
+ node = NodeFactory.getInstance().createNode(domainURI, "../helloworld-service/target/classes", "../helloworld-client/target/classes");
+ node.start();
+ }
+
+ @Test
+ public void testNode() throws Exception {
+
+ 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"));
+
+ Helloworld scaClientService = SCAClientFactory.newInstance(domainURI).getService(Helloworld.class, "HelloworldService");
+ assertNotNull(scaClientService);
+ assertEquals("Hello Petra", scaClientService.sayHello("Petra"));
+
+ Helloworld scaClientClient = SCAClientFactory.newInstance(domainURI).getService(Helloworld.class, "HelloworldClient");
+ assertNotNull(scaClientClient);
+ assertEquals("Hi Hello Petra", scaClientClient.sayHello("Petra"));
+
+ }
+
+ @AfterClass
+ public static void tearDownAfterClass() throws Exception {
+ if (node != null) {
+ node.stop();
+ }
+ }
+}
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/one-jvm-tribes/src/test/java/itest/TwoNodeTestCase.java b/sca-java-2.x/trunk/testing/itest/nodes/one-jvm-tribes/src/test/java/itest/TwoNodeTestCase.java new file mode 100644 index 0000000000..2d920c340a --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/one-jvm-tribes/src/test/java/itest/TwoNodeTestCase.java @@ -0,0 +1,82 @@ +/*
+ * 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.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;
+import org.oasisopen.sca.client.SCAClientFactory;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class TwoNodeTestCase{
+
+ private static URI domainURI = URI.create("TwoNodeTestCase");
+ private static Node serviceNode;
+ private static Node clientNode;
+
+ @BeforeClass
+ public static void setUpBeforeClass() throws Exception {
+ serviceNode = NodeFactory.getInstance().createNode(domainURI, "../helloworld-service/target/classes");
+ serviceNode.start();
+ clientNode = NodeFactory.getInstance().createNode(domainURI, "../helloworld-client/target/classes");
+ clientNode.start();
+ }
+
+ @Test
+ public void testNode() 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"));
+
+ Helloworld scaClientService = SCAClientFactory.newInstance(domainURI).getService(Helloworld.class, "HelloworldService");
+ assertNotNull(scaClientService);
+ assertEquals("Hello Petra", scaClientService.sayHello("Petra"));
+
+ Helloworld scaClientClient = SCAClientFactory.newInstance(domainURI).getService(Helloworld.class, "HelloworldClient");
+ assertNotNull(scaClientClient);
+ assertEquals("Hi Hello Petra", scaClientClient.sayHello("Petra"));
+
+ }
+
+ @AfterClass
+ public static void tearDownAfterClass() throws Exception {
+ if (serviceNode != null) {
+ serviceNode.stop();
+ }
+ if (clientNode != null) {
+ clientNode.stop();
+ }
+ }
+}
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/one-jvm-tribes/src/test/java/itest/TwoRemoteNodesTestCase.java b/sca-java-2.x/trunk/testing/itest/nodes/one-jvm-tribes/src/test/java/itest/TwoRemoteNodesTestCase.java new file mode 100644 index 0000000000..888b4df156 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/one-jvm-tribes/src/test/java/itest/TwoRemoteNodesTestCase.java @@ -0,0 +1,83 @@ +/*
+ * 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.net.URI;
+
+import org.apache.tuscany.sca.binding.rmi.RMIBinding;
+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.SCAClientFactory;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class TwoRemoteNodesTestCase{
+
+ private static Node serviceNode;
+ private static Node clientNode;
+
+ @BeforeClass
+ public static void setUpBeforeClass() throws Exception {
+ serviceNode = NodeFactory.newInstance().createNode(URI.create("tuscany:TwoRemoteNodesTestCase"), "../helloworld-service/target/classes");
+ serviceNode.start();
+
+ clientNode = NodeFactory.getInstance().createNode(URI.create("tuscany:TwoRemoteNodesTestCase"), "../helloworld-client/target/classes");
+ clientNode.start();
+ }
+
+ @Test
+ public void testNode() 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"));
+
+// Helloworld scaClientService = SCAClientFactory.newInstance(URI.create("TwoRemoteNodesTestCase")).getService(Helloworld.class, "HelloworldService");
+// assertNotNull(scaClientService);
+// assertEquals("Hello Petra", scaClientService.sayHello("Petra"));
+
+ Helloworld scaClientClient = SCAClientFactory.newInstance(URI.create("TwoRemoteNodesTestCase")).getService(Helloworld.class, "HelloworldClient");
+ assertNotNull(scaClientClient);
+ assertEquals("Hi Hello Petra", scaClientClient.sayHello("Petra"));
+
+ }
+
+ @AfterClass
+ public static void tearDownAfterClass() throws Exception {
+ if (serviceNode != null) {
+ serviceNode.stop();
+ }
+ if (clientNode != null) {
+ clientNode.stop();
+ }
+ }
+}
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/one-jvm/pom.xml b/sca-java-2.x/trunk/testing/itest/nodes/one-jvm/pom.xml new file mode 100644 index 0000000000..1edbfc3b99 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/one-jvm/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-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + <artifactId>itest-nodes-one-jvm</artifactId> + <name>Apache Tuscany SCA iTest Nodes One JVM</name> + + <dependencies> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>itest-nodes-helloworld-iface</artifactId> + <version>2.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-sca-client-impl</artifactId> + <version>2.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-node-impl</artifactId> + <version>2.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-java-runtime</artifactId> + <version>2.0-SNAPSHOT</version> + </dependency> + </dependencies> +</project> diff --git a/sca-java-2.x/trunk/testing/itest/nodes/one-jvm/src/test/java/itest/OneNodeTestCase.java b/sca-java-2.x/trunk/testing/itest/nodes/one-jvm/src/test/java/itest/OneNodeTestCase.java new file mode 100644 index 0000000000..1c6b2ce754 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/one-jvm/src/test/java/itest/OneNodeTestCase.java @@ -0,0 +1,76 @@ +/* + * 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.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; +import org.oasisopen.sca.client.SCAClientFactory; + +/** + * This shows how to test the Calculator service component. + */ +public class OneNodeTestCase{ + + private static URI domainURI = URI.create("OneNodeTestCase"); + private static Node node; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + node = NodeFactory.getInstance().createNode(domainURI, "../helloworld-service/target/classes", "../helloworld-client/target/classes"); + node.start(); + } + + @Test + public void testNode() throws Exception { + + 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")); + + Helloworld scaClientService = SCAClientFactory.newInstance(domainURI).getService(Helloworld.class, "HelloworldService"); + assertNotNull(scaClientService); + assertEquals("Hello Petra", scaClientService.sayHello("Petra")); + + Helloworld scaClientClient = SCAClientFactory.newInstance(domainURI).getService(Helloworld.class, "HelloworldClient"); + assertNotNull(scaClientClient); + assertEquals("Hi Hello Petra", scaClientClient.sayHello("Petra")); + + } + + @AfterClass + public static void tearDownAfterClass() throws Exception { + if (node != null) { + node.stop(); + } + } +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/one-jvm/src/test/java/itest/TwoNodeTestCase.java b/sca-java-2.x/trunk/testing/itest/nodes/one-jvm/src/test/java/itest/TwoNodeTestCase.java new file mode 100644 index 0000000000..558afda077 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/one-jvm/src/test/java/itest/TwoNodeTestCase.java @@ -0,0 +1,82 @@ +/* + * 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.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; +import org.oasisopen.sca.client.SCAClientFactory; + +/** + * This shows how to test the Calculator service component. + */ +public class TwoNodeTestCase{ + + private static URI domainURI = URI.create("TwoNodeTestCase"); + private static Node serviceNode; + private static Node clientNode; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + serviceNode = NodeFactory.getInstance().createNode(domainURI, "../helloworld-service/target/classes"); + serviceNode.start(); + clientNode = NodeFactory.getInstance().createNode(domainURI, "../helloworld-client/target/classes"); + clientNode.start(); + } + + @Test + public void testNode() 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")); + + Helloworld scaClientService = SCAClientFactory.newInstance(domainURI).getService(Helloworld.class, "HelloworldService"); + assertNotNull(scaClientService); + assertEquals("Hello Petra", scaClientService.sayHello("Petra")); + + Helloworld scaClientClient = SCAClientFactory.newInstance(domainURI).getService(Helloworld.class, "HelloworldClient"); + assertNotNull(scaClientClient); + assertEquals("Hi Hello Petra", scaClientClient.sayHello("Petra")); + + } + + @AfterClass + public static void tearDownAfterClass() throws Exception { + if (serviceNode != null) { + serviceNode.stop(); + } + if (clientNode != null) { + clientNode.stop(); + } + } +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/one-node-test/pom.xml b/sca-java-2.x/trunk/testing/itest/nodes/one-node-test/pom.xml new file mode 100644 index 0000000000..d35761bc88 --- /dev/null +++ b/sca-java-2.x/trunk/testing/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-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + <artifactId>itest-nodes-one-node-test</artifactId> + <name>Apache Tuscany SCA iTest Nodes One Node Test</name> + + <dependencies> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>itest-nodes-helloworld-iface</artifactId> + <version>2.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-node-impl</artifactId> + <version>2.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-java-runtime</artifactId> + <version>2.0-SNAPSHOT</version> + </dependency> + </dependencies> +</project> diff --git a/sca-java-2.x/trunk/testing/itest/nodes/one-node-test/src/test/java/itest/OneNodeTestCase.java b/sca-java-2.x/trunk/testing/itest/nodes/one-node-test/src/test/java/itest/OneNodeTestCase.java new file mode 100644 index 0000000000..6d49b718ef --- /dev/null +++ b/sca-java-2.x/trunk/testing/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/sca-java-2.x/trunk/testing/itest/nodes/pom.xml b/sca-java-2.x/trunk/testing/itest/nodes/pom.xml new file mode 100644 index 0000000000..6a60de05da --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/pom.xml @@ -0,0 +1,63 @@ +<?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-SNAPSHOT</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>helloworld-service-and-client</module> +<!-- + <module>helloworld-service-a</module> + <module>helloworld-service-b</module> + <module>helloworld-service-c</module> +--> + <module>one-jvm</module> + <module>one-jvm-hazelcast</module> + <module>one-jvm-hazelcast-client</module> + <module>one-jvm-tribes</module> + <module>binding-sca-hazelcast</module> + <!-- module>binding-sca-tribes</module --> + <module>one-node-test</module> +<!-- failing now and then with RMI already bound problem + <module>two-nodes-two-vms-hazelcast</module> + <module>two-nodes-test</module> +--> + +<!-- + <module>three-nodes-three-vms-test</module> +--> + </modules> + +</project> diff --git a/sca-java-2.x/trunk/testing/itest/nodes/three-nodes-three-vms-test/build.xml b/sca-java-2.x/trunk/testing/itest/nodes/three-nodes-three-vms-test/build.xml new file mode 100644 index 0000000000..3d77230541 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/three-nodes-three-vms-test/build.xml @@ -0,0 +1,38 @@ +<!-- + * 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 name="itest-samples" default="run"> + + <target name="run"> + + <parallel failonany="true"> + + <daemons> + <ant antfile="server.xml"/> + </daemons> + + <sequential> + <sleep seconds="4"/> + <ant antfile="client.xml"/> + </sequential> + + </parallel> + + </target> + +</project> diff --git a/sca-java-2.x/trunk/testing/itest/nodes/three-nodes-three-vms-test/client.xml b/sca-java-2.x/trunk/testing/itest/nodes/three-nodes-three-vms-test/client.xml new file mode 100644 index 0000000000..8e7c744940 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/three-nodes-three-vms-test/client.xml @@ -0,0 +1,31 @@ +<!-- + * 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 name="server" default="run"> + + <!--echo>${runtime_classpath}</echo--> + + <target name="run"> + <java classpath="${runtime_classpath};./target/test-classes" + classname="itest.Client" + fork="true" + failonerror="true"> + </java> + </target> + +</project>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/three-nodes-three-vms-test/pom.xml b/sca-java-2.x/trunk/testing/itest/nodes/three-nodes-three-vms-test/pom.xml new file mode 100644 index 0000000000..337a4ba5c1 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/three-nodes-three-vms-test/pom.xml @@ -0,0 +1,104 @@ +<?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-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + <artifactId>itest-nodes-three-nodes-three-vms-test</artifactId> + <name>Apache Tuscany SCA iTest Nodes Three Nodes Three VMs Test</name> + + <dependencies> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-domain-node</artifactId> + <version>2.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-endpoint-tribes</artifactId> + <version>2.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>itest-nodes-helloworld-iface</artifactId> + <version>2.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-node-impl</artifactId> + <version>2.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-node-launcher</artifactId> + <version>2.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-sca-client-impl</artifactId> + <version>2.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-java-runtime</artifactId> + <version>2.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-sca-runtime-rmi</artifactId> + <version>2.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-host-jetty</artifactId> + <version>2.0-SNAPSHOT</version> + </dependency> + + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-antrun-plugin</artifactId> + <executions> + <execution> + <id>run-samples</id> + <phase>test</phase> + <goals> + <goal>run</goal> + </goals> + <configuration> + <tasks unless="maven.test.skip"> + <property name="tuscany.version" value="${version}" /> + <property name="runtime_classpath" refid="maven.runtime.classpath"/> + <ant antfile="./build.xml" target="run"/> + </tasks> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/sca-java-2.x/trunk/testing/itest/nodes/three-nodes-three-vms-test/server.xml b/sca-java-2.x/trunk/testing/itest/nodes/three-nodes-three-vms-test/server.xml new file mode 100644 index 0000000000..dc18cc8ce0 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/three-nodes-three-vms-test/server.xml @@ -0,0 +1,30 @@ +<!-- + * 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 name="server" default="run"> + + <!--echo>${runtime_classpath}</echo--> + + <target name="run"> + <java classpath="${runtime_classpath}" classname="org.apache.tuscany.sca.node.launcher.NodeMain" fork="true"> + <arg value="-node"/> + <arg value="./server-config.xml"/> + </java> + </target> + +</project>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/three-nodes-three-vms-test/service-a-config.xml b/sca-java-2.x/trunk/testing/itest/nodes/three-nodes-three-vms-test/service-a-config.xml new file mode 100644 index 0000000000..1f87322e80 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/three-nodes-three-vms-test/service-a-config.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. +--> +<node xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903" + xmlns="http://tuscany.apache.org/xmlns/sca/1.1" + xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1" + uri="http://sample/nodes/TestNode1" + domain="http://domain1" + domainRegistry="tribes:default"> + + <!-- Configure the base URIs for a given binding --> + <!-- Each base URI is for a protocol supported by the binding --> + <binding name="sca:binding.sca" baseURIs="http://localhost:8081/sca https://localhost:8081/sca"/> + <binding name="sca:binding.ws" baseURIs="http://localhost:8082/ws https://localhost:8082/ws"/> + + <!-- Configure a list of contributions --> + <contribution uri="iface" location="../helloworld-iface/target/itest-nodes-helloworld-iface-2.0-SNAPSHOT.jar"/> + <contribution uri="client" location="../helloworld-service-a/target/itest-nodes-helloworld-service-a-2.0-SNAPSHOT.jar"> + <!-- doesn't pick up the deployable composite properly without this?--> + <deploymentComposite location="service-a.composite"/> + </contribution> + +</node>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/three-nodes-three-vms-test/service-b-config.xml b/sca-java-2.x/trunk/testing/itest/nodes/three-nodes-three-vms-test/service-b-config.xml new file mode 100644 index 0000000000..d557a31b64 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/three-nodes-three-vms-test/service-b-config.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. +--> +<node xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903" + xmlns="http://tuscany.apache.org/xmlns/sca/1.1" + xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1" + uri="http://sample/nodes/TestNode1" + domain="http://domain1" + domainRegistry="tribes:default"> + + <!-- Configure the base URIs for a given binding --> + <!-- Each base URI is for a protocol supported by the binding --> + <binding name="sca:binding.sca" baseURIs="http://localhost:8081/sca https://localhost:8081/sca"/> + <binding name="sca:binding.ws" baseURIs="http://localhost:8082/ws https://localhost:8082/ws"/> + + <!-- Configure a list of contributions --> + <contribution uri="iface" location="../helloworld-iface/target/classes"/> + <contribution uri="service" location="../helloworld-service-b/target/classes"> + <!-- doesn't pick up the deployable composite properly without this?--> + <deploymentComposite location="service-b.composite"/> + </contribution> + +</node>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/three-nodes-three-vms-test/service-c-config.xml b/sca-java-2.x/trunk/testing/itest/nodes/three-nodes-three-vms-test/service-c-config.xml new file mode 100644 index 0000000000..ba642c5ed0 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/three-nodes-three-vms-test/service-c-config.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. +--> +<node xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903" + xmlns="http://tuscany.apache.org/xmlns/sca/1.1" + xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1" + uri="http://sample/nodes/TestNode1" + domain="http://domain1" + domainRegistry="tribes:default"> + + <!-- Configure the base URIs for a given binding --> + <!-- Each base URI is for a protocol supported by the binding --> + <binding name="sca:binding.sca" baseURIs="http://localhost:8081/sca https://localhost:8081/sca"/> + <binding name="sca:binding.ws" baseURIs="http://localhost:8082/ws https://localhost:8082/ws"/> + + <!-- Configure a list of contributions --> + <contribution uri="iface" location="../helloworld-iface/target/classes"/> + <contribution uri="service" location="../helloworld-service-c/target/classes"> + <!-- doesn't pick up the deployable composite properly without this?--> + <deploymentComposite location="service-c.composite"/> + </contribution> + +</node>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/three-nodes-three-vms-test/src/test/java/itest/ServiceA.java b/sca-java-2.x/trunk/testing/itest/nodes/three-nodes-three-vms-test/src/test/java/itest/ServiceA.java new file mode 100644 index 0000000000..6ef30fe43f --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/three-nodes-three-vms-test/src/test/java/itest/ServiceA.java @@ -0,0 +1,65 @@ +/* + * 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.io.File; + +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 ServiceA { + + private static Node sericeNode; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + NodeFactory factory = NodeFactory.newInstance(); + + sericeNode = factory.createNode(new File("service-a-config.xml").toURI().toURL()); + + try { + sericeNode.start(); + } catch (Exception ex){ + ex.printStackTrace(); + throw ex; + } + } + + @Test + public void testNothing() throws Exception { + + } + + @AfterClass + public static void tearDownAfterClass() throws Exception { + if (sericeNode != null) { + sericeNode.stop(); + } + } + + public static void main(String[] args) throws Exception { + ServiceA.setUpBeforeClass(); + ServiceA.tearDownAfterClass(); + } +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/three-nodes-three-vms-test/src/test/java/itest/ServiceB.java b/sca-java-2.x/trunk/testing/itest/nodes/three-nodes-three-vms-test/src/test/java/itest/ServiceB.java new file mode 100644 index 0000000000..67a8e5d92e --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/three-nodes-three-vms-test/src/test/java/itest/ServiceB.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.io.File; + +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 ServiceB { + + private static Node serviceNode; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + NodeFactory factory = NodeFactory.newInstance(); + + serviceNode = factory.createNode(new File("service-b-config.xml").toURI().toURL()); + serviceNode.start(); + } + + @Test + public void testNothing() throws Exception { + synchronized (this) { + this.wait(); + } + } + + @AfterClass + public static void tearDownAfterClass() throws Exception { + if (serviceNode != null) { + serviceNode.stop(); + } + } +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/three-nodes-three-vms-test/src/test/java/itest/ServiceC.java b/sca-java-2.x/trunk/testing/itest/nodes/three-nodes-three-vms-test/src/test/java/itest/ServiceC.java new file mode 100644 index 0000000000..d716b5cd98 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/three-nodes-three-vms-test/src/test/java/itest/ServiceC.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.io.File; + +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 ServiceC { + + private static Node serviceNode; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + NodeFactory factory = NodeFactory.newInstance(); + + serviceNode = factory.createNode(new File("service-c-config.xml").toURI().toURL()); + serviceNode.start(); + } + + @Test + public void testNothing() throws Exception { + synchronized (this) { + this.wait(); + } + } + + @AfterClass + public static void tearDownAfterClass() throws Exception { + if (serviceNode != null) { + serviceNode.stop(); + } + } +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-test/pom.xml b/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-test/pom.xml new file mode 100644 index 0000000000..091f5cbb9e --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-test/pom.xml @@ -0,0 +1,59 @@ +<?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-SNAPSHOT</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-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-node-impl</artifactId> + <version>2.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-sca-client-impl</artifactId> + <version>2.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-java-runtime</artifactId> + <version>2.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-ws-runtime-axis2</artifactId> + <version>2.0-SNAPSHOT</version> + </dependency> + </dependencies> + +</project> diff --git a/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-test/src/test/java/itest/ClientNode.java b/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-test/src/test/java/itest/ClientNode.java new file mode 100644 index 0000000000..6da4c1f7e1 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-test/src/test/java/itest/ClientNode.java @@ -0,0 +1,93 @@ +/* + * 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 java.net.URI; + +import javax.xml.namespace.QName; + +import org.apache.tuscany.sca.node.Node; +import org.apache.tuscany.sca.node.NodeFactory; +import org.apache.tuscany.sca.node.configuration.NodeConfiguration; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Ignore; +import org.junit.Test; +import org.oasisopen.sca.client.SCAClientFactory; + +/** + * This shows how to test the Calculator service component. + */ +public class ClientNode { + private final static String SCA11_NS = "http://docs.oasis-open.org/ns/opencsa/sca/200912"; + private static Node clientNode; + private static TestCaseRunner runner; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + runner = new TestCaseRunner(ServiceNode.class); + runner.beforeClass(); + System.setProperty("org.apache.tuscany.sca.contribution.processor.ValidationSchemaExtensionPoint.enabled", + "false"); + NodeFactory factory = NodeFactory.newInstance(); + NodeConfiguration conf = + factory.createNodeConfiguration().setURI("clientNode"). + addBinding(new QName(SCA11_NS, "binding.sca"), "http://localhost:8085/sca https://localhost:9085/sca") + .addBinding(new QName(SCA11_NS, "binding.ws"), "http://localhost:8086/ws") + .addContribution("client", new File("../helloworld-client/target/classes").toURI().toString()); + clientNode = factory.createNode(conf).start(); + Thread.sleep(1000); + } + + @Test + public void testCalculator() throws Exception { + + Helloworld client = clientNode.getService(Helloworld.class, "HelloworldClient"); + assertNotNull(client); + assertEquals("Hi Hello Petra", client.sayHello("Petra")); + } + + @Test + @Ignore("SCAClient needs to leverage the EndpointRegistry to invoke services that are not hosted on the local node") + public void testCalculatorClientAPI() throws Exception { + Helloworld service = SCAClientFactory.newInstance(URI.create("default")).getService(Helloworld.class, "HelloworldService"); + assertNotNull(service); + assertEquals("Hello Petra", service.sayHello("Petra")); + + Helloworld client = SCAClientFactory.newInstance(URI.create("default")).getService(Helloworld.class, "HelloworldClient"); + assertNotNull(client); + assertEquals("Hi Hello Petra", client.sayHello("Petra")); + } + + @AfterClass + public static void tearDownAfterClass() throws Exception { + if (clientNode != null) { + clientNode.stop(); + } + if (runner != null) { + runner.afterClass(); + } + } +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-test/src/test/java/itest/ServiceNode.java b/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-test/src/test/java/itest/ServiceNode.java new file mode 100644 index 0000000000..4b034d89e0 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-test/src/test/java/itest/ServiceNode.java @@ -0,0 +1,58 @@ +/* + * 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.io.File; + +import javax.xml.namespace.QName; + +import org.apache.tuscany.sca.node.Node; +import org.apache.tuscany.sca.node.NodeFactory; +import org.apache.tuscany.sca.node.configuration.NodeConfiguration; +import org.junit.AfterClass; +import org.junit.BeforeClass; + +/** + * This shows how to test the Calculator service component. + */ +public class ServiceNode { + private final static String SCA11_NS = "http://docs.oasis-open.org/ns/opencsa/sca/200912"; + private static Node serviceNode; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + System.setProperty("org.apache.tuscany.sca.contribution.processor.ValidationSchemaExtensionPoint.enabled", + "false"); + NodeFactory factory = NodeFactory.newInstance(); + NodeConfiguration conf = + factory.createNodeConfiguration().setURI("serviceNode") + .addBinding(new QName(SCA11_NS, "binding.sca"), "http://localhost:8087/sca") + .addBinding(new QName(SCA11_NS, "binding.ws"), "http://localhost:8088/ws") + .addContribution("service", new File("../helloworld-service/target/classes").toURI().toString()); + serviceNode = factory.createNode(conf).start(); + } + + @AfterClass + public static void tearDownAfterClass() throws Exception { + if (serviceNode != null) { + serviceNode.stop(); + } + } +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-test/src/test/java/itest/StopStartNodesTestCase.java b/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-test/src/test/java/itest/StopStartNodesTestCase.java new file mode 100644 index 0000000000..998492734b --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-test/src/test/java/itest/StopStartNodesTestCase.java @@ -0,0 +1,103 @@ +/*
+ * 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 static org.junit.Assert.fail;
+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.Test;
+
+/**
+ * Tests using two nodes and stopping and restarting a service node.
+ */
+public class StopStartNodesTestCase {
+
+ private static Node serviceNode;
+ private static Node clientNode;
+
+ @Test
+ public void testCalculator() throws Exception {
+ 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();
+
+ 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"));
+
+ serviceNode.stop();
+
+ client = clientNode.getService(Helloworld.class, "HelloworldClient");
+ assertNotNull(client);
+
+ try {
+ client.sayHello("Petra");
+ fail();
+ } catch (Exception e) {
+ // expected
+ // TODO: better exception than NPE
+ }
+
+ serviceNode = factory.createNode(new Contribution("service", getJar("../helloworld-service/target")));
+ serviceNode.start();
+
+ client = clientNode.getService(Helloworld.class, "HelloworldClient");
+ assertNotNull(client);
+ assertEquals("Hi Hello Petra", client.sayHello("Petra"));
+ }
+
+ /**
+ * 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);
+ }
+
+ @AfterClass
+ public static void tearDownAfterClass() throws Exception {
+ if (serviceNode != null) {
+ serviceNode.stop();
+ }
+ if (clientNode != null) {
+ clientNode.stop();
+ }
+ }
+}
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-test/src/test/java/itest/TestCaseRunner.java b/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-test/src/test/java/itest/TestCaseRunner.java new file mode 100644 index 0000000000..7dfa6e66cc --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-test/src/test/java/itest/TestCaseRunner.java @@ -0,0 +1,292 @@ +/* + * 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.lang.annotation.Annotation; +import java.lang.reflect.Constructor; +import java.lang.reflect.Method; +import java.net.URL; +import java.net.URLClassLoader; +import java.security.AccessController; +import java.security.PrivilegedAction; + +/** + * A helper class that can be used to run an SCA JUnit test case. The test case will run in an isolated class loader. + * + * @version $Rev$ $Date$ + */ +public class TestCaseRunner { + + private ClassLoader classLoader; + private Class<?> testSuiteClass; + private Object testSuite; + private Class<?> testResultClass; + private Class<?> testCaseClass; + private Object testCase; + + private Class<?> beforeAnnotation; + private Class<?> beforeClassAnnotation; + private Class<?> afterAnnotation; + private Class<?> afterClassAnnotation; + private Class<?> junit4AdapterClass; + private Class<?> junit3TestCaseClass; + + /** + * Constructs a new TestCase runner. + * + * @param testClass + */ + public TestCaseRunner(Class<?> testClass) { + try { + ClassLoader tccl = Thread.currentThread().getContextClassLoader(); + classLoader = testClass.getClassLoader(); + if (classLoader instanceof URLClassLoader) { + URL[] urls = ((URLClassLoader)classLoader).getURLs(); + classLoader = new URLClassLoader(urls, classLoader.getParent()); + } else if (classLoader == tccl || classLoader.getParent() == tccl) { + classLoader = new URLClassLoader(new URL[0], classLoader); + } else { + classLoader = tccl; + } + + try { + // Thread.currentThread().setContextClassLoader(classLoader); + // Allow privileged access to set class loader. Requires RuntimePermission + // setContextClassLoader in security policy. + final ClassLoader finalClassLoader = classLoader; + AccessController.doPrivileged(new PrivilegedAction<Object>() { + public Object run() { + Thread.currentThread().setContextClassLoader(finalClassLoader); + return null; + } + }); + + testCaseClass = Class.forName(testClass.getName(), true, classLoader); + testCase = testCaseClass.newInstance(); + ClassLoader testClassLoader = testCaseClass.getClassLoader(); + + junit3TestCaseClass = Class.forName("junit.framework.TestCase", true, testClassLoader); + + testSuiteClass = Class.forName("junit.framework.TestSuite", true, testClassLoader); + Constructor<?> testSuiteConstructor = testSuiteClass.getConstructor(Class.class); + testSuite = testSuiteConstructor.newInstance(testCaseClass); + + testResultClass = Class.forName("junit.framework.TestResult", true, testClassLoader); + + try { + beforeAnnotation = Class.forName("org.junit.Before", true, testClassLoader); + afterAnnotation = Class.forName("org.junit.After", true, testClassLoader); + beforeClassAnnotation = Class.forName("org.junit.BeforeClass", true, testClassLoader); + afterClassAnnotation = Class.forName("org.junit.AfterClass", true, testClassLoader); + junit4AdapterClass = Class.forName("junit.framework.JUnit4TestAdapter", true, testClassLoader); + } catch (Exception e) { + // Unexpected + throw new AssertionError(e); + } + } catch (Throwable e) { + e.printStackTrace(); + } finally { + // Thread.currentThread().setContextClassLoader(tccl); + // Allow privileged access to set class loader. Requires RuntimePermission + // setContextClassLoader in security policy. + final ClassLoader finaltccl = tccl; + AccessController.doPrivileged(new PrivilegedAction<Object>() { + public Object run() { + Thread.currentThread().setContextClassLoader(finaltccl); + return null; + } + }); + } + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + /** + * Run the test case + */ + public void run() { + ClassLoader tccl = Thread.currentThread().getContextClassLoader(); + try { + // Thread.currentThread().setContextClassLoader(classLoader); + // Allow privileged access to set class loader. Requires RuntimePermission + // setContextClassLoader in security policy. + final ClassLoader finalClassLoader = classLoader; + AccessController.doPrivileged(new PrivilegedAction<Object>() { + public Object run() { + Thread.currentThread().setContextClassLoader(finalClassLoader); + return null; + } + }); + + if (junit3TestCaseClass.isAssignableFrom(testCaseClass)) { + Object testResult = testResultClass.newInstance(); + Method runMethod = testSuiteClass.getMethod("run", testResultClass); + runMethod.invoke(testSuite, testResult); + } else { + Object junit4Adapter = junit4AdapterClass.getConstructor(Class.class).newInstance(testCaseClass); + Object testResult = testResultClass.newInstance(); + Method runMethod = junit4AdapterClass.getMethod("run", testResultClass); + runMethod.invoke(junit4Adapter, testResult); + } + } catch (Exception e) { + throw new RuntimeException(e); + } finally { + // Thread.currentThread().setContextClassLoader(tccl); + // Allow privileged access to set class loader. Requires RuntimePermission + // setContextClassLoader in security policy. + final ClassLoader finaltccl = tccl; + AccessController.doPrivileged(new PrivilegedAction<Object>() { + public Object run() { + Thread.currentThread().setContextClassLoader(finaltccl); + return null; + } + }); + } + } + + /** + * Invoke the setUp method + */ + public void setUp() { + execute("setUp"); + } + + /** + * Invoke the before methods + */ + public void before() { + execute(beforeAnnotation); + } + + /** + * Invoke the beforeClass methods + */ + public void beforeClass() { + execute(beforeClassAnnotation); + } + + /** + * Invoke the tearDown method + */ + public void tearDown() { + execute("tearDown"); + } + + /** + * Invoke the after methods + */ + public void after() { + execute(afterAnnotation); + } + + /** + * Invoke the afterClass methods + */ + public void afterClass() { + execute(afterClassAnnotation); + } + + /** + * Invoke the specified test method. + */ + public void run(String methodName) { + execute(methodName); + } + + /** + * Invoke the methods annotated with the specified annotation. + */ + private void execute(Class<?> annotationClass) { + if (annotationClass == null) { + throw new RuntimeException(new NoSuchMethodException()); + } + ClassLoader tccl = Thread.currentThread().getContextClassLoader(); + try { + // Thread.currentThread().setContextClassLoader(classLoader); + // Allow privileged access to set class loader. Requires RuntimePermission + // setContextClassLoader in security policy. + final ClassLoader finalClassLoader = classLoader; + AccessController.doPrivileged(new PrivilegedAction<Object>() { + public Object run() { + Thread.currentThread().setContextClassLoader(finalClassLoader); + return null; + } + }); + + for (Method method : testCaseClass.getDeclaredMethods()) { + for (Annotation annotation : method.getAnnotations()) { + if (annotation.annotationType() == annotationClass) { + method.invoke(testCase); + } + } + } + } catch (Exception e) { + throw new RuntimeException(e); + } finally { + // Thread.currentThread().setContextClassLoader(tccl); + // Allow privileged access to set class loader. Requires RuntimePermission + // setContextClassLoader in security policy. + final ClassLoader finaltccl = tccl; + AccessController.doPrivileged(new PrivilegedAction<Object>() { + public Object run() { + Thread.currentThread().setContextClassLoader(finaltccl); + return null; + } + }); + } + } + + /** + * Invoke the specified method + */ + private void execute(String methodName) { + ClassLoader tccl = Thread.currentThread().getContextClassLoader(); + try { + // Thread.currentThread().setContextClassLoader(classLoader); + // Allow privileged access to set class loader. Requires RuntimePermission + // setContextClassLoader in security policy. + final ClassLoader finalClassLoader = classLoader; + AccessController.doPrivileged(new PrivilegedAction<Object>() { + public Object run() { + Thread.currentThread().setContextClassLoader(finalClassLoader); + return null; + } + }); + Method setUpMethod = testCaseClass.getDeclaredMethod(methodName); + setUpMethod.setAccessible(true); + setUpMethod.invoke(testCase); + } catch (Exception e) { + throw new RuntimeException(e); + } finally { + // Thread.currentThread().setContextClassLoader(tccl); + // Allow privileged access to set class loader. Requires RuntimePermission + // setContextClassLoader in security policy. + final ClassLoader finaltccl = tccl; + AccessController.doPrivileged(new PrivilegedAction<Object>() { + public Object run() { + Thread.currentThread().setContextClassLoader(finaltccl); + return null; + } + }); + } + } + +} + diff --git a/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-test/src/test/java/itest/TwoNodesTestCase.java b/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-test/src/test/java/itest/TwoNodesTestCase.java new file mode 100644 index 0000000000..80c36e5ee9 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-test/src/test/java/itest/TwoNodesTestCase.java @@ -0,0 +1,106 @@ +/* + * 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 java.net.URI; + +import org.apache.tuscany.sca.node.Node; +import org.apache.tuscany.sca.node.NodeFactory; +import org.apache.tuscany.sca.node.configuration.NodeConfiguration; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; +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.getInstance(); + NodeConfiguration configuration1 = + factory.createNodeConfiguration().setURI("serviceNode") + .addContribution("service", getJar("../helloworld-service/target")); + serviceNode = factory.createNode(configuration1).start(); + + NodeConfiguration configuration2 = + factory.createNodeConfiguration().setURI("clientNode") + .addContribution("client", getJar("../helloworld-client/target")); + clientNode = factory.createNode(configuration2).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 { + Helloworld service = SCAClientFactory.newInstance(URI.create("default")).getService(Helloworld.class, "HelloworldService"); + assertNotNull(service); + assertEquals("Hello Petra", service.sayHello("Petra")); + + Helloworld client = SCAClientFactory.newInstance(URI.create("default")).getService(Helloworld.class, "HelloworldClient"); + 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(); + } + } +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-two-vms-hazelcast/build.xml b/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-two-vms-hazelcast/build.xml new file mode 100644 index 0000000000..ad0476c6d1 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-two-vms-hazelcast/build.xml @@ -0,0 +1,39 @@ +<!--
+ * 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 name="itest-samples" default="run">
+
+ <target name="run">
+
+ <parallel failonany="true">
+
+ <daemons>
+ <ant antfile="server.xml"/>
+ </daemons>
+
+ <sequential>
+ <sleep seconds="5"/>
+ <ant antfile="client.xml"/>
+ <ant antfile="scaclient.xml"/>
+ </sequential>
+
+ </parallel>
+
+ </target>
+
+</project>
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-two-vms-hazelcast/client-config.xml b/sca-java-2.x/trunk/testing/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/testing/itest/nodes/two-nodes-two-vms-hazelcast/client-config.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.
+-->
+<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"
+ uri="http://sample/nodes/TestNode1"
+ domain="default"
+ domainRegistry="tuscany:default">
+
+ <!-- Configure the base URIs for a given binding -->
+ <!-- Each base URI is for a protocol supported by the binding -->
+ <binding name="sca:binding.sca" baseURIs="http://localhost:8081/sca https://localhost:8081/sca"/>
+ <binding name="sca:binding.ws" baseURIs="http://localhost:8082/ws https://localhost:8082/ws"/>
+
+ <!-- Configure a list of contributions -->
+ <contribution uri="iface" location="../helloworld-iface/target/itest-nodes-helloworld-iface-2.0-SNAPSHOT.jar"/>
+ <contribution uri="client" location="../helloworld-client/target/itest-nodes-helloworld-client-2.0-SNAPSHOT.jar">
+ <!-- doesn't pick up the deployable composite properly without this?-->
+ <deploymentComposite location="helloworld-client.composite"/>
+ </contribution>
+
+</node>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-two-vms-hazelcast/client.xml b/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-two-vms-hazelcast/client.xml new file mode 100644 index 0000000000..b7a0e63a48 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-two-vms-hazelcast/client.xml @@ -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.
+-->
+<project name="client" default="run">
+
+ <!--echo>${runtime_classpath}</echo-->
+
+ <target name="run">
+ <java classpath="${runtime_classpath};./target/test-classes"
+ classname="itest.Client"
+ fork="true"
+ failonerror="true">
+ </java>
+ </target>
+
+
+ <target name="run-cmdline">
+ <java classpath="../../../distribution/all/target/apache-tuscany-sca-all-2.0-SNAPSHOT.dir/tuscany-sca-2.0-SNAPSHOT/features/tuscany-sca-manifest.jar:./target/test-classes:../helloworld-iface/target/classes"
+ classname="itest.Client"
+ fork="true"
+ failonerror="true">
+ </java>
+ </target>
+
+ <target name="run-cmdline-seq">
+ <sequential>
+ <antcall target="run-cmdline"/>
+ <antcall target="run-cmdline"/>
+ <antcall target="run-cmdline"/>
+ </sequential>
+ </target>
+
+ <target name="run-cmdline-par">
+ <parallel>
+ <antcall target="run-cmdline"/>
+ <antcall target="run-cmdline"/>
+ <antcall target="run-cmdline"/>
+ </parallel>
+ </target>
+</project>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-two-vms-hazelcast/pom.xml b/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-two-vms-hazelcast/pom.xml new file mode 100644 index 0000000000..05fec4cb54 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-two-vms-hazelcast/pom.xml @@ -0,0 +1,114 @@ +<?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-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-nodes-two-nodes-two-vms-hazelcast</artifactId>
+ <name>Apache Tuscany SCA iTest Nodes Two Nodes Two VMs Test using Hazelcast registry</name>
+
+ <dependencies>
+ <!--dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-domain-node</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency-->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-endpoint-hazelcast</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-endpoint-hazelcast-client</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-nodes-helloworld-iface</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-launcher</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-client-impl</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-sca-runtime</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-rmi-runtime</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-jetty</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>run-samples</id>
+ <phase>test</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks unless="maven.test.skip">
+ <property name="tuscany.version" value="${version}" />
+ <property name="runtime_classpath" refid="maven.runtime.classpath"/>
+ <ant antfile="./build.xml" target="run"/>
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-two-vms-hazelcast/scaclient.xml b/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-two-vms-hazelcast/scaclient.xml new file mode 100644 index 0000000000..b85d1a7915 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-two-vms-hazelcast/scaclient.xml @@ -0,0 +1,54 @@ +<!-- + * 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 name="scaclient" default="run"> + + <!--echo>${runtime_classpath}</echo--> + + <target name="run"> + <java classpath="${runtime_classpath};./target/test-classes" + classname="itest.SCAClient" + fork="true" + failonerror="true"> + </java> + </target> + + <target name="run-cmdline"> + <java classpath="../../../distribution/all/target/apache-tuscany-sca-all-2.0-SNAPSHOT.dir/tuscany-sca-2.0-SNAPSHOT/features/tuscany-sca-manifest.jar:./target/test-classes:../helloworld-iface/target/classes" + classname="itest.SCAClient" + fork="true" + failonerror="true"> + </java> + </target> + + <target name="run-cmdline-seq"> + <sequential> + <antcall target="run-cmdline"/> + <antcall target="run-cmdline"/> + <antcall target="run-cmdline"/> + </sequential> + </target> + + <target name="run-cmdline-par"> + <parallel> + <antcall target="run-cmdline"/> + <antcall target="run-cmdline"/> + <antcall target="run-cmdline"/> + </parallel> + </target> +</project>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-two-vms-hazelcast/server-config.xml b/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-two-vms-hazelcast/server-config.xml new file mode 100644 index 0000000000..841471f95f --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-two-vms-hazelcast/server-config.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.
+-->
+<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"
+ uri="http://sample/nodes/TestNode2"
+ domain="default"
+ domainRegistry="tuscany:default?listen=127.0.0.1:14820">
+
+ <!-- Configure the base URIs for a given binding -->
+ <!-- Each base URI is for a protocol supported by the binding -->
+ <binding name="sca:binding.sca" baseURIs="http://localhost:8081/sca https://localhost:8081/sca"/>
+ <binding name="sca:binding.ws" baseURIs="http://localhost:8082/ws https://localhost:8082/ws"/>
+
+ <!-- Configure a list of contributions -->
+ <contribution uri="iface" location="../helloworld-iface/target/classes"/>
+ <contribution uri="service" location="../helloworld-service/target/classes">
+ <!-- doesn't pick up the deployable composite properly without this?-->
+ <deploymentComposite location="helloworld-service.composite"/>
+ </contribution>
+
+</node>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-two-vms-hazelcast/server.xml b/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-two-vms-hazelcast/server.xml new file mode 100644 index 0000000000..98474d2cf4 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-two-vms-hazelcast/server.xml @@ -0,0 +1,42 @@ +<!--
+ * 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 name="server" default="run">
+
+ <!--echo>${runtime_classpath}</echo-->
+
+ <target name="run">
+ <java classpath="${runtime_classpath}" classname="org.apache.tuscany.sca.node.launcher.NodeMain" fork="true">
+ <sysproperty key="org.apache.tuscany.sca.binding.sca.provider.SCABindingMapper.mappedBinding" value="{http://tuscany.apache.org/xmlns/sca/1.1}binding.rmi"/>
+ <arg value="-node"/>
+ <arg value="./server-config.xml"/>
+ <!-- Give the server 60 seconds to stay -->
+ <arg value="-ttl"/>
+ <arg value="60000"/>
+ </java>
+ </target>
+
+ <target name="run-cmdline">
+ <java classpath="../../../distribution/all/target/apache-tuscany-sca-all-2.0-SNAPSHOT.dir/tuscany-sca-2.0-SNAPSHOT/features/tuscany-sca-manifest.jar:./target/test-classes:../helloworld-iface/target/classes"
+ classname="itest.Service"
+ fork="true"
+ failonerror="true">
+ </java>
+ </target>
+
+</project>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-two-vms-hazelcast/src/test/java/itest/Client.java b/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-two-vms-hazelcast/src/test/java/itest/Client.java new file mode 100644 index 0000000000..5d884921fd --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-two-vms-hazelcast/src/test/java/itest/Client.java @@ -0,0 +1,56 @@ +/*
+ * 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.binding.rmi.RMIBinding;
+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?listen=127.0.0.1:14821"), "../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/testing/itest/nodes/two-nodes-two-vms-hazelcast/src/test/java/itest/SCAClient.java b/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-two-vms-hazelcast/src/test/java/itest/SCAClient.java new file mode 100644 index 0000000000..81af1c6b5b --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-two-vms-hazelcast/src/test/java/itest/SCAClient.java @@ -0,0 +1,66 @@ +/* + * 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 itest.nodes.Helloworld; + +import java.net.URI; + +import org.apache.tuscany.sca.binding.rmi.RMIBinding; +import org.apache.tuscany.sca.node.NodeFactory; +import org.oasisopen.sca.client.SCAClientFactory; + +public class SCAClient { + + public void testSCAClient() throws Exception { + // The configuration required when running with sca-client-rmi and endpoint-hazelcast-rmi + SCAClientFactory factory = SCAClientFactory.newInstance(URI.create("tuscanyclient:default?remotes=127.0.0.1:14820")); + + // The configuration required when running with sca-client-impl and endpoint-hazelcast + //SCAClientFactory factory = SCAClientFactory.newInstance(URI.create("tuscany:default")); + + // Sleep 3 seconds so that the endpoint is populated into the EndpointRegistry + //Thread.sleep(3000); + + Helloworld service = factory.getService(Helloworld.class, "HelloworldService"); + + String response = service.sayHello("test"); + if (response == null || !response.equals("Hello test")){ + throw new Exception("Test failed - expecting 'Hello test' got " + response); + } else { + System.out.println("Test success - " + response); + } + + //TODO - When using the hazelcast registry (or client) it causes the + // JVM to hang on shutdown as it created non-daemon threads + // So destroy the node factory here which should bring down + // the runtime and hence hazelcast. + // There's currently no interface on the client factory + // for doing this so we may need to talk to OASIS about adding one + // or just rely on the runtime hosting the classes using the SCAClient + // when it's on its way down + //NodeFactory.getInstance().destroy(); + } + + public static void main(String[] args) throws Exception { + SCAClient client = new SCAClient(); + client.testSCAClient(); + } +} diff --git a/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-two-vms-hazelcast/src/test/java/itest/Service.java b/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-two-vms-hazelcast/src/test/java/itest/Service.java new file mode 100644 index 0000000000..0c9659b0ef --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-two-vms-hazelcast/src/test/java/itest/Service.java @@ -0,0 +1,59 @@ +/*
+ * 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.binding.rmi.RMIBinding;
+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 {
+ // Stay for 1 min
+ Thread.sleep(60000);
+ }
+
+ @AfterClass
+ public static void tearDownAfterClass() throws Exception {
+ if (serviceNode != null) {
+ serviceNode.stop();
+ }
+ }
+
+ public static void main(String[] args) throws Exception {
+ Service.setUpBeforeClass();
+ new Service().testNothing();
+ Service.tearDownAfterClass();
+ }
+}
diff --git a/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-two-vms-test/build.xml b/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-two-vms-test/build.xml new file mode 100644 index 0000000000..fa7e963e87 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-two-vms-test/build.xml @@ -0,0 +1,38 @@ +<!-- + * 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 name="itest-samples" default="run"> + + <target name="run"> + + <parallel failonany="true"> + + <daemons> + <ant antfile="server.xml"/> + </daemons> + + <sequential> + <sleep seconds="10"/> + <ant antfile="client.xml"/> + </sequential> + + </parallel> + + </target> + +</project> diff --git a/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-two-vms-test/client-config.xml b/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-two-vms-test/client-config.xml new file mode 100644 index 0000000000..5afc1eddfa --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-two-vms-test/client-config.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. +--> +<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" + uri="http://sample/nodes/TestNode1" + domainRegistry = "tribes://228.0.0.100:50000" + domain="http://domain1"> + + <!-- Configure the base URIs for a given binding --> + <!-- Each base URI is for a protocol supported by the binding --> + <binding name="sca:binding.sca" baseURIs="http://localhost:8081/sca https://localhost:8081/sca"/> + <binding name="sca:binding.ws" baseURIs="http://localhost:8082/ws https://localhost:8082/ws"/> + + <!-- Configure a list of contributions --> + <contribution uri="iface" location="../helloworld-iface/target/itest-nodes-helloworld-iface-2.0-SNAPSHOT.jar"/> + <contribution uri="client" location="../helloworld-client/target/itest-nodes-helloworld-client-2.0-SNAPSHOT.jar"> + <!-- doesn't pick up the deployable composite properly without this?--> + <deploymentComposite location="helloworld-client.composite"/> + </contribution> + +</node>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-two-vms-test/client.xml b/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-two-vms-test/client.xml new file mode 100644 index 0000000000..8e7c744940 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-two-vms-test/client.xml @@ -0,0 +1,31 @@ +<!-- + * 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 name="server" default="run"> + + <!--echo>${runtime_classpath}</echo--> + + <target name="run"> + <java classpath="${runtime_classpath};./target/test-classes" + classname="itest.Client" + fork="true" + failonerror="true"> + </java> + </target> + +</project>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-two-vms-test/pom.xml b/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-two-vms-test/pom.xml new file mode 100644 index 0000000000..2f80274c47 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-two-vms-test/pom.xml @@ -0,0 +1,104 @@ +<?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-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + <artifactId>itest-nodes-two-nodes-two-vms-test</artifactId> + <name>Apache Tuscany SCA iTest Nodes Two Nodes Two VMs Test</name> + + <dependencies> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-domain-node</artifactId> + <version>2.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-endpoint-tribes</artifactId> + <version>2.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>itest-nodes-helloworld-iface</artifactId> + <version>2.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-node-impl</artifactId> + <version>2.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-node-launcher</artifactId> + <version>2.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-sca-client-impl</artifactId> + <version>2.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-java-runtime</artifactId> + <version>2.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-rmi-runtime</artifactId> + <version>2.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-host-jetty</artifactId> + <version>2.0-SNAPSHOT</version> + </dependency> + + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-antrun-plugin</artifactId> + <executions> + <execution> + <id>run-samples</id> + <phase>test</phase> + <goals> + <goal>run</goal> + </goals> + <configuration> + <tasks unless="maven.test.skip"> + <property name="tuscany.version" value="${version}" /> + <property name="runtime_classpath" refid="maven.runtime.classpath"/> + <ant antfile="./build.xml" target="run"/> + </tasks> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-two-vms-test/server-config.xml b/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-two-vms-test/server-config.xml new file mode 100644 index 0000000000..590cf3bddb --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-two-vms-test/server-config.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. +--> +<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" + uri="http://sample/nodes/TestNode2" + domainRegistry = "tribes://228.0.0.100:50000" + domain="http://domain1"> + + <!-- Configure the base URIs for a given binding --> + <!-- Each base URI is for a protocol supported by the binding --> + <binding name="sca:binding.sca" baseURIs="http://localhost:8081/sca https://localhost:8081/sca"/> + <binding name="sca:binding.ws" baseURIs="http://localhost:8082/ws https://localhost:8082/ws"/> + + <!-- Configure a list of contributions --> + <contribution uri="iface" location="../helloworld-iface/target/classes"/> + <contribution uri="service" location="../helloworld-service/target/classes"> + <!-- doesn't pick up the deployable composite properly without this?--> + <deploymentComposite location="helloworld-service.composite"/> + </contribution> + +</node>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-two-vms-test/server.xml b/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-two-vms-test/server.xml new file mode 100644 index 0000000000..05a5aa16e9 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-two-vms-test/server.xml @@ -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. +--> +<project name="server" default="run"> + + <!--echo>${runtime_classpath}</echo--> + + <target name="run"> + <java classpath="${runtime_classpath}" classname="org.apache.tuscany.sca.node.launcher.NodeMain" fork="true"> + <sysproperty key="org.apache.tuscany.sca.binding.sca.provider.SCABindingMapper.mappedBinding" value="{http://tuscany.apache.org/xmlns/sca/1.1}binding.rmi"/> + <arg value="-node"/> + <arg value="./server-config.xml"/> + <arg value="-ttl"/> + <arg value="15000"/> + </java> + </target> + +</project>
\ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-two-vms-test/src/test/java/itest/Client.java b/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-two-vms-test/src/test/java/itest/Client.java new file mode 100644 index 0000000000..eef3362c10 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-two-vms-test/src/test/java/itest/Client.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 itest;
+
+import java.io.File;
+
+import org.apache.tuscany.sca.binding.rmi.RMIBinding;
+import org.apache.tuscany.sca.domain.node.DomainNode;
+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;
+// private static DomainNode clientNode;
+
+ @BeforeClass
+ public static void setUpBeforeClass() throws Exception {
+ NodeFactory factory = NodeFactory.newInstance();
+
+ clientNode = factory.createNode(new File("client-config.xml").toURI().toURL());
+
+ try {
+ clientNode.start();
+ } catch (Exception ex){
+ ex.printStackTrace();
+ throw ex;
+ }
+
+// clientNode = new DomainNode("tribes:default", new String []{"../helloworld-client/target/itest-nodes-helloworld-client-2.0-SNAPSHOT.jar"});
+ }
+
+ @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/testing/itest/nodes/two-nodes-two-vms-test/src/test/java/itest/Service.java b/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-two-vms-test/src/test/java/itest/Service.java new file mode 100644 index 0000000000..7323c2c122 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/nodes/two-nodes-two-vms-test/src/test/java/itest/Service.java @@ -0,0 +1,61 @@ +/*
+ * 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.io.File;
+
+import org.apache.tuscany.sca.binding.rmi.RMIBinding;
+import org.apache.tuscany.sca.domain.node.DomainNode;
+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;
+// private static DomainNode serviceNode;
+
+ @BeforeClass
+ public static void setUpBeforeClass() throws Exception {
+ NodeFactory factory = NodeFactory.newInstance();
+
+ serviceNode = factory.createNode(new File("server-config.xml").toURI().toURL());
+ serviceNode.start();
+
+// serviceNode = new DomainNode("tribes:default", new String[]{"../helloworld-service/target/classes"});
+
+ }
+
+ @Test
+ public void testNothing() throws Exception {
+ synchronized (this) {
+ this.wait();
+ }
+ }
+
+ @AfterClass
+ public static void tearDownAfterClass() throws Exception {
+ if (serviceNode != null) {
+ serviceNode.stop();
+ }
+ }
+}
|