summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/testing/itest
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2012-01-31 15:42:24 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2012-01-31 15:42:24 +0000
commit8434e69c00ea11444c85479af5534cd052df3cd7 (patch)
tree0edd24985d1b865757771e53a3385cdc81f74e71 /sca-java-2.x/trunk/testing/itest
parentb0a656ba70a52c2aeffe80b77b80b99392b1c6a2 (diff)
Add a test for a component with a single service and multiple bindings
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1238669 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/testing/itest')
-rw-r--r--sca-java-2.x/trunk/testing/itest/scaclient-api/src/main/java/itest/RemotableHelloworldImpl.java29
-rw-r--r--sca-java-2.x/trunk/testing/itest/scaclient-api/src/main/resources/Helloworld.composite8
-rw-r--r--sca-java-2.x/trunk/testing/itest/scaclient-api/src/test/java/test/scaclient/SCAClientTestCase.java10
3 files changed, 47 insertions, 0 deletions
diff --git a/sca-java-2.x/trunk/testing/itest/scaclient-api/src/main/java/itest/RemotableHelloworldImpl.java b/sca-java-2.x/trunk/testing/itest/scaclient-api/src/main/java/itest/RemotableHelloworldImpl.java
new file mode 100644
index 0000000000..58968fbd47
--- /dev/null
+++ b/sca-java-2.x/trunk/testing/itest/scaclient-api/src/main/java/itest/RemotableHelloworldImpl.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;
+
+public class RemotableHelloworldImpl implements RemoteHelloworldService {
+
+ @Override
+ public String sayHelloRemote(String name) {
+ return "Remote hi " + name;
+ }
+
+}
diff --git a/sca-java-2.x/trunk/testing/itest/scaclient-api/src/main/resources/Helloworld.composite b/sca-java-2.x/trunk/testing/itest/scaclient-api/src/main/resources/Helloworld.composite
index 0be26056cc..70248d0a0c 100644
--- a/sca-java-2.x/trunk/testing/itest/scaclient-api/src/main/resources/Helloworld.composite
+++ b/sca-java-2.x/trunk/testing/itest/scaclient-api/src/main/resources/Helloworld.composite
@@ -46,4 +46,12 @@
</service>
</component>
+ <component name="MultipleBindingsSingleServiceComponent">
+ <implementation.java class="itest.RemotableHelloworldImpl"/>
+ <service name="RemoteHelloworldService">
+ <binding.ws name="ws" />
+ <binding.sca />
+ <tuscany:binding.rmi name="rmi" />
+ </service>
+ </component>
</composite>
diff --git a/sca-java-2.x/trunk/testing/itest/scaclient-api/src/test/java/test/scaclient/SCAClientTestCase.java b/sca-java-2.x/trunk/testing/itest/scaclient-api/src/test/java/test/scaclient/SCAClientTestCase.java
index ac3f3fd5a5..e15d5a2157 100644
--- a/sca-java-2.x/trunk/testing/itest/scaclient-api/src/test/java/test/scaclient/SCAClientTestCase.java
+++ b/sca-java-2.x/trunk/testing/itest/scaclient-api/src/test/java/test/scaclient/SCAClientTestCase.java
@@ -143,6 +143,16 @@ public class SCAClientTestCase extends TestCase {
assertEquals("Hello petra", service.sayHelloRemote("petra"));
}
+ @Test
+ public void testMultipleBindingsSingleService() throws Exception {
+ node = NodeFactory.getInstance().createNode(URI.create("myFooDomain"), new String[] {"target/classes"});
+ node.start();
+
+ SCAClientFactory clientFactory = SCAClientFactory.newInstance(URI.create("myFooDomain"));
+ RemoteHelloworldService service = clientFactory.getService(RemoteHelloworldService.class, "MultipleBindingsSingleServiceComponent");
+ assertEquals("Remote hi petra", service.sayHelloRemote("petra"));
+ }
+
// @Test @Ignore
// public void testHTTPURI() throws Exception {
// node = NodeFactory.getInstance().createNode(URI.create("http://defaultDomain"), new String[] {"target/classes"});