From 2ca48372345c7534e95158dcfae7464bda78ac2d Mon Sep 17 00:00:00 2001 From: rfeng Date: Wed, 3 Mar 2010 05:41:33 +0000 Subject: Copy the test cases from binding-sca-runtime-axis2 and binding-sca-runtime-rmi into an itest Change the code to pass binding.sca with mapped uri with the endpoint git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@918327 13f79535-47bb-0310-9956-ffa450edef68 --- .../tuscany/sca/builder/impl/BindingURIBuilderImpl.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'sca-java-2.x/trunk/modules/builder/src/main/java/org/apache') diff --git a/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/BindingURIBuilderImpl.java b/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/BindingURIBuilderImpl.java index 42da4abed7..4c5bca204b 100644 --- a/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/BindingURIBuilderImpl.java +++ b/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/BindingURIBuilderImpl.java @@ -31,6 +31,7 @@ import org.apache.tuscany.sca.assembly.Component; import org.apache.tuscany.sca.assembly.ComponentService; import org.apache.tuscany.sca.assembly.Composite; import org.apache.tuscany.sca.assembly.Implementation; +import org.apache.tuscany.sca.assembly.SCABinding; import org.apache.tuscany.sca.assembly.Service; import org.apache.tuscany.sca.assembly.builder.BuilderContext; import org.apache.tuscany.sca.assembly.builder.CompositeBuilder; @@ -195,6 +196,10 @@ public class BindingURIBuilderImpl implements CompositeBuilder { // calculate the service binding URI URI bindingURI = binding.getURI() == null ? null : new URI(binding.getURI()); + if (binding instanceof SCABinding) { + // Per assembly spec, the @uri for service side binding.sca should be ignored + bindingURI = null; + } // if the user has provided an absolute binding URI then use it if (bindingURI != null && bindingURI.isAbsolute()) { @@ -218,10 +223,12 @@ public class BindingURIBuilderImpl implements CompositeBuilder { // calculate the base URI URI baseURI = null; - if (defaultBindings != null) { - List uris = defaultBindings.get(binding.getType()); - if (uris != null && uris.size() > 0) { - baseURI = new URI(addSlashToPath(uris.get(0))); + if (!(binding instanceof SCABinding)) { + if (defaultBindings != null) { + List uris = defaultBindings.get(binding.getType()); + if (uris != null && uris.size() > 0) { + baseURI = new URI(addSlashToPath(uris.get(0))); + } } } -- cgit v1.2.3