From ed8ec6354e647d4078f6a7f6a8caf409f3774bcd Mon Sep 17 00:00:00 2001 From: slaws Date: Fri, 19 Aug 2011 12:38:10 +0000 Subject: Add miss-matched local interface. Accept for the time being that interface matching for remote java interfaces is rather lenient when Java beans are involved. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1159615 13f79535-47bb-0310-9956-ffa450edef68 --- .../interfaces/InerfaceMissmatchTestCase.java | 36 +++++++++++++++++++--- 1 file changed, 32 insertions(+), 4 deletions(-) (limited to 'sca-java-2.x/trunk/testing/itest/interface-matching/src/test') 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 4ccdc0593c..a15ba144b4 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 @@ -30,11 +30,10 @@ import org.junit.Test; import org.oasisopen.sca.ServiceRuntimeException; public class InerfaceMissmatchTestCase { - + + @Test - @Ignore("Interfaces are not detected as being incompatible") public void testLocal() throws Exception { - String [] contributions = {"./target/classes"}; Node node1 = NodeFactory.newInstance().createNode(URI.create("tuscany:InerfaceMissmatchTestCase"), "org/apache/tuscany/sca/itest/interfaces/missmatch/local/MissmatchLocal.composite", @@ -50,11 +49,37 @@ public class InerfaceMissmatchTestCase { } catch (ServiceRuntimeException ex){ Assert.assertTrue(ex.getMessage().startsWith("Unable to bind []")); } + + node1.stop(); + + } + + @Test + public void testNonDistributedRemotable() throws Exception { + + String [] contributions = {"./target/classes"}; + Node node1 = NodeFactory.newInstance().createNode(URI.create("tuscany:InerfaceMissmatchTestCase"), + "org/apache/tuscany/sca/itest/interfaces/missmatch/local/MissmatchRemoteable.composite", + contributions); + node1.start(); + + ClientComponent local = node1.getService(ClientComponent.class, "LocalClientComponent"); + ParameterObject po = new ParameterObject(); + + try { + local.foo1(po); + } catch (ServiceRuntimeException ex){ + //Assert.assertTrue(ex.getMessage().startsWith("Unable to bind []")); + Assert.fail("It seems that the matching process can't tell that these don't match as it has a " + + "String on one side and a complex type (Java Object) on the other"); + } + + node1.stop(); } @Test - public void testDistributed() throws Exception { + public void testDistributedRemotable() throws Exception { String [] contributions = {"./target/classes"}; Node node1 = NodeFactory.newInstance().createNode(URI.create("tuscany:InerfaceMissmatchTestCase"), @@ -76,6 +101,9 @@ public class InerfaceMissmatchTestCase { } catch (ServiceRuntimeException ex){ Assert.assertTrue(ex.getMessage().startsWith("Unable to bind []")); } + + node1.stop(); + node2.stop(); } } -- cgit v1.2.3