summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/testing/itest/interface-matching/src
diff options
context:
space:
mode:
authorslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2011-10-17 12:55:31 +0000
committerslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2011-10-17 12:55:31 +0000
commit7d550f3ba9d89ba24b44fa4f2ee7eff519bdaaa2 (patch)
tree87243994de2f86ca08fd95a8fcd4226a102e3bdf /sca-java-2.x/trunk/testing/itest/interface-matching/src
parenta206102be754cca89c3aa8b386f635521aa56bde (diff)
TUSCANY-3959 - Correct interface matching so that it takes account of mayProvides intents.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1185139 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/testing/itest/interface-matching/src')
-rw-r--r--sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/apache/tuscany/sca/itest/interfaces/missmatch/distributed/MissmatchPolicyDistributedClient.composite30
-rw-r--r--sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/apache/tuscany/sca/itest/interfaces/missmatch/distributed/MissmatchPolicyDistributedService.composite31
-rw-r--r--sca-java-2.x/trunk/testing/itest/interface-matching/src/test/java/org/apache/tuscany/sca/itest/interfaces/InerfaceMissmatchTestCase.java41
3 files changed, 101 insertions, 1 deletions
diff --git a/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/apache/tuscany/sca/itest/interfaces/missmatch/distributed/MissmatchPolicyDistributedClient.composite b/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/apache/tuscany/sca/itest/interfaces/missmatch/distributed/MissmatchPolicyDistributedClient.composite
new file mode 100644
index 0000000000..b8f51c9afc
--- /dev/null
+++ b/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/apache/tuscany/sca/itest/interfaces/missmatch/distributed/MissmatchPolicyDistributedClient.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"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:foo="http://foo" targetNamespace="http://foo"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ name="MissmatchPolicyDistributedClient" >
+
+ <component name="DistributedClientComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.interfaces.ClientComponentImpl" />
+ <reference name="aCallBackService" target="DistributedServiceComponent" requires="sca:SOAP.v1_2"/>
+ </component>
+
+</composite> \ No newline at end of file
diff --git a/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/apache/tuscany/sca/itest/interfaces/missmatch/distributed/MissmatchPolicyDistributedService.composite b/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/apache/tuscany/sca/itest/interfaces/missmatch/distributed/MissmatchPolicyDistributedService.composite
new file mode 100644
index 0000000000..a90d9e0a3f
--- /dev/null
+++ b/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/apache/tuscany/sca/itest/interfaces/missmatch/distributed/MissmatchPolicyDistributedService.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"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:foo="http://foo" targetNamespace="http://foo"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ name="MissmatchPolicyDistributedService" >
+
+ <component name="DistributedServiceComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.interfaces.ServiceComponentImpl" />
+ <service name="ServiceComponent" requires="authentication">
+ <binding.ws/>
+ </service>
+ </component>
+</composite> \ No newline at end of file
diff --git a/sca-java-2.x/trunk/testing/itest/interface-matching/src/test/java/org/apache/tuscany/sca/itest/interfaces/InerfaceMissmatchTestCase.java b/sca-java-2.x/trunk/testing/itest/interface-matching/src/test/java/org/apache/tuscany/sca/itest/interfaces/InerfaceMissmatchTestCase.java
index 0c54e5f8e7..f12be0247f 100644
--- a/sca-java-2.x/trunk/testing/itest/interface-matching/src/test/java/org/apache/tuscany/sca/itest/interfaces/InerfaceMissmatchTestCase.java
+++ b/sca-java-2.x/trunk/testing/itest/interface-matching/src/test/java/org/apache/tuscany/sca/itest/interfaces/InerfaceMissmatchTestCase.java
@@ -201,6 +201,45 @@ public class InerfaceMissmatchTestCase {
node2.stop();
Assert.assertTrue(ex.getMessage().startsWith("Unable to bind []"));
}
-
}
+
+ /**
+ * Remotable client and service interfaces where the interfaces match and the service and reference
+ * have missmatching policy.
+ * Components running in the separate composite/JVM, i.e. there is a remote registry
+ *
+ * @throws Exception
+ */
+ @Test
+ public void testPolicyDistributedRemotable() throws Exception {
+
+
+ String [] contributions = {"./target/classes"};
+ Node node1 = NodeFactory.newInstance().createNode(URI.create("uri:default"),
+ "org/apache/tuscany/sca/itest/interfaces/missmatch/distributed/MissmatchPolicyDistributedClient.composite",
+ contributions);
+ node1.start();
+
+ Node node2 = NodeFactory.newInstance().createNode(URI.create("uri:default"),
+ "org/apache/tuscany/sca/itest/interfaces/missmatch/distributed/MissmatchPolicyDistributedService.composite",
+ contributions);
+ // force binding.ws on node2 to use a different port from node 1(which will default to 8080
+ ((NodeImpl)node2).getConfiguration().addBinding(WebServiceBinding.TYPE, "http://localhost:8081/");
+ node2.start();
+
+ ClientComponent local = node1.getService(ClientComponent.class, "DistributedClientComponent");
+ ParameterObject po = new ParameterObject();
+
+ try {
+ String response = local.foo1(po);
+ node1.stop();
+ node2.stop();
+ Assert.fail("Expected exception indicating that interfaces don't match");
+ } catch (ServiceRuntimeException ex){
+ node1.stop();
+ node2.stop();
+ Assert.assertTrue(ex.getMessage().startsWith("Unable to bind []"));
+ }
+
+ }
}