summaryrefslogtreecommitdiffstats
path: root/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org
diff options
context:
space:
mode:
Diffstat (limited to 'sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org')
-rw-r--r--sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/AsynchTestCase.java74
-rw-r--r--sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/BaseTest.java96
-rw-r--r--sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/CallbackTestCase.java82
-rw-r--r--sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/PromotionTestCase.java76
-rw-r--r--sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/SimpleTestCase.java108
-rw-r--r--sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/TestDistributedSCADomainImpl.java124
-rw-r--r--sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/TestServiceDiscoveryImpl.java140
-rw-r--r--sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldCallbackRemote.java29
-rw-r--r--sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldClient.java27
-rw-r--r--sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceCallbackOnewayRemote.java33
-rw-r--r--sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceCallbackRemote.java31
-rw-r--r--sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceLocal.java27
-rw-r--r--sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceRemote.java29
-rw-r--r--sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceRemote2.java29
-rw-r--r--sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientCallbackOnewayRemoteImpl.java44
-rw-r--r--sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientCallbackRemoteImpl.java42
-rw-r--r--sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientLocalImpl.java36
-rw-r--r--sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientRemote2Impl.java37
-rw-r--r--sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientRemoteImpl.java36
-rw-r--r--sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceCallbackOnewayRemoteImpl.java36
-rw-r--r--sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceCallbackRemoteImpl.java35
-rw-r--r--sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceLocalImpl.java30
-rw-r--r--sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceMultipleServicesImpl.java41
-rw-r--r--sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceRemoteImpl.java30
24 files changed, 1272 insertions, 0 deletions
diff --git a/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/AsynchTestCase.java b/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/AsynchTestCase.java
new file mode 100644
index 0000000000..dc52e1710d
--- /dev/null
+++ b/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/AsynchTestCase.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.binding.sca.axis2.helloworld.impl.HelloWorldClientCallbackOnewayRemoteImpl;
+import org.apache.tuscany.sca.host.embedded.impl.EmbeddedSCADomain;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class AsynchTestCase extends BaseTest {
+
+ public static EmbeddedSCADomain domainA;
+ public static EmbeddedSCADomain domainB;
+
+ @BeforeClass
+ public static void init() throws Exception {
+ System.out.println("Setting up distributed nodes");
+
+ try {
+ // create and start domainA
+ domainA = createDomain("nodeG");
+ domainB = createDomain("nodeH");
+ startDomain(domainA);
+ startDomain(domainB);
+
+ } 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 {
+ // stop the nodes and hence the domains they contain
+ stopDomain(domainA);
+ stopDomain(domainB);
+ }
+
+ @Test
+ public void testHelloWorldAsynch() throws Exception {
+ HelloWorldClient helloWorldClientB;
+ helloWorldClientB = domainA.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-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/BaseTest.java b/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/BaseTest.java
new file mode 100644
index 0000000000..fd72232dbd
--- /dev/null
+++ b/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/BaseTest.java
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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 java.net.URL;
+
+import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceLocal;
+import org.apache.tuscany.sca.contribution.Contribution;
+import org.apache.tuscany.sca.contribution.service.ContributionService;
+import org.apache.tuscany.sca.distributed.domain.DistributedSCADomain;
+import org.apache.tuscany.sca.host.embedded.impl.EmbeddedSCADomain;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+
+public class BaseTest {
+
+ public static String DEFULT_DOMAIN_NAME = "mydomain";
+
+ public static EmbeddedSCADomain createDomain(String nodeName) throws Exception {
+ ClassLoader cl = BaseTest.class.getClassLoader();
+ EmbeddedSCADomain domain = null;
+
+ try {
+ // Create the distributed domain representation
+ TestDistributedSCADomainImpl distributedDomain = new TestDistributedSCADomainImpl(DEFULT_DOMAIN_NAME);
+ distributedDomain.setNodeName(nodeName);
+
+ // create and start domainA
+ domain = new EmbeddedSCADomain(cl, DEFULT_DOMAIN_NAME);
+ domain.start();
+
+ // add a contribution to the domain
+ ContributionService contributionService = domain.getContributionService();
+
+ // find the current directory as a URL. This is where our contribution
+ // will come from
+ URL contributionURL = Thread.currentThread().getContextClassLoader().getResource(nodeName + "/");
+
+ // Contribute the SCA application
+ Contribution contribution = contributionService.contribute("http://calculator", contributionURL, null, //resolver,
+ false);
+ Composite composite = contribution.getDeployables().get(0);
+
+ // Add the deployable composite to the domain
+ domain.getDomainComposite().getIncludes().add(composite);
+ domain.getCompositeBuilder().build(composite);
+
+ distributedDomain.addDistributedDomainToBindings(composite);
+
+ domain.getCompositeActivator().activate(composite);
+ } catch (Exception ex) {
+ System.err.println("Exception when creating domain " + ex.getMessage());
+ ex.printStackTrace(System.err);
+ throw ex;
+ }
+ return domain;
+ }
+
+ public static void startDomain(EmbeddedSCADomain domain)
+ throws Exception {
+ try {
+ // Start domain
+ for (Composite composite : domain.getDomainComposite().getIncludes()) {
+ domain.getCompositeActivator().start(composite);
+ }
+
+ } catch (Exception ex) {
+ System.err.println("Exception when creating domain " + ex.getMessage());
+ ex.printStackTrace(System.err);
+ throw ex;
+ }
+ }
+
+ public static void stopDomain(EmbeddedSCADomain domain) throws Exception {
+ // stop the domain
+ domain.stop();
+ }
+
+}
diff --git a/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/CallbackTestCase.java b/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/CallbackTestCase.java
new file mode 100644
index 0000000000..b43c127301
--- /dev/null
+++ b/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/CallbackTestCase.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 org.apache.tuscany.sca.binding.sca.axis2;
+
+import java.net.URL;
+
+import junit.framework.Assert;
+
+import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldClient;
+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.contribution.Contribution;
+import org.apache.tuscany.sca.contribution.service.ContributionService;
+import org.apache.tuscany.sca.distributed.domain.DistributedSCADomain;
+import org.apache.tuscany.sca.host.embedded.impl.EmbeddedSCADomain;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class CallbackTestCase extends BaseTest {
+
+ public static EmbeddedSCADomain domainA;
+ public static EmbeddedSCADomain domainB;
+
+ @BeforeClass
+ public static void init() throws Exception {
+ System.out.println("Setting up distributed nodes");
+
+ try {
+ // create and start domainA
+ domainA = createDomain("nodeE");
+ domainB = createDomain("nodeF");
+ startDomain(domainA);
+ startDomain(domainB);
+
+ } 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 {
+ // stop the nodes and hence the domains they contain
+ stopDomain(domainA);
+ stopDomain(domainB);
+ }
+
+ //@Test
+ public void testHelloWorldCallbackLocal() throws Exception {
+ HelloWorldClient helloWorldClientB;
+ helloWorldClientB = domainB.getService(HelloWorldClient.class, "BHelloWorldClientCallbackLocal");
+ Assert.assertEquals("Hello callback fred", helloWorldClientB.getGreetings("fred"));
+ }
+
+ @Test
+ public void testHelloWorldCallbackRemote() throws Exception {
+ HelloWorldClient helloWorldClientA;
+ helloWorldClientA = domainA.getService(HelloWorldClient.class, "AHelloWorldClientCallbackRemote");
+ Assert.assertEquals("Hello callback fred", helloWorldClientA.getGreetings("fred"));
+
+ }
+
+}
diff --git a/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/PromotionTestCase.java b/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/PromotionTestCase.java
new file mode 100644
index 0000000000..1814a2959c
--- /dev/null
+++ b/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/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.axis2;
+
+import java.net.URL;
+
+import junit.framework.Assert;
+
+import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldClient;
+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.contribution.Contribution;
+import org.apache.tuscany.sca.contribution.service.ContributionService;
+import org.apache.tuscany.sca.distributed.domain.DistributedSCADomain;
+import org.apache.tuscany.sca.host.embedded.impl.EmbeddedSCADomain;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class PromotionTestCase extends BaseTest {
+
+ public static EmbeddedSCADomain domainA;
+ public static EmbeddedSCADomain domainB;
+
+ @BeforeClass
+ public static void init() throws Exception {
+ System.out.println("Setting up distributed nodes");
+
+ try {
+ // create and start domainA
+ domainA = createDomain("nodeC");
+ domainB = createDomain("nodeD");
+ startDomain(domainA);
+ startDomain(domainB);
+
+ } 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 {
+ // stop the nodes and hence the domains they contain
+ stopDomain(domainA);
+ stopDomain(domainB);
+ }
+
+ @Test
+ public void testHelloWorldPromotion() throws Exception {
+/*
+ HelloWorldClient helloWorldClientA;
+ helloWorldClientA = domainA.getService(HelloWorldClient.class, "AHelloWorldClientRemotePromotion");
+ Assert.assertEquals(helloWorldClientA.getGreetings("fred"), "Hello fred");
+*/
+ }
+
+}
diff --git a/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/SimpleTestCase.java b/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/SimpleTestCase.java
new file mode 100644
index 0000000000..a58a32dc4c
--- /dev/null
+++ b/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/SimpleTestCase.java
@@ -0,0 +1,108 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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 java.net.URL;
+
+import junit.framework.Assert;
+
+import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldClient;
+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.contribution.Contribution;
+import org.apache.tuscany.sca.contribution.service.ContributionService;
+import org.apache.tuscany.sca.distributed.domain.DistributedSCADomain;
+import org.apache.tuscany.sca.host.embedded.impl.EmbeddedSCADomain;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class SimpleTestCase extends BaseTest {
+
+ public static EmbeddedSCADomain domainA;
+ public static EmbeddedSCADomain domainB;
+
+ @BeforeClass
+ public static void init() throws Exception {
+ System.out.println("Setting up distributed nodes");
+
+ try {
+ // create and start domainA
+ domainA = createDomain("nodeA");
+ domainB = createDomain("nodeB");
+ startDomain(domainA);
+ startDomain(domainB);
+
+ } 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 {
+ // stop the nodes and hence the domains they contain
+ stopDomain(domainA);
+ stopDomain(domainB);
+ }
+
+ @Test
+ public void testHelloWorldLocal() throws Exception {
+ HelloWorldClient helloWorldClientA = domainA.getService(HelloWorldClient.class, "AHelloWorldClientLocal");
+ Assert.assertEquals(helloWorldClientA.getGreetings("fred"), "Hello fred");
+
+ }
+
+ @Test
+ public void testHelloWorldRemote() throws Exception {
+ HelloWorldClient helloWorldClientA;
+ helloWorldClientA = domainA.getService(HelloWorldClient.class, "AHelloWorldClientRemote");
+ Assert.assertEquals(helloWorldClientA.getGreetings("fred"), "Hello fred");
+
+ }
+
+ @Test
+ public void testHelloWorldLocalAndRemote() throws Exception {
+ HelloWorldClient helloWorldClientA = domainA.getService(HelloWorldClient.class, "AHelloWorldClientLocalAndRemote");
+ HelloWorldClient helloWorldClientB = domainB.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 = domainA.getService(HelloWorldClient.class, "AHelloWorldClientMultipleServices");
+ HelloWorldClient helloWorldClientA2 = domainA.getService(HelloWorldClient.class, "AHelloWorldClientMultipleServices2");
+ HelloWorldClient helloWorldClientB = domainB.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 = domainA.getService(HelloWorldClient.class, "AHelloWorldClientMultipleBindings");
+ Assert.assertEquals(helloWorldClientA.getGreetings("fred"), "Hello fred");
+
+ }
+
+}
diff --git a/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/TestDistributedSCADomainImpl.java b/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/TestDistributedSCADomainImpl.java
new file mode 100644
index 0000000000..177fee62f8
--- /dev/null
+++ b/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/TestDistributedSCADomainImpl.java
@@ -0,0 +1,124 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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 org.apache.tuscany.sca.assembly.Binding;
+import org.apache.tuscany.sca.assembly.Component;
+import org.apache.tuscany.sca.assembly.ComponentReference;
+import org.apache.tuscany.sca.assembly.ComponentService;
+import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.assembly.SCABinding;
+import org.apache.tuscany.sca.binding.sca.impl.SCABindingImpl;
+import org.apache.tuscany.sca.distributed.domain.DistributedSCADomain;
+import org.apache.tuscany.sca.distributed.management.ServiceDiscovery;
+
+/**
+ * A local representation of the sca domain distributed across a number
+ * of separate nodes. This provides access to various information relating
+ * to the distributed domain
+ *
+ * @version $Rev: 552343 $ $Date: 2007-07-01 18:43:40 +0100 (Sun, 01 Jul 2007) $
+ */
+public class TestDistributedSCADomainImpl implements DistributedSCADomain {
+
+ private String nodeName;
+ private String domainName;
+ private static ServiceDiscovery serviceDiscovery;
+
+ public TestDistributedSCADomainImpl(String domainName){
+ this.domainName = domainName;
+
+ if (serviceDiscovery == null) {
+ serviceDiscovery = new TestServiceDiscoveryImpl();
+ }
+ }
+
+ /**
+ * Returns the name of the node that this part of the
+ * distributed domain is running on
+ *
+ * @return the node name
+ */
+ public String getNodeName(){
+ return nodeName;
+ }
+
+ public void setNodeName(String nodeName){
+ this.nodeName = nodeName;
+ }
+
+ public String getDomainName(){
+ return domainName;
+ }
+
+ public void setDomainName(String domainName){
+ this.domainName = domainName;
+ }
+
+ public ServiceDiscovery getServiceDiscovery(){
+ return serviceDiscovery;
+ }
+
+ public void addDistributedDomainToBindings(Composite composite){
+ // traverse the composite adding in the distributed domain
+ // reference into all sca bindings.
+ for(Component component : composite.getComponents()){
+ for (ComponentService service : component.getServices()) {
+ for(Binding binding : service.getBindings()){
+ if (binding instanceof SCABinding) {
+ // TODO could do with changing the sca binding SPI
+ // to carry this piece of information
+ SCABindingImpl scaBinding = (SCABindingImpl)binding;
+ scaBinding.setDistributedDomain(this);
+ }
+ }
+ }
+
+ for (ComponentReference reference : component.getReferences()) {
+ for(Binding binding : reference.getBindings()){
+ if (binding instanceof SCABinding) {
+ // TODO could do with changing the sca binding SPI
+ // to carry this piece of information
+ SCABindingImpl scaBinding = (SCABindingImpl)binding;
+ scaBinding.setDistributedDomain(this);
+ }
+ }
+
+ // and reference targets. strange one this but the wiring puts
+ // all the bindings into a references target if the target remains
+ // unresolved after building
+ // This actually the only ones we really need to set as by now
+ // the service and reference bindings will already be resolved
+ // but it's not doing any hame for the time being
+ for ( ComponentService target : reference.getTargets()){
+ for(Binding binding : target.getBindings()){
+ if (binding instanceof SCABinding) {
+ // TODO could do with changing the sca binding SPI
+ // to carry this piece of information
+ SCABindingImpl scaBinding = (SCABindingImpl)binding;
+ scaBinding.setDistributedDomain(this);
+ }
+ }
+ }
+ }
+ }
+ }
+
+}
diff --git a/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/TestServiceDiscoveryImpl.java b/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/TestServiceDiscoveryImpl.java
new file mode 100644
index 0000000000..0aa3cd27a3
--- /dev/null
+++ b/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/TestServiceDiscoveryImpl.java
@@ -0,0 +1,140 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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 java.util.ArrayList;
+import java.util.List;
+
+import org.apache.tuscany.sca.distributed.management.ServiceDiscovery;
+
+
+/**
+ * Stores details of services exposed and retrieves details of remote services
+ *
+ * @version $Rev: 552343 $ $Date: 2007-07-01 18:43:40 +0100 (Sun, 01 Jul 2007) $
+ */
+public class TestServiceDiscoveryImpl implements ServiceDiscovery{
+
+ List<ServiceEndpoint> serviceEndpoints = new ArrayList<ServiceEndpoint>();
+
+ public class ServiceEndpoint {
+ private String domainUri;
+ private String nodeUri;
+ private String serviceName;
+ private String bindingName;
+ private String url;
+
+ public ServiceEndpoint(String domainUri, String nodeUri, String serviceName, String bindingName, String URL){
+ this.domainUri = domainUri;
+ this.nodeUri = nodeUri;
+ this.serviceName = serviceName;
+ this.bindingName = bindingName;
+ this.url = URL;
+ }
+
+ public boolean match(String domainUri, String serviceName, String bindingName) {
+ // trap the case where the we are trying to map
+ // ComponentName/Service name with a registered ComponentName - this is OK
+ // ComponentName with a registered ComponentName/ServiceName - this should fail
+
+ boolean serviceNameMatch = false;
+
+ if (this.serviceName.equals(serviceName)) {
+ serviceNameMatch = true;
+ } else {
+ int s = serviceName.indexOf('/');
+ if ((s != -1) &&
+ (this.serviceName.equals(serviceName.substring(0, s)))){
+ serviceNameMatch = true;
+ }
+ }
+
+ return ((this.domainUri.equals(domainUri)) &&
+ (serviceNameMatch) &&
+ (this.bindingName.equals(bindingName)));
+ }
+
+ public String getUrl() {
+ return url;
+ }
+
+ @Override
+ public String toString (){
+ return "[" +
+ domainUri + " " +
+ nodeUri + " " +
+ serviceName + " " +
+ bindingName + " " +
+ url +
+ "]";
+ }
+ }
+
+ /**
+ * Accepts information about a service endpoint and holds onto it
+ *
+ * @param domainUri the string uri for the distributed domain
+ * @param nodeUri the string uri for the current node
+ * @param serviceName the name of the service that is exposed and the provided endpoint
+ * @param bindingName the remote binding that is providing the endpoint
+ * @param url the enpoint url
+ */
+ public String registerServiceEndpoint(String domainUri, String nodeUri, String serviceName, String bindingName, String URL){
+ // if the service name ends in a "/" remove it
+ String modifiedServiceName = null;
+ if ( serviceName.endsWith("/") ) {
+ modifiedServiceName = serviceName.substring(0, serviceName.length() - 1);
+ } else {
+ modifiedServiceName = serviceName;
+ }
+ ServiceEndpoint serviceEndpoint = new ServiceEndpoint (domainUri, nodeUri, modifiedServiceName, bindingName, URL);
+ serviceEndpoints.add(serviceEndpoint);
+ System.err.println("Registering service: " + serviceEndpoint.toString());
+ return "";
+ }
+
+
+ /**
+ * Locates information about a service endpoint
+ *
+ * @param domainUri the string uri for the distributed domain
+ * @param serviceName the name of the service that is exposed and the provided endpoint
+ * @param bindingName the remote binding that we want to find an endpoint for
+ * @return url the endpoint url
+ */
+ public String findServiceEndpoint(String domainUri, String serviceName, String bindingName){
+ System.err.println("Finding service: [" +
+ domainUri + " " +
+ serviceName + " " +
+ bindingName +
+ "]");
+
+ String url = null;
+
+ for(ServiceEndpoint serviceEndpoint : serviceEndpoints){
+ if ( serviceEndpoint.match(domainUri, serviceName, bindingName)){
+ url = serviceEndpoint.getUrl();
+ System.err.println("Matching service url: " + url);
+ }
+ }
+ return url;
+ }
+
+}
diff --git a/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldCallbackRemote.java b/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldCallbackRemote.java
new file mode 100644
index 0000000000..4db846cdf2
--- /dev/null
+++ b/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldCallbackRemote.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.osoa.sca.annotations.Remotable;
+
+@Remotable
+public interface HelloWorldCallbackRemote {
+
+ public String getGreetingsCallbackRemote(String s);
+
+}
diff --git a/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldClient.java b/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldClient.java
new file mode 100644
index 0000000000..d4d743648c
--- /dev/null
+++ b/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/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 {
+
+ public String getGreetings(String s);
+
+}
diff --git a/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceCallbackOnewayRemote.java b/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceCallbackOnewayRemote.java
new file mode 100644
index 0000000000..0415368c20
--- /dev/null
+++ b/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/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.osoa.sca.annotations.Callback;
+import org.osoa.sca.annotations.OneWay;
+import org.osoa.sca.annotations.Remotable;
+
+@Remotable
+@Callback(HelloWorldCallbackRemote.class)
+public interface HelloWorldServiceCallbackOnewayRemote {
+
+ @OneWay
+ public void getGreetingsRemote(String s);
+
+}
diff --git a/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceCallbackRemote.java b/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceCallbackRemote.java
new file mode 100644
index 0000000000..23861bdf9f
--- /dev/null
+++ b/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/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.osoa.sca.annotations.Callback;
+import org.osoa.sca.annotations.Remotable;
+
+@Remotable
+@Callback(HelloWorldCallbackRemote.class)
+public interface HelloWorldServiceCallbackRemote {
+
+ public String getGreetingsRemote(String s);
+
+}
diff --git a/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceLocal.java b/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceLocal.java
new file mode 100644
index 0000000000..157fcc5251
--- /dev/null
+++ b/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/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 {
+
+ public String getGreetingsLocal(String s);
+
+}
diff --git a/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceRemote.java b/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceRemote.java
new file mode 100644
index 0000000000..46373ce90d
--- /dev/null
+++ b/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/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.osoa.sca.annotations.Remotable;
+
+@Remotable
+public interface HelloWorldServiceRemote {
+
+ public String getGreetingsRemote(String s);
+
+}
diff --git a/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceRemote2.java b/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceRemote2.java
new file mode 100644
index 0000000000..ef34c87fc0
--- /dev/null
+++ b/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/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.osoa.sca.annotations.Remotable;
+
+@Remotable
+public interface HelloWorldServiceRemote2 {
+
+ public String getGreetingsRemote2(String s);
+
+}
diff --git a/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientCallbackOnewayRemoteImpl.java b/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientCallbackOnewayRemoteImpl.java
new file mode 100644
index 0000000000..ed76b45f67
--- /dev/null
+++ b/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientCallbackOnewayRemoteImpl.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceCallbackRemote;
+import org.osoa.sca.annotations.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-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientCallbackRemoteImpl.java b/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientCallbackRemoteImpl.java
new file mode 100644
index 0000000000..7d07c4ff43
--- /dev/null
+++ b/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/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.osoa.sca.annotations.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-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientLocalImpl.java b/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientLocalImpl.java
new file mode 100644
index 0000000000..0e1f07f3f2
--- /dev/null
+++ b/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientLocalImpl.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.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.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceRemote;
+import org.osoa.sca.annotations.Reference;
+
+public class HelloWorldClientLocalImpl implements HelloWorldClient {
+
+ @Reference
+ public HelloWorldServiceLocal helloWorldService;
+
+ public String getGreetings(String s) {
+ return helloWorldService.getGreetingsLocal(s);
+ }
+
+}
diff --git a/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientRemote2Impl.java b/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientRemote2Impl.java
new file mode 100644
index 0000000000..804d1f1910
--- /dev/null
+++ b/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientRemote2Impl.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceRemote;
+import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceRemote2;
+import org.osoa.sca.annotations.Reference;
+
+public class HelloWorldClientRemote2Impl implements HelloWorldClient {
+
+ @Reference
+ public HelloWorldServiceRemote2 helloWorldService;
+
+ public String getGreetings(String s) {
+ return helloWorldService.getGreetingsRemote2(s);
+ }
+
+}
diff --git a/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientRemoteImpl.java b/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientRemoteImpl.java
new file mode 100644
index 0000000000..ad83358b39
--- /dev/null
+++ b/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientRemoteImpl.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.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.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceRemote;
+import org.osoa.sca.annotations.Reference;
+
+public class HelloWorldClientRemoteImpl implements HelloWorldClient {
+
+ @Reference
+ public HelloWorldServiceRemote helloWorldService;
+
+ public String getGreetings(String s) {
+ return helloWorldService.getGreetingsRemote(s);
+ }
+
+}
diff --git a/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceCallbackOnewayRemoteImpl.java b/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceCallbackOnewayRemoteImpl.java
new file mode 100644
index 0000000000..fd3e3a1158
--- /dev/null
+++ b/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceCallbackOnewayRemoteImpl.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.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.osoa.sca.annotations.Callback;
+
+
+public class HelloWorldServiceCallbackOnewayRemoteImpl implements HelloWorldServiceCallbackOnewayRemote {
+
+ @Callback
+ protected HelloWorldCallbackRemote theCallback;
+
+ public void getGreetingsRemote(String s) {
+ theCallback.getGreetingsCallbackRemote(s);
+ }
+
+}
diff --git a/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceCallbackRemoteImpl.java b/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceCallbackRemoteImpl.java
new file mode 100644
index 0000000000..3400e97447
--- /dev/null
+++ b/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceCallbackRemoteImpl.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.HelloWorldServiceCallbackRemote;
+import org.osoa.sca.annotations.Callback;
+
+public class HelloWorldServiceCallbackRemoteImpl implements HelloWorldServiceCallbackRemote {
+
+ @Callback
+ protected HelloWorldCallbackRemote theCallback;
+
+ public String getGreetingsRemote(String s) {
+ return "Hello " + theCallback.getGreetingsCallbackRemote(s);
+ }
+
+}
diff --git a/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceLocalImpl.java b/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceLocalImpl.java
new file mode 100644
index 0000000000..20dd97b74a
--- /dev/null
+++ b/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/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-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceMultipleServicesImpl.java b/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceMultipleServicesImpl.java
new file mode 100644
index 0000000000..5f8ccf9466
--- /dev/null
+++ b/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/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.osoa.sca.annotations.Service;
+
+@Service(interfaces={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-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceRemoteImpl.java b/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceRemoteImpl.java
new file mode 100644
index 0000000000..b25aebd9df
--- /dev/null
+++ b/sca-java-1.x/tags/0.99-incubating/modules/binding-sca-axis2/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;
+ }
+
+}