summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/testing/itest/interface-matching/src/test
diff options
context:
space:
mode:
authorslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2011-10-17 12:51:22 +0000
committerslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2011-10-17 12:51:22 +0000
commita206102be754cca89c3aa8b386f635521aa56bde (patch)
tree20f11f9fbe63dfd70d526d66d98ab3b1f7979e32 /sca-java-2.x/trunk/testing/itest/interface-matching/src/test
parent5dd0b6ca59173e1011eed91af21df729be1081df (diff)
TUSCANY-3958 - serialize endpoint intents/policy sets across the registry for matching purposes. In this change they are stashed in the component element on write and then retrieved back into the endpoint model on read.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1185135 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/testing/itest/interface-matching/src/test')
-rw-r--r--sca-java-2.x/trunk/testing/itest/interface-matching/src/test/java/org/apache/tuscany/sca/itest/interfaces/InerfaceMatchTestCase.java57
1 files changed, 51 insertions, 6 deletions
diff --git a/sca-java-2.x/trunk/testing/itest/interface-matching/src/test/java/org/apache/tuscany/sca/itest/interfaces/InerfaceMatchTestCase.java b/sca-java-2.x/trunk/testing/itest/interface-matching/src/test/java/org/apache/tuscany/sca/itest/interfaces/InerfaceMatchTestCase.java
index 4174a338c0..f4d5f009ed 100644
--- a/sca-java-2.x/trunk/testing/itest/interface-matching/src/test/java/org/apache/tuscany/sca/itest/interfaces/InerfaceMatchTestCase.java
+++ b/sca-java-2.x/trunk/testing/itest/interface-matching/src/test/java/org/apache/tuscany/sca/itest/interfaces/InerfaceMatchTestCase.java
@@ -35,7 +35,7 @@ import org.oasisopen.sca.ServiceRuntimeException;
public class InerfaceMatchTestCase {
/**
- * Non-remoteable client and service interfaces where the interfaces match.
+ * Non-remotable client and service interfaces where the interfaces match.
* Components running in the same composite/JVM, i.e. no remote registry
*
* @throws Exception
@@ -62,8 +62,8 @@ public class InerfaceMatchTestCase {
}
/**
- * Remoteable client and service interfaces where the interfaces match.
- * Components running in the seaprate composite/JVM, i.e. there is a remote registry
+ * Remotable client and service interfaces where the interfaces match.
+ * Components running in the separate composite/JVM, i.e. there is a remote registry
*
* @throws Exception
*/
@@ -84,7 +84,7 @@ public class InerfaceMatchTestCase {
"org/apache/tuscany/sca/itest/interfaces/match/distributed/MatchDistributedService.composite",
contributions);
- // for default binding on node2 to use a different port from node 1(which will default to 8080
+ // force default binding on node2 to use a different port from node 1(which will default to 8080
((NodeImpl)node2).getConfiguration().addBinding(WebServiceBinding.TYPE, "http://localhost:8081/");
((NodeImpl)node2).getConfiguration().addBinding(SCABinding.TYPE, "http://localhost:8081/");
node2.start();
@@ -112,7 +112,7 @@ public class InerfaceMatchTestCase {
}
/**
- * Remoteable client and service interfaces where the interfaces match but
+ * Remotable client and service interfaces where the interfaces match but
* where there is a parameter that can't be converted to/from XML using JAXB
* Components running in the separate composite/JVM, i.e. there is a remote registry
*
@@ -137,7 +137,7 @@ public class InerfaceMatchTestCase {
"org/apache/tuscany/sca/itest/interfaces/match/distributed/MatchNonJAXBDistributedService.composite",
contributions);
- // for default binding on node2 to use a different port from node 1(which will default to 8080
+ // force default binding on node2 to use a different port from node 1(which will default to 8080
// Don't need to do this as not testing callbacks here
//((NodeImpl)node2).getConfiguration().addBinding(WebServiceBinding.TYPE, "http://localhost:8081/");
//((NodeImpl)node2).getConfiguration().addBinding(SCABinding.TYPE, "http://localhost:8081/");
@@ -164,4 +164,49 @@ public class InerfaceMatchTestCase {
node1.stop();
node2.stop();
}
+
+ /**
+ * Remotable client and service interfaces where the interfaces match and the service has 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/match/distributed/MatchPolicyDistributedClient.composite",
+ contributions);
+ node1.start();
+
+ Node node2 = NodeFactory.newInstance().createNode(URI.create("uri:default"),
+ "org/apache/tuscany/sca/itest/interfaces/match/distributed/MatchPolicyDistributedService.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);
+ Assert.assertEquals("AComponent", response);
+ } catch (ServiceRuntimeException ex){
+ Assert.fail("Unexpected exception with foo " + ex.toString());
+ }
+
+ try {
+ local.callback("Callback");
+ String response = local.getCallbackValue();
+ Assert.assertEquals("Callback", response);
+ } catch (ServiceRuntimeException ex){
+ Assert.fail("Unexpected exception with callback" + ex.toString());
+ }
+
+ node1.stop();
+ node2.stop();
+ }
}