diff options
Diffstat (limited to 'sca-java-2.x/trunk/testing/itest')
3 files changed, 31 insertions, 2 deletions
diff --git a/sca-java-2.x/trunk/testing/itest/data-copy/client/src/main/resources/helloworld-client.composite b/sca-java-2.x/trunk/testing/itest/data-copy/client/src/main/resources/helloworld-client.composite index 461ec33c89..5108e1eae1 100644 --- a/sca-java-2.x/trunk/testing/itest/data-copy/client/src/main/resources/helloworld-client.composite +++ b/sca-java-2.x/trunk/testing/itest/data-copy/client/src/main/resources/helloworld-client.composite @@ -22,10 +22,17 @@ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1" targetNamespace="http://itest"
name="ClientComposite">
- <component name="ClientSCA">
+ <component name="ClientSCAAlternative">
<implementation.java class="itest.client.impl.ClientImpl"/>
<reference name="service" target="Service"/>
</component>
+
+ <component name="ClientSCA">
+ <implementation.java class="itest.client.impl.ClientImpl"/>
+ <reference name="service">
+ <binding.sca uri="Service"/>
+ </reference>
+ </component>
<component name="ClientWS">
<implementation.java class="itest.client.impl.ClientImpl"/>
diff --git a/sca-java-2.x/trunk/testing/itest/data-copy/driver/src/test/java/itest/CrossContribTestCase.java b/sca-java-2.x/trunk/testing/itest/data-copy/driver/src/test/java/itest/CrossContribTestCase.java index d94115a1e4..cc1f542769 100644 --- a/sca-java-2.x/trunk/testing/itest/data-copy/driver/src/test/java/itest/CrossContribTestCase.java +++ b/sca-java-2.x/trunk/testing/itest/data-copy/driver/src/test/java/itest/CrossContribTestCase.java @@ -25,8 +25,12 @@ import itest.common.intf.ClientIntf; import java.net.URI;
+import org.apache.tuscany.sca.assembly.Binding;
+import org.apache.tuscany.sca.assembly.SCABinding;
+import org.apache.tuscany.sca.binding.ws.WebServiceBinding;
import org.apache.tuscany.sca.node.Node;
import org.apache.tuscany.sca.node.NodeFactory;
+import org.apache.tuscany.sca.node.impl.NodeImpl;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Ignore;
@@ -52,6 +56,24 @@ public class CrossContribTestCase { assertNotNull(client);
client.callJAXBCrossContribution();
}
+
+ // TUSCANY-3941 - make sure binding.sca is matched properly when
+ // it's used to carry the target URI. Not much to do with
+ // JAXB but this is a convenient test
+ @Test
+ public void testJAXBCrossContributionSCAAlternative() throws Exception {
+ ClientIntf client = node.getService(ClientIntf.class, "ClientSCAAlternative");
+ assertNotNull(client);
+ client.callJAXBCrossContribution();
+
+ // Get the binding from the ClientSCA component
+ Binding binding = ((NodeImpl)node).getDomainComposite().getComponents().get(2).getReferences().get(0).getEndpointReferences().get(0).getBinding();
+ assertEquals(true, binding instanceof SCABinding);
+
+ // Get the binding from the ClientSCAAlternative component
+ Binding alternativeBinding = ((NodeImpl)node).getDomainComposite().getComponents().get(1).getReferences().get(0).getEndpointReferences().get(0).getBinding();
+ assertEquals(true, alternativeBinding instanceof WebServiceBinding);
+ }
@Test
diff --git a/sca-java-2.x/trunk/testing/itest/data-copy/service/src/main/resources/helloworld-service.composite b/sca-java-2.x/trunk/testing/itest/data-copy/service/src/main/resources/helloworld-service.composite index 14a7801cf1..78b49eaa2c 100644 --- a/sca-java-2.x/trunk/testing/itest/data-copy/service/src/main/resources/helloworld-service.composite +++ b/sca-java-2.x/trunk/testing/itest/data-copy/service/src/main/resources/helloworld-service.composite @@ -25,8 +25,8 @@ <component name="Service">
<implementation.java class="itest.service.impl.ServiceImpl"/>
<service name="ServiceIntf">
- <binding.sca name="sca"/>
<binding.ws name="ws" uri="http://localhost:8085/Service/ServiceIntf"/>
+ <binding.sca name="sca"/>
<tuscany:binding.rmi name="rmi" uri="rmi://localhost:8099/Service"/>
</service>
</component>
|