summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-05-18 16:46:33 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-05-18 16:46:33 +0000
commit1f8bafbfc5aa7b5ca4d64e220498b83141243dfd (patch)
tree2c103f44b5ed9f9d332dda5c129653f99f265e7e
parent4b61a4eee852de02043729e3ee4bdf7014ef29ae (diff)
Change the creation of DistributedSCABinding to the factory to avoid OSGi violations
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@776005 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--java/sca/modules/assembly-xml-osoa/src/test/java/org/apache/tuscany/sca/assembly/xml/osoa/TestSCABindingFactoryImpl.java13
-rw-r--r--java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/TestSCABindingFactoryImpl.java13
-rw-r--r--java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/SCABindingFactory.java12
-rw-r--r--java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/SCABindingFactoryImpl.java19
-rw-r--r--java/sca/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/RuntimeSCAReferenceBindingProvider.java8
-rw-r--r--java/sca/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/RuntimeSCAServiceBindingProvider.java77
-rw-r--r--java/sca/modules/binding-sca-runtime/src/test/java/org/apace/tuscany/sca/binding/sca/SCABindingTestCase.java52
-rw-r--r--java/sca/modules/binding-sca-runtime/src/test/java/org/apace/tuscany/sca/binding/sca/xml/WriteTestCase.java8
-rw-r--r--java/sca/modules/implementation-node/src/test/java/org/apache/tuscany/sca/implementation/node/builder/impl/CalculateBindingURITestCase.java43
9 files changed, 139 insertions, 106 deletions
diff --git a/java/sca/modules/assembly-xml-osoa/src/test/java/org/apache/tuscany/sca/assembly/xml/osoa/TestSCABindingFactoryImpl.java b/java/sca/modules/assembly-xml-osoa/src/test/java/org/apache/tuscany/sca/assembly/xml/osoa/TestSCABindingFactoryImpl.java
index 15ca297369..7d923d5483 100644
--- a/java/sca/modules/assembly-xml-osoa/src/test/java/org/apache/tuscany/sca/assembly/xml/osoa/TestSCABindingFactoryImpl.java
+++ b/java/sca/modules/assembly-xml-osoa/src/test/java/org/apache/tuscany/sca/assembly/xml/osoa/TestSCABindingFactoryImpl.java
@@ -6,25 +6,26 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* 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.
+ * under the License.
*/
package org.apache.tuscany.sca.assembly.xml.osoa;
+import org.apache.tuscany.sca.assembly.DistributedSCABinding;
import org.apache.tuscany.sca.assembly.SCABinding;
import org.apache.tuscany.sca.assembly.SCABindingFactory;
/**
* A factory for the SCA binding model.
- *
+ *
* @version $Rev$ $Date$
*/
public class TestSCABindingFactoryImpl implements SCABindingFactory {
@@ -32,4 +33,8 @@ public class TestSCABindingFactoryImpl implements SCABindingFactory {
return new TestSCABindingImpl();
}
+ public DistributedSCABinding createDistributedSCABinding() {
+ return null;
+ }
+
}
diff --git a/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/TestSCABindingFactoryImpl.java b/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/TestSCABindingFactoryImpl.java
index c423df6f7d..cbfec53f65 100644
--- a/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/TestSCABindingFactoryImpl.java
+++ b/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/TestSCABindingFactoryImpl.java
@@ -6,25 +6,26 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* 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.
+ * under the License.
*/
package org.apache.tuscany.sca.assembly.xml;
+import org.apache.tuscany.sca.assembly.DistributedSCABinding;
import org.apache.tuscany.sca.assembly.SCABinding;
import org.apache.tuscany.sca.assembly.SCABindingFactory;
/**
* A factory for the SCA binding model.
- *
+ *
* @version $Rev$ $Date$
*/
public class TestSCABindingFactoryImpl implements SCABindingFactory {
@@ -32,4 +33,8 @@ public class TestSCABindingFactoryImpl implements SCABindingFactory {
return new TestSCABindingImpl();
}
+ public DistributedSCABinding createDistributedSCABinding() {
+ return null;
+ }
+
}
diff --git a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/SCABindingFactory.java b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/SCABindingFactory.java
index 0abfd13d10..74dde43614 100644
--- a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/SCABindingFactory.java
+++ b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/SCABindingFactory.java
@@ -6,31 +6,33 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* 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.
+ * under the License.
*/
package org.apache.tuscany.sca.assembly;
/**
* A factory for the SCA binding model
- *
+ *
* @version $Rev$ $Date$
*/
public interface SCABindingFactory {
/**
* Create a new SCA binding.
- *
+ *
* @return a new SCA binding
*/
SCABinding createSCABinding();
+ DistributedSCABinding createDistributedSCABinding();
+
}
diff --git a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/SCABindingFactoryImpl.java b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/SCABindingFactoryImpl.java
index ef429a649e..7e311d8312 100644
--- a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/SCABindingFactoryImpl.java
+++ b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/SCABindingFactoryImpl.java
@@ -6,35 +6,40 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* 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.
+ * under the License.
*/
package org.apache.tuscany.sca.assembly.impl;
+import org.apache.tuscany.sca.assembly.DistributedSCABinding;
import org.apache.tuscany.sca.assembly.SCABinding;
import org.apache.tuscany.sca.assembly.SCABindingFactory;
/**
* A factory for the SCA binding model.
- *
+ *
* @version $Rev$ $Date$
*/
public class SCABindingFactoryImpl implements SCABindingFactory {
-
+
public SCABindingFactoryImpl (){
-
+
}
public SCABinding createSCABinding() {
return new SCABindingImpl();
}
-
+
+ public DistributedSCABinding createDistributedSCABinding() {
+ return new DistributedSCABindingImpl();
+ }
+
}
diff --git a/java/sca/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/RuntimeSCAReferenceBindingProvider.java b/java/sca/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/RuntimeSCAReferenceBindingProvider.java
index 4ba67620e1..23b3e60fea 100644
--- a/java/sca/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/RuntimeSCAReferenceBindingProvider.java
+++ b/java/sca/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/RuntimeSCAReferenceBindingProvider.java
@@ -25,8 +25,9 @@ import java.util.logging.Logger;
import org.apache.tuscany.sca.assembly.DistributedSCABinding;
import org.apache.tuscany.sca.assembly.OptimizableBinding;
import org.apache.tuscany.sca.assembly.SCABinding;
-import org.apache.tuscany.sca.assembly.impl.DistributedSCABindingImpl;
+import org.apache.tuscany.sca.assembly.SCABindingFactory;
import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.FactoryExtensionPoint;
import org.apache.tuscany.sca.interfacedef.InterfaceContract;
import org.apache.tuscany.sca.interfacedef.Operation;
import org.apache.tuscany.sca.invocation.InvocationChain;
@@ -61,6 +62,7 @@ public class RuntimeSCAReferenceBindingProvider implements ReferenceBindingProvi
private BindingProviderFactory<DistributedSCABinding> distributedProviderFactory = null;
private ReferenceBindingProvider distributedProvider = null;
+ private SCABindingFactory scaBindingFactory;
public RuntimeSCAReferenceBindingProvider(ExtensionPointRegistry extensionPoints,
RuntimeComponent component,
@@ -69,6 +71,8 @@ public class RuntimeSCAReferenceBindingProvider implements ReferenceBindingProvi
this.component = component;
this.reference = reference;
this.binding = binding;
+ this.scaBindingFactory =
+ extensionPoints.getExtensionPoint(FactoryExtensionPoint.class).getFactory(SCABindingFactory.class);
// look to see if a distributed SCA binding implementation has
// been included on the classpath. This will be needed by the
@@ -149,7 +153,7 @@ public class RuntimeSCAReferenceBindingProvider implements ReferenceBindingProvi
}
// create the remote provider
- DistributedSCABinding distributedBinding = new DistributedSCABindingImpl();
+ DistributedSCABinding distributedBinding = scaBindingFactory.createDistributedSCABinding();
distributedBinding.setSCABinding(binding);
distributedProvider =
diff --git a/java/sca/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/RuntimeSCAServiceBindingProvider.java b/java/sca/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/RuntimeSCAServiceBindingProvider.java
index 35b4de4d83..6852bcaab0 100644
--- a/java/sca/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/RuntimeSCAServiceBindingProvider.java
+++ b/java/sca/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/RuntimeSCAServiceBindingProvider.java
@@ -6,15 +6,15 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* 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.
+ * under the License.
*/
package org.apache.tuscany.sca.binding.sca.provider;
@@ -23,8 +23,9 @@ import java.net.URI;
import org.apache.tuscany.sca.assembly.DistributedSCABinding;
import org.apache.tuscany.sca.assembly.SCABinding;
-import org.apache.tuscany.sca.assembly.impl.DistributedSCABindingImpl;
+import org.apache.tuscany.sca.assembly.SCABindingFactory;
import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.FactoryExtensionPoint;
import org.apache.tuscany.sca.interfacedef.InterfaceContract;
import org.apache.tuscany.sca.provider.BindingProviderFactory;
import org.apache.tuscany.sca.provider.ProviderFactoryExtensionPoint;
@@ -33,67 +34,69 @@ import org.apache.tuscany.sca.runtime.RuntimeComponent;
import org.apache.tuscany.sca.runtime.RuntimeComponentService;
/**
- * The sca service binding provider mediates between the twin requirements of
- * local sca bindings and remote sca bindings. In the local case is does
- * very little. When the sca binding model is set as being remote this binding will
- * try and create a remote service endpoint for remote references to connect to
- *
+ * The sca service binding provider mediates between the twin requirements of
+ * local sca bindings and remote sca bindings. In the local case is does
+ * very little. When the sca binding model is set as being remote this binding will
+ * try and create a remote service endpoint for remote references to connect to
+ *
* @version $Rev$ $Date$
*/
public class RuntimeSCAServiceBindingProvider implements ServiceBindingProvider {
-
+
private RuntimeComponentService service;
private BindingProviderFactory<DistributedSCABinding> distributedProviderFactory;
private ServiceBindingProvider distributedProvider;
private DistributedSCABinding distributedBinding;
-
+
public RuntimeSCAServiceBindingProvider(ExtensionPointRegistry extensionPoints,
RuntimeComponent component,
RuntimeComponentService service,
SCABinding binding) {
this.service = service;
- // if there is potentially a wire to this service that crosses the node boundary
- if (service.getInterfaceContract().getInterface().isRemotable()) {
-
+ // if there is potentially a wire to this service that crosses the node boundary
+ if (service.getInterfaceContract().getInterface().isRemotable()) {
+
// look to see if a distributed SCA binding implementation has
- // been included on the classpath. This will be needed by the
+ // been included on the classpath. This will be needed by the
// provider itself to do it's thing
ProviderFactoryExtensionPoint factoryExtensionPoint =
extensionPoints.getExtensionPoint(ProviderFactoryExtensionPoint.class);
distributedProviderFactory =
(BindingProviderFactory<DistributedSCABinding>)factoryExtensionPoint
- .getProviderFactory(DistributedSCABinding.class);
-
- // Check the things that will generally be required to set up a
+ .getProviderFactory(DistributedSCABinding.class);
+
+ // Check the things that will generally be required to set up a
// distributed sca domain reference provider. I.e. make sure that we have a
// - distributed implementation of the sca binding available
// - remotable interface on the service
if (distributedProviderFactory != null) {
-
+
URI serviceURI = null;
try {
serviceURI = new URI(binding.getURI());
} catch(Exception ex) {
-
+
}
-
- if (RemoteBindingHelper.isTargetRemote() || ((serviceURI != null) && (serviceURI.isAbsolute()))) {
-
+
+ if (RemoteBindingHelper.isTargetRemote() || ((serviceURI != null) && (serviceURI.isAbsolute()))) {
+ SCABindingFactory scaBindingFactory =
+ extensionPoints.getExtensionPoint(FactoryExtensionPoint.class).getFactory(SCABindingFactory.class);
+
// create a nested provider to handle the remote case
- distributedBinding = new DistributedSCABindingImpl();
+ distributedBinding = scaBindingFactory.createDistributedSCABinding();
distributedBinding.setSCABinding(binding);
-
- distributedProvider =
+
+ distributedProvider =
distributedProviderFactory.createServiceBindingProvider(component, service, distributedBinding);
-
-
+
+
} else {
/* do nothing at the moment as only apps using the node implementation
- * will currently have the distributed domain set.
- *
+ * will currently have the distributed domain set.
+ *
throw new IllegalStateException("No distributed domain available for component: "+
component.getName() +
- " and service: " +
+ " and service: " +
service.getName());
*/
}
@@ -102,11 +105,11 @@ public class RuntimeSCAServiceBindingProvider implements ServiceBindingProvider
* are marked as remote
throw new IllegalStateException("No distributed SCA binding available for component: "+
component.getName() +
- " and service: " +
+ " and service: " +
service.getName());
*/
}
- }
+ }
}
public InterfaceContract getBindingInterfaceContract() {
@@ -124,7 +127,7 @@ public class RuntimeSCAServiceBindingProvider implements ServiceBindingProvider
public boolean supportsOneWayInvocation() {
return false;
}
-
+
public void start() {
if (distributedProvider != null) {
distributedProvider.start();
@@ -135,7 +138,7 @@ public class RuntimeSCAServiceBindingProvider implements ServiceBindingProvider
if (distributedProvider != null) {
distributedProvider.stop();
}
-
+
if (distributedBinding != null) {
// reset the binding URI to null so that if the composite containing the component
// with the service/binding is restarted the binding will have the correct URI set
@@ -147,9 +150,9 @@ public class RuntimeSCAServiceBindingProvider implements ServiceBindingProvider
}
} catch (Exception ex){
scaBinding.setURI(null);
- }
+ }
}
-
+
}
}
diff --git a/java/sca/modules/binding-sca-runtime/src/test/java/org/apace/tuscany/sca/binding/sca/SCABindingTestCase.java b/java/sca/modules/binding-sca-runtime/src/test/java/org/apace/tuscany/sca/binding/sca/SCABindingTestCase.java
index 19df1f0918..11fb1f9772 100644
--- a/java/sca/modules/binding-sca-runtime/src/test/java/org/apace/tuscany/sca/binding/sca/SCABindingTestCase.java
+++ b/java/sca/modules/binding-sca-runtime/src/test/java/org/apace/tuscany/sca/binding/sca/SCABindingTestCase.java
@@ -6,15 +6,15 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* 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.
+ * under the License.
*/
package org.apace.tuscany.sca.binding.sca;
@@ -29,12 +29,12 @@ import org.apache.tuscany.sca.assembly.SCABinding;
import org.apache.tuscany.sca.assembly.SCABindingFactory;
import org.apache.tuscany.sca.assembly.builder.CompositeBuilder;
import org.apache.tuscany.sca.assembly.builder.CompositeBuilderExtensionPoint;
-import org.apache.tuscany.sca.assembly.impl.SCABindingFactoryImpl;
import org.apache.tuscany.sca.assembly.xml.CompositeModelResolver;
import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor;
import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint;
import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
import org.apache.tuscany.sca.core.FactoryExtensionPoint;
import org.apache.tuscany.sca.policy.PolicyFactory;
import org.junit.Assert;
@@ -48,62 +48,66 @@ import org.junit.Test;
* @version $Rev$ $Date$
*/
public class SCABindingTestCase {
-
+
private XMLInputFactory inputFactory;
- private StAXArtifactProcessor<Object> staxProcessor;
- private CompositeModelResolver resolver;
+ private StAXArtifactProcessor<Object> staxProcessor;
+ private CompositeModelResolver resolver;
private CompositeBuilder compositeBuilder;
+ private ExtensionPointRegistry extensionPoints;
@Before
- public void init() throws Exception {
- DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
+ public void init() throws Exception {
+ extensionPoints = new DefaultExtensionPointRegistry();
inputFactory = XMLInputFactory.newInstance();
StAXArtifactProcessorExtensionPoint staxProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null, null);
-
+
resolver = new CompositeModelResolver(null, null);
-
+
FactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
AssemblyFactory assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
SCABindingFactory scaBindingFactory = modelFactories.getFactory(SCABindingFactory.class);
PolicyFactory attachPointTypeFactory = modelFactories.getFactory(PolicyFactory.class);
compositeBuilder = extensionPoints.getExtensionPoint(CompositeBuilderExtensionPoint.class).getCompositeBuilder("org.apache.tuscany.sca.assembly.builder.CompositeBuilder");
-
+
}
-
+
@Test
public void testSCABindingFactory() {
- SCABindingFactory factory = new SCABindingFactoryImpl();
+ SCABindingFactory factory =
+ extensionPoints.getExtensionPoint(FactoryExtensionPoint.class).getFactory(SCABindingFactory.class);
+
Assert.assertNotNull(factory.createSCABinding());
+ Assert.assertNotNull(factory.createDistributedSCABinding());
}
-
- @Test
+
+ @Test
@Ignore
public void testBuildModel() {
try{
- InputStream is = getClass().getResourceAsStream("/Calculator.composite");
+ InputStream is = getClass().getResourceAsStream("/Calculator.composite");
XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
Composite composite = (Composite)staxProcessor.read(reader);
-
+
is.close();
Assert.assertNotNull(composite);
-
+
resolver.addModel(composite);
-
+
staxProcessor.resolve(composite, resolver);
-
+
compositeBuilder.build(composite, null, null);
-
+
SCABinding referenceSCABinding = (SCABinding) composite.getComponents().get(0).getReferences().get(0).getBindings().get(0);
SCABinding serviceSCABinding = (SCABinding) composite.getComponents().get(1).getServices().get(0).getBindings().get(0);
-
+
Assert.assertNotNull(referenceSCABinding);
Assert.assertNotNull(serviceSCABinding);
} catch (Exception ex) {
Assert.fail(ex.getMessage());
}
-
+
}
}
diff --git a/java/sca/modules/binding-sca-runtime/src/test/java/org/apace/tuscany/sca/binding/sca/xml/WriteTestCase.java b/java/sca/modules/binding-sca-runtime/src/test/java/org/apace/tuscany/sca/binding/sca/xml/WriteTestCase.java
index 0f7083f370..7954c9c102 100644
--- a/java/sca/modules/binding-sca-runtime/src/test/java/org/apace/tuscany/sca/binding/sca/xml/WriteTestCase.java
+++ b/java/sca/modules/binding-sca-runtime/src/test/java/org/apace/tuscany/sca/binding/sca/xml/WriteTestCase.java
@@ -6,15 +6,15 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* 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.
+ * under the License.
*/
package org.apace.tuscany.sca.binding.sca.xml;
@@ -40,7 +40,7 @@ import org.junit.Test;
/**
* Test reading/write WSDL interfaces.
- *
+ *
* @version $Rev: 750765 $ $Date: 2009-03-06 04:36:04 +0000 (Fri, 06 Mar 2009) $
*/
public class WriteTestCase {
diff --git a/java/sca/modules/implementation-node/src/test/java/org/apache/tuscany/sca/implementation/node/builder/impl/CalculateBindingURITestCase.java b/java/sca/modules/implementation-node/src/test/java/org/apache/tuscany/sca/implementation/node/builder/impl/CalculateBindingURITestCase.java
index 3ec5ce20f8..c8f1ee81c8 100644
--- a/java/sca/modules/implementation-node/src/test/java/org/apache/tuscany/sca/implementation/node/builder/impl/CalculateBindingURITestCase.java
+++ b/java/sca/modules/implementation-node/src/test/java/org/apache/tuscany/sca/implementation/node/builder/impl/CalculateBindingURITestCase.java
@@ -6,15 +6,15 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* 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.
+ * under the License.
*/
package org.apache.tuscany.sca.implementation.node.builder.impl;
@@ -35,6 +35,7 @@ import org.apache.tuscany.sca.assembly.ComponentService;
import org.apache.tuscany.sca.assembly.Composite;
import org.apache.tuscany.sca.assembly.CompositeService;
import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory;
+import org.apache.tuscany.sca.assembly.DistributedSCABinding;
import org.apache.tuscany.sca.assembly.SCABinding;
import org.apache.tuscany.sca.assembly.SCABindingFactory;
import org.apache.tuscany.sca.assembly.builder.CompositeBuilder;
@@ -82,7 +83,7 @@ public class CalculateBindingURITestCase {
/**
* Create a composite containing a node component pointing to the
* given application composite.
- *
+ *
* @param composite
* @return
*/
@@ -107,16 +108,16 @@ public class CalculateBindingURITestCase {
/**
* Test that URI are generated in accordance with the Assembly Specification section 1.7.2.1 as
* follows. For the 3 parts that make up the URI;
- *
+ *
* BaseURI / Component URI / Service Binding URI
- *
+ *
* Test the following combinations for:
- *
+ *
* NB. The short hand here, e.g. <service name="s1"> <binding.sca> <service name="s2"> means
- * two services appear where the first has the sca binding specified.
- *
+ * two services appear where the first has the sca binding specified.
+ *
* component service bindings
- *
+ *
* http://myhost:8080/root / <component name="c1"> / <service name="s1"> <binding.sca>
* --> http://myhost:8080/root/c1
* http://myhost:8080/root / <component name="c1"> / <service name="s1"> <binding.sca> <service name="s2">
@@ -128,10 +129,10 @@ public class CalculateBindingURITestCase {
* http://myhost:8080/root / <component name="c1"> / <service name="s1"> <binding.sca uri="http://myhost:8080/b"> <service name="s2">
* --> http://myhost:8080/b
* http://myhost:8080/root / <component name="c1"> / <service name="s1"> <binding.sca uri="../../b"> <service name="s2">
- * --> http://myhost:8080/b
- *
+ * --> http://myhost:8080/b
+ *
* top level composite service bindings
- *
+ *
* http://myhost:8080/root / null / <service name="s1"> <binding.sca> <service name="s2">
* --> http://myhost:8080/root
* http://myhost:8080/root / null / <service name="s1"> <binding.sca> <service name="s2">
@@ -142,9 +143,9 @@ public class CalculateBindingURITestCase {
* --> http://myhost:8080/root/b
* http://myhost:8080/root / null / <service name="s1"> <binding.sca uri="http://myhost:8080/b"> <service name="s2">
* --> http://myhost:8080/b
- *
+ *
* nested composite service bindings
- *
+ *
* http://myhost:8080/root / <component name="c1"> implemented by composite with <component name="c2"> / <service name="s1"> <binding.sca>
* --> http://myhost:8080/root/c1/c2
* http://myhost:8080/root / <component name="c1"> implemented by composite with <component name="c2"> / <service name="s1"> <binding.sca> <service name="s2">
@@ -155,9 +156,9 @@ public class CalculateBindingURITestCase {
* --> http://myhost:8080/root/c1/c2/b
* http://myhost:8080/root / <component name="c1"> implemented by composite with <component name="c2"> / <service name="s1"> <binding.sca uri="http://myhost:8080/b"> <service name="s2">
* --> http://myhost:8080/b
- *
+ *
* binding name duplication errors
- *
+ *
* http://myhost:8080/root / <component name="c1"> implemented by composite with <component name="c2"> / <service name="s1"> <binding.sca> <binding.xyz>
* --> Error
* http://myhost:8080/root / <component name="c1"> implemented by composite with <component name="c2"> / <service name="s1"> <binding.sca name="b1"> <binding.xyz name="b1">
@@ -523,7 +524,7 @@ public class CalculateBindingURITestCase {
// component service binding name error tests
//FIXME Need to find a better way to test these error cases as
- // the composite builder now (intentionally) logs warnings instead of
+ // the composite builder now (intentionally) logs warnings instead of
// throwing exceptions
public void FIXMEtestComponentServiceBindingNameError1() {
Composite composite = createComponentServiceBinding();
@@ -540,7 +541,7 @@ public class CalculateBindingURITestCase {
}
//FIXME Need to find a better way to test these error cases as
- // the composite builder now (intentionally) logs warnings instead of
+ // the composite builder now (intentionally) logs warnings instead of
// throwing exceptions
public void FIXMEtestComponentServiceBindingNameError2() {
Composite composite = createComponentServiceBinding();
@@ -563,6 +564,10 @@ public class CalculateBindingURITestCase {
public SCABinding createSCABinding() {
return new TestBindingImpl();
}
+
+ public DistributedSCABinding createDistributedSCABinding() {
+ return null;
+ }
}
public class TestBindingImpl implements SCABinding {