summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/testing/itest/dynamic/src
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2012-08-01 15:18:03 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2012-08-01 15:18:03 +0000
commit1dffd32ebad2d6c390be7a74530f9f86880139cc (patch)
tree547e2d94f36854fa771b1bc30ed9efb70924bf4f /sca-java-2.x/trunk/testing/itest/dynamic/src
parent8078157f60c5de3cb286d422d621fcd9163c7065 (diff)
Fix to set the type of the binding so now the test works
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1368050 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/testing/itest/dynamic/src')
-rw-r--r--sca-java-2.x/trunk/testing/itest/dynamic/src/test/java/test/WSServiceTestCase.java17
1 files changed, 11 insertions, 6 deletions
diff --git a/sca-java-2.x/trunk/testing/itest/dynamic/src/test/java/test/WSServiceTestCase.java b/sca-java-2.x/trunk/testing/itest/dynamic/src/test/java/test/WSServiceTestCase.java
index b18be05475..7fa85ee458 100644
--- a/sca-java-2.x/trunk/testing/itest/dynamic/src/test/java/test/WSServiceTestCase.java
+++ b/sca-java-2.x/trunk/testing/itest/dynamic/src/test/java/test/WSServiceTestCase.java
@@ -46,6 +46,9 @@ import org.apache.tuscany.sca.core.ExtensionPointRegistry;
import org.apache.tuscany.sca.core.FactoryExtensionPoint;
import org.apache.tuscany.sca.implementation.java.JavaImplementation;
import org.apache.tuscany.sca.implementation.java.JavaImplementationFactory;
+import org.apache.tuscany.sca.policy.ExtensionType;
+import org.apache.tuscany.sca.policy.PolicyFactory;
+import org.apache.tuscany.sca.policy.PolicySubject;
import org.junit.Test;
import sample.Helloworld;
@@ -98,19 +101,21 @@ public class WSServiceTestCase extends TestCase {
javaImplementation.setJavaClass(HelloworldImpl.class);
component.setImplementation(javaImplementation);
+ // create a WS service
ComponentService cs = assemblyFactory.createComponentService();
cs.setName("Helloworld");
WebServiceBindingFactory webServiceBindingFactory = modelFactories.getFactory(WebServiceBindingFactory.class);
WebServiceBinding wsBinding = webServiceBindingFactory.createWebServiceBinding();
-// PolicyFactory policyFactory = modelFactories.getFactory(PolicyFactory.class);
-// Intent intent = policyFactory.createIntent();
-// intent.setName(new QName("http://docs.oasis-open.org/ns/opencsa/sca/200912", "SOAP.v1_1"));
-// DefaultIntent di = policyFactory.createDefaultIntent();
-// di.setIntent(intent);
-// ((DefaultingPolicySubject)b).getDefaultIntents().add(di);
cs.getBindings().add(wsBinding);
cs.setInterfaceContract(component.getImplementation().getService("Helloworld").getInterfaceContract());
+ // Not totally sure why this is necessary or why the type isn't set in WebServiceBinding by default?
+ PolicyFactory policyFactory = modelFactories.getFactory(PolicyFactory.class);
+ ExtensionType type = policyFactory.createExtensionType();
+ type.setType(new QName("http://docs.oasis-open.org/ns/opencsa/sca/200912", "binding.ws"));
+ ((PolicySubject)wsBinding).setExtensionType(type);
+
+ // Add the WS service to the component
component.getServices().add(cs);
// add the component to the composite