summaryrefslogtreecommitdiffstats
path: root/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding
diff options
context:
space:
mode:
Diffstat (limited to 'sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding')
-rwxr-xr-xsca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ReferenceTestCase.java83
-rwxr-xr-xsca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceTestCase.java104
-rwxr-xr-xsca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/Greeter.java31
-rw-r--r--sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/GreetingCallback.java24
-rw-r--r--sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/Java2WSDLHelperTestCase.java74
-rw-r--r--sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/Bar.java58
-rw-r--r--sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/Echo.java29
-rw-r--r--sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/EchoComponent.java33
-rw-r--r--sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/EchoImpl.java29
-rw-r--r--sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/Foo.java36
-rw-r--r--sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorld.java29
-rw-r--r--sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldComponent.java33
-rw-r--r--sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldMultiService.java51
-rw-r--r--sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldNoWSDLTestCase.java77
-rw-r--r--sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOM.java30
-rw-r--r--sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOM2.java30
-rw-r--r--sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOMComponent.java34
-rw-r--r--sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOMService.java40
-rw-r--r--sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOMTestCase.java58
-rw-r--r--sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldService.java28
-rw-r--r--sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldTestCase.java46
-rw-r--r--sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldWSDLMergedTestCaseFIXME.java58
-rw-r--r--sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/QuestionMarkWSDLTestCase.java100
-rw-r--r--sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/AbstractHelloWorldOMTestCase.java64
-rw-r--r--sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/DefaultMultiServiceTestCase.java24
-rw-r--r--sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/DefaultSingleServiceTestCase.java24
-rw-r--r--sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/WSDLExplicitURITestCase.java24
-rw-r--r--sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/WSDLRelativeURITestCase.java24
-rw-r--r--sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/epr/HelloWorldTestCase.java47
-rw-r--r--sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/AbstractHelloWorldOMTestCase.java64
-rw-r--r--sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/ClientPWCBHandler.java43
-rw-r--r--sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/IntegrityPWCBHandler.java43
-rw-r--r--sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/ServerPWCBHandler.java43
-rw-r--r--sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityAuthenticationTestCase.java24
-rw-r--r--sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityConfidentialityTestCaseFIXBouncyCastleIssue.java42
-rw-r--r--sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityIntegrityTestCase.java24
-rw-r--r--sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/AbstractHelloWorldOMTestCase.java64
-rw-r--r--sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/ClientPWCBHandler.java43
-rw-r--r--sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/IntegrityPWCBHandler.java43
-rw-r--r--sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/ServerPWCBHandler.java43
-rw-r--r--sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityAuthenticationTestCase.java24
-rw-r--r--sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityConfidentialityTestCaseFIXBouncyCastleIssue.java42
-rw-r--r--sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityIntegrityTestCase.java24
-rw-r--r--sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/soap12/HelloWorldSOAP12TestCase.java58
-rw-r--r--sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/soap12/QuestionMarkWSDLTestCase.java121
45 files changed, 2067 insertions, 0 deletions
diff --git a/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ReferenceTestCase.java b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ReferenceTestCase.java
new file mode 100755
index 0000000000..2ce23bf2c4
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ReferenceTestCase.java
@@ -0,0 +1,83 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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.
+ */
+package org.apache.tuscany.sca.binding.ws.axis2;
+
+import junit.framework.TestCase;
+
+public class Axis2ReferenceTestCase extends TestCase {
+
+ public void testInvokeService() throws Exception {
+// Axis2ReferenceBinding axis2Reference = createAxis2Reference("testWebAppName", "testServiceName");
+// ServiceContract contract = new JavaServiceContract();
+// Operation operation = new Operation<Type>("sayHi", null, null, null, false, null, NO_CONVERSATION);
+// TargetInvoker targetInvoker = axis2Reference.createTargetInvoker(contract, operation);
+// assertNotNull(targetInvoker);
+// assertFalse(targetInvoker instanceof Axis2AsyncTargetInvoker);
+ }
+
+ public void testAsyncTargetInvoker() throws Exception {
+// Axis2ReferenceBinding axis2Reference = createAxis2Reference("testWebAppName", "testServiceName");
+// //Create a mocked InboundWire, make the call of ServiceBindingExtension.getInterface() returns a Class
+// Wire inboundWire = EasyMock.createNiceMock(Wire.class);
+// JavaServiceContract contract = new JavaServiceContract(Greeter.class);
+// contract.setCallbackName("");
+// contract.setCallbackClass(GreetingCallback.class);
+// Operation<Type> callbackOp =
+// new Operation<Type>("sayHiCallback", null, null, null, true, null, NO_CONVERSATION);
+// HashMap<String, Operation<Type>> callbackOps = new HashMap<String, Operation<Type>>();
+// callbackOps.put("sayHiCallback", callbackOp);
+// contract.setCallbackOperations(callbackOps);
+// EasyMock.expect(inboundWire.getTargetContract()).andReturn(contract).anyTimes();
+// EasyMock.replay(inboundWire);
+//
+// axis2Reference.setWire(inboundWire);
+// Operation operation = new Operation<Type>("sayHi", null, null, null, true, null, NO_CONVERSATION);
+// TargetInvoker asyncTargetInvoker = axis2Reference.createTargetInvoker(contract, operation);
+// assertNotNull(asyncTargetInvoker);
+// assertTrue(asyncTargetInvoker instanceof Axis2AsyncTargetInvoker);
+ }
+
+// @SuppressWarnings("unchecked")
+// private Axis2ReferenceBinding createAxis2Reference(String webAppName, String serviceName) throws Exception {
+// //Create WebServiceBindingDefinition
+// String wsdlLocation = "/wsdl/hello_world_doc_lit.wsdl";
+// URL url = getClass().getResource(wsdlLocation);
+// assertNotNull("Could not find wsdl " + url.toString(), url);
+//
+// WSDLFactory factory = WSDLFactory.newInstance();
+// WSDLReader reader = factory.newWSDLReader();
+// reader.setFeature("javax.wsdl.verbose", false);
+// InputSource input = new InputSource(url.openStream());
+// Definition wsdlDef = reader.readWSDL(url.toString(), input);
+// Service wsdlService = wsdlDef.getService(new QName("http://objectweb.org/hello_world_soap_http",
+// "SOAPService"));
+// Port port = wsdlService.getPort("SoapPort");
+// WebServiceBindingDefinition wsBinding =
+// new WebServiceBindingDefinition(wsdlDef, port, "uri", "portURI", wsdlService);
+// //Create a mocked WireService, make the call of ServiceBindingExtension.getServiceInstance() returns a proxy instance.
+// // TODO figure out what to do with the service contract
+// ServiceContract<?> contract = new WSDLServiceContract();
+// contract.setInterfaceClass(Greeter.class);
+// return new Axis2ReferenceBinding(URI.create(serviceName),
+// wsBinding,
+// contract,
+// null,
+// null);
+// }
+}
diff --git a/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceTestCase.java b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceTestCase.java
new file mode 100755
index 0000000000..d4d20414e5
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceTestCase.java
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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.
+ */
+package org.apache.tuscany.sca.binding.ws.axis2;
+
+import junit.framework.TestCase;
+
+public class Axis2ServiceTestCase extends TestCase {
+
+ public void testInvokeService() throws Exception {
+// TestServletHost tomcatHost = new TestServletHost();
+// Axis2ServiceBinding axis2Service = createAxis2Service("testServiceName", tomcatHost, false);
+// axis2Service.start();
+//
+// if (true) return;
+// Servlet servlet = tomcatHost.getMapping("testWebAppName/serviceBindings/testServiceName");
+// assertNotNull(servlet);
+//
+// //Create mocked HttpRequest and HttpResponse object to test the Axis2Servlet
+// //To be done:
+
+ }
+
+ public void testAsyncMessageReceiver() throws Exception {
+
+// TestServletHost tomcatHost = new TestServletHost();
+// Axis2ServiceBinding axis2Service = createAxis2Service("testServiceName", tomcatHost, true);
+// axis2Service.start();
+ }
+
+// @SuppressWarnings("unchecked")
+// private Axis2ServiceBinding createAxis2Service(String serviceName, ServletHost tomcatHost, boolean callback)
+// throws Exception {
+// //Create WebServiceBindingDefinition
+// String wsdlLocation = "/wsdl/hello_world_doc_lit.wsdl";
+// URL url = getClass().getResource(wsdlLocation);
+// assertNotNull("Could not find wsdl " + url.toString(), url);
+//
+// WSDLFactory factory = WSDLFactory.newInstance();
+// WSDLReader reader = factory.newWSDLReader();
+// reader.setFeature("javax.wsdl.verbose", false);
+// InputSource input = new InputSource(url.openStream());
+// Definition wsdlDef = reader.readWSDL(url.toString(), input);
+// Service wsdlService = wsdlDef.getService(new QName("http://objectweb.org/hello_world_soap_http",
+// "SOAPService"));
+// Port port = wsdlService.getPort("SoapPort");
+// WebServiceBindingDefinition wsBinding = new WebServiceBindingDefinition(wsdlDef, port, "uri", "portURI", wsdlService);
+//
+// //Create a mocked WireService, make the call of ServiceBindingExtension.getServiceInstance() returns a proxy instance.
+//// WireService wireService = EasyMock.createNiceMock(WireService.class);
+//// wireService.createProxy(EasyMock.isA(Class.class), EasyMock.isA(Wire.class));
+//// EasyMock.expectLastCall().andReturn(null);
+//// EasyMock.replay(wireService);
+//
+// //Create a mocked InboundWire, make the call of ServiceBindingExtension.getInterface() returns a Class
+// Wire inboundWire = EasyMock.createNiceMock(Wire.class);
+// JavaServiceContract contract = new JavaServiceContract(Greeter.class);
+// Map<String, Operation<Type>> opMap = new HashMap<String, Operation<Type>>();
+// for (Method m : Greeter.class.getMethods()) {
+// opMap.put(m.getName(), new Operation<Type>(m.getName(), null, null, null));
+// }
+// contract.setOperations(opMap);
+// EasyMock.expect(inboundWire.getTargetContract()).andReturn(contract).anyTimes();
+// if (callback) {
+// contract.setCallbackName("");
+// }
+// EasyMock.replay(inboundWire);
+//
+// Wire outboundWire = EasyMock.createNiceMock(Wire.class);
+// Map<Operation<?>, InvocationChain> map = new HashMap<Operation<?>, InvocationChain>();
+// EasyMock.expect(outboundWire.getInvocationChains()).andReturn(map).once();
+// EasyMock.replay(outboundWire);
+//
+// TuscanyAxisConfigurator tuscanyAxisConfigurator = new TuscanyAxisConfigurator();
+// ConfigurationContext configurationContext = tuscanyAxisConfigurator.getConfigurationContext();
+// Axis2ServiceBinding axis2Service =
+// new Axis2ServiceBinding(URI.create(serviceName),
+// contract,
+// null,
+// wsBinding,
+// tomcatHost,
+// configurationContext, null);
+// axis2Service.setWire(inboundWire);
+//// axis2Service.setOutboundWire(outboundWire);
+//
+// return axis2Service;
+// }
+
+}
diff --git a/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/Greeter.java b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/Greeter.java
new file mode 100755
index 0000000000..767f59646f
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/Greeter.java
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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.
+ */
+package org.apache.tuscany.sca.binding.ws.axis2;
+
+public interface Greeter {
+
+ String sayHi();
+
+ String greetMe(String requestType);
+
+ void greetMeOneWay(String requestType);
+
+ void greetMeWithCallback(String requestType);
+
+}
diff --git a/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/GreetingCallback.java b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/GreetingCallback.java
new file mode 100644
index 0000000000..e5e76af0b7
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/GreetingCallback.java
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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.
+ */
+package org.apache.tuscany.sca.binding.ws.axis2;
+
+public interface GreetingCallback {
+
+ void greetMeCallback(String greetMeResponse);
+}
diff --git a/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/Java2WSDLHelperTestCase.java b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/Java2WSDLHelperTestCase.java
new file mode 100644
index 0000000000..b8119c86c0
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/Java2WSDLHelperTestCase.java
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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.
+ */
+package org.apache.tuscany.sca.binding.ws.axis2;
+
+import java.util.List;
+import java.util.Map;
+
+import javax.wsdl.Definition;
+import javax.wsdl.Operation;
+import javax.wsdl.PortType;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
+import org.apache.tuscany.sca.interfacedef.java.DefaultJavaInterfaceFactory;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceContract;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterfaceContract;
+
+public class Java2WSDLHelperTestCase extends TestCase {
+
+ public void testCreateDefinition() {
+ Definition definition = Java2WSDLHelper.createDefinition(HelloWorld.class, null);
+ assertNotNull(definition);
+
+ Map portTypes = definition.getPortTypes();
+ assertEquals(1, portTypes.size());
+
+ PortType portType = (PortType)portTypes.values().iterator().next();
+ assertEquals("HelloWorldPortType", portType.getQName().getLocalPart());
+ assertEquals("http://axis2.ws.binding.sca.tuscany.apache.org", portType.getQName().getNamespaceURI());
+
+ List<?> ops = portType.getOperations();
+ assertEquals(1, ops.size());
+
+ Operation operation = (Operation)ops.get(0);
+ assertEquals("sayHello", operation.getName());
+ }
+
+
+ public void testCreateWSDLInterfaceContract() throws InvalidInterfaceException {
+ DefaultJavaInterfaceFactory factory = new DefaultJavaInterfaceFactory();
+ JavaInterfaceContract javaIC = factory.createJavaInterfaceContract();
+ javaIC.setInterface(factory.createJavaInterface(HelloWorld.class));
+ WSDLInterfaceContract wsdlIC = Java2WSDLHelper.createWSDLInterfaceContract(javaIC, null);
+ assertNotNull(wsdlIC);
+ WSDLInterface wsdlInterface = (WSDLInterface)wsdlIC.getInterface();
+ assertNotNull(wsdlInterface);
+ assertEquals(1, wsdlInterface.getOperations().size());
+ assertEquals("sayHello", wsdlInterface.getOperations().get(0).getName());
+ assertNotNull(wsdlInterface.getPortType());
+ }
+
+}
+
+interface HelloWorld {
+ public String sayHello(String s);
+}
diff --git a/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/Bar.java b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/Bar.java
new file mode 100644
index 0000000000..2dc7d8dee4
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/Bar.java
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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.
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2.itests;
+
+import java.io.Serializable;
+
+public class Bar implements Serializable {
+ private static final long serialVersionUID = 1249963611910502668L;
+
+ private String s;
+ private int x;
+ private Integer y;
+
+ private Boolean b;
+
+ public Boolean getB() {
+ return b;
+ }
+ public void setB(Boolean b) {
+ this.b = b;
+ }
+ public String getS() {
+ return s;
+ }
+ public void setS(String s) {
+ this.s = s;
+ }
+ public int getX() {
+ return x;
+ }
+ public void setX(int x) {
+ this.x = x;
+ }
+ public Integer getY() {
+ return y;
+ }
+ public void setY(Integer y) {
+ this.y = y;
+ }
+
+}
diff --git a/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/Echo.java b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/Echo.java
new file mode 100644
index 0000000000..e60c30790a
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/Echo.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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.
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2.itests;
+
+import org.osoa.sca.annotations.Remotable;
+
+@Remotable
+public interface Echo {
+
+ public Foo echoFoo(Foo foo);
+
+}
diff --git a/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/EchoComponent.java b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/EchoComponent.java
new file mode 100644
index 0000000000..5e1a4cf259
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/EchoComponent.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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.
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2.itests;
+
+import org.osoa.sca.annotations.Reference;
+
+public class EchoComponent implements Echo {
+
+ @Reference
+ public Echo echoWS;
+
+ public Foo echoFoo(Foo foo) {
+ return echoWS.echoFoo(foo);
+ }
+
+}
diff --git a/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/EchoImpl.java b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/EchoImpl.java
new file mode 100644
index 0000000000..d028ced69e
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/EchoImpl.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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.
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2.itests;
+
+
+public class EchoImpl implements Echo {
+
+ public Foo echoFoo(Foo foo) {
+ return foo;
+ }
+
+}
diff --git a/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/Foo.java b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/Foo.java
new file mode 100644
index 0000000000..c7b503af17
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/Foo.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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.
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2.itests;
+
+import java.io.Serializable;
+
+public class Foo implements Serializable {
+ private static final long serialVersionUID = 4879476066850018458L;
+
+ private Bar[] bars;
+
+ public Bar[] getBars() {
+ return bars;
+ }
+
+ public void setBars(Bar[] bars) {
+ this.bars = bars;
+ }
+}
diff --git a/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorld.java b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorld.java
new file mode 100644
index 0000000000..e2f3982d99
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorld.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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.
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2.itests;
+
+import org.osoa.sca.annotations.Remotable;
+
+@Remotable
+public interface HelloWorld {
+
+ public String getGreetings(String s);
+
+}
diff --git a/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldComponent.java b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldComponent.java
new file mode 100644
index 0000000000..88705c1a95
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldComponent.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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.
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2.itests;
+
+import org.osoa.sca.annotations.Reference;
+
+public class HelloWorldComponent implements HelloWorld {
+
+ @Reference
+ public HelloWorld helloWorldWS;
+
+ public String getGreetings(String s) {
+ return helloWorldWS.getGreetings(s);
+ }
+
+}
diff --git a/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldMultiService.java b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldMultiService.java
new file mode 100644
index 0000000000..f30286feea
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldMultiService.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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.
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2.itests;
+
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
+
+public class HelloWorldMultiService implements HelloWorldOM, HelloWorldOM2 {
+
+ public OMElement getGreetings(OMElement requestOM) {
+ String name = requestOM.getFirstElement().getText();
+
+ OMFactory omFactory = OMAbstractFactory.getOMFactory();
+ OMElement responseOM = omFactory.createOMElement("getGreetingsResponse", "http://helloworld-om", "helloworld");
+ OMElement param = omFactory.createOMElement("getGreetingsReturn", "http://helloworld-om", "helloworld");
+ responseOM.addChild(param);
+ param.addChild(omFactory.createOMText("Hello " + name));
+
+ return responseOM;
+ }
+
+ public OMElement getGreetings2(OMElement requestOM) {
+ String name = requestOM.getFirstElement().getText();
+
+ OMFactory omFactory = OMAbstractFactory.getOMFactory();
+ OMElement responseOM = omFactory.createOMElement("getGreetingsResponse", "http://helloworld-om", "helloworld");
+ OMElement param = omFactory.createOMElement("getGreetingsReturn", "http://helloworld-om", "helloworld");
+ responseOM.addChild(param);
+ param.addChild(omFactory.createOMText("Hello2 " + name));
+
+ return responseOM;
+ }
+}
diff --git a/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldNoWSDLTestCase.java b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldNoWSDLTestCase.java
new file mode 100644
index 0000000000..7ee48d4451
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldNoWSDLTestCase.java
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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.
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2.itests ;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+
+public class HelloWorldNoWSDLTestCase extends TestCase {
+
+ private SCADomain domain;
+
+ public void testHelloWorld() throws Exception {
+ HelloWorld helloWorld = domain.getService(HelloWorld.class, "HelloWorldComponent");
+ assertEquals("Hello petra", helloWorld.getGreetings("petra"));
+ }
+
+ /**
+ * Test a a WS call with a complex type
+ */
+ public void testEchoFoo() throws Exception {
+ Echo echo = domain.getService(Echo.class, "EchoComponent");
+
+ Foo f = new Foo();
+ Bar b1 = new Bar();
+ b1.setS("petra");
+ b1.setX(1);
+ b1.setY(new Integer(2));
+ b1.setB(Boolean.TRUE);
+ Bar b2 = new Bar();
+ b2.setS("beate");
+ b2.setX(3);
+ b2.setY(new Integer(4));
+ b2.setB(Boolean.FALSE);
+ f.setBars(new Bar[] { b1, b2} );
+
+ Foo f2 = echo.echoFoo(f);
+
+ assertEquals("petra", f2.getBars()[0].getS());
+ assertEquals(1, f2.getBars()[0].getX());
+ assertEquals(2, f2.getBars()[0].getY().intValue());
+ assertTrue(f2.getBars()[0].getB().booleanValue());
+ assertEquals("beate", f2.getBars()[1].getS());
+ assertEquals(3, f2.getBars()[1].getX());
+ assertEquals(4, f2.getBars()[1].getY().intValue());
+ assertFalse(f2.getBars()[1].getB().booleanValue());
+
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ domain = SCADomain.newInstance("org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldNoWSDL.composite");
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ domain.close();
+ }
+
+}
diff --git a/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOM.java b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOM.java
new file mode 100644
index 0000000000..f09ca4a435
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOM.java
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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.
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2.itests;
+
+import org.apache.axiom.om.OMElement;
+import org.osoa.sca.annotations.Remotable;
+
+@Remotable
+public interface HelloWorldOM {
+
+ public OMElement getGreetings(OMElement parmE);
+
+}
diff --git a/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOM2.java b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOM2.java
new file mode 100644
index 0000000000..f3a4ae4c8b
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOM2.java
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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.
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2.itests;
+
+import org.apache.axiom.om.OMElement;
+import org.osoa.sca.annotations.Remotable;
+
+@Remotable
+public interface HelloWorldOM2 {
+
+ public OMElement getGreetings2(OMElement parmE);
+
+}
diff --git a/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOMComponent.java b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOMComponent.java
new file mode 100644
index 0000000000..d1cbfb88fd
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOMComponent.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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.
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2.itests;
+
+import org.apache.axiom.om.OMElement;
+import org.osoa.sca.annotations.Reference;
+
+public class HelloWorldOMComponent implements HelloWorldOM {
+
+ @Reference
+ public HelloWorldOM helloWorldWS;
+
+ public OMElement getGreetings(OMElement om) {
+ return helloWorldWS.getGreetings(om);
+ }
+
+}
diff --git a/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOMService.java b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOMService.java
new file mode 100644
index 0000000000..69bb571144
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOMService.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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.
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2.itests;
+
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
+
+public class HelloWorldOMService implements HelloWorldOM {
+
+ public OMElement getGreetings(OMElement requestOM) {
+ String name = requestOM.getFirstElement().getText();
+
+ OMFactory omFactory = OMAbstractFactory.getOMFactory();
+ OMElement responseOM = omFactory.createOMElement("getGreetingsResponse", "http://helloworld-om", "helloworld");
+ OMElement param = omFactory.createOMElement("getGreetingsReturn", "http://helloworld-om", "helloworld");
+ responseOM.addChild(param);
+ param.addChild(omFactory.createOMText("Hello " + name));
+
+ return responseOM;
+ }
+
+}
diff --git a/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOMTestCase.java b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOMTestCase.java
new file mode 100644
index 0000000000..e7511027c2
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOMTestCase.java
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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.
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2.itests;
+
+import junit.framework.Assert;
+import junit.framework.TestCase;
+
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMText;
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+
+public class HelloWorldOMTestCase extends TestCase {
+
+ private SCADomain domain;
+ private HelloWorldOM helloWorld;
+
+ public void testHelloWorld() throws Exception {
+ OMFactory fac = OMAbstractFactory.getOMFactory();
+ OMElement requestOM = fac.createOMElement("getGreetings", "http://helloworld-om", "helloworld");
+ OMElement parmE = fac.createOMElement("name", "http://helloworld-om", "helloworld");
+ requestOM.addChild(parmE);
+ parmE.addChild(fac.createOMText("petra"));
+ OMElement responseOM = helloWorld.getGreetings(requestOM);
+ OMElement child = (OMElement)responseOM.getFirstElement();
+ Assert.assertEquals("Hello petra", ((OMText)child.getFirstOMChild()).getText());
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ domain = SCADomain.newInstance("org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om.composite");
+ helloWorld = domain.getService(HelloWorldOM.class, "HelloWorldComponent");
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ domain.close();
+ }
+
+}
diff --git a/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldService.java b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldService.java
new file mode 100644
index 0000000000..017d9bb478
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldService.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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.
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2.itests;
+
+public class HelloWorldService implements HelloWorld {
+
+ public String getGreetings(String s) {
+ return "Hello " + s;
+ }
+
+}
diff --git a/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldTestCase.java b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldTestCase.java
new file mode 100644
index 0000000000..a3a43d032f
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldTestCase.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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.
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2.itests;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+
+public class HelloWorldTestCase extends TestCase {
+
+ private SCADomain domain;
+ private HelloWorld helloWorld;
+
+ public void testCalculator() throws Exception {
+ assertEquals("Hello petra", helloWorld.getGreetings("petra"));
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ domain = SCADomain.newInstance("org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorld.composite");
+ helloWorld = domain.getService(HelloWorld.class, "HelloWorldComponent");
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ domain.close();
+ }
+
+}
diff --git a/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldWSDLMergedTestCaseFIXME.java b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldWSDLMergedTestCaseFIXME.java
new file mode 100644
index 0000000000..d105e3d50e
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldWSDLMergedTestCaseFIXME.java
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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.
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2.itests;
+
+import junit.framework.Assert;
+import junit.framework.TestCase;
+
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMText;
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+
+public class HelloWorldWSDLMergedTestCaseFIXME extends TestCase {
+
+ private SCADomain domain;
+ private HelloWorldOM helloWorld;
+
+ public void testHelloWorld() throws Exception {
+ OMFactory fac = OMAbstractFactory.getOMFactory();
+ OMElement requestOM = fac.createOMElement("getGreetings", "http://helloworld-om", "helloworld");
+ OMElement parmE = fac.createOMElement("name", "http://helloworld-om", "helloworld");
+ requestOM.addChild(parmE);
+ parmE.addChild(fac.createOMText("petra"));
+ OMElement responseOM = helloWorld.getGreetings(requestOM);
+ OMElement child = (OMElement)responseOM.getFirstElement();
+ Assert.assertEquals("Hello petra", ((OMText)child.getFirstOMChild()).getText());
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ domain = SCADomain.newInstance("org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om-merged.composite");
+ helloWorld = domain.getService(HelloWorldOM.class, "HelloWorldWSDLMergedComponent");
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ domain.close();
+ }
+
+}
diff --git a/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/QuestionMarkWSDLTestCase.java b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/QuestionMarkWSDLTestCase.java
new file mode 100644
index 0000000000..535ad3eeca
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/QuestionMarkWSDLTestCase.java
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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.
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2.itests;
+
+import java.util.List;
+
+import javax.wsdl.Definition;
+import javax.wsdl.Port;
+import javax.wsdl.Service;
+import javax.wsdl.extensions.soap.SOAPAddress;
+import javax.wsdl.factory.WSDLFactory;
+import javax.wsdl.xml.WSDLReader;
+import javax.xml.namespace.QName;
+
+import junit.framework.TestCase;
+
+import org.apache.axis2.transport.http.server.HttpUtils;
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+
+/**
+ * Test ?wsdl works and that the returned wsdl has the correct endpoint
+ */
+public class QuestionMarkWSDLTestCase extends TestCase {
+
+ private SCADomain domain;
+
+ /**
+ * Tests ?wsdl works and returns the correct port endpoint from the WSDL
+ */
+ public void testWSDLPortEndpoint() throws Exception {
+ WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader();
+ wsdlReader.setFeature("javax.wsdl.verbose",false);
+ wsdlReader.setFeature("javax.wsdl.importDocuments",true);
+
+ Definition definition = wsdlReader.readWSDL("http://localhost:8085/services/HelloWorldWebService?wsdl");
+ assertNotNull(definition);
+ Service service = definition.getService(new QName("http://helloworld", "HelloWorldService"));
+ Port port = service.getPort("HelloWorldSoapPort");
+
+ String endpoint = getEndpoint(port);
+ String ip = HttpUtils.getIpAddress();
+ assertEquals("http://" + ip + ":8085/services/HelloWorldWebService", endpoint);
+ }
+
+ /**
+ * Tests ?wsdl works and returns the correct port endpoint from binding.ws with a custom URI
+ */
+ public void testCustomEndpoint() throws Exception {
+ WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader();
+ wsdlReader.setFeature("javax.wsdl.verbose",false);
+ wsdlReader.setFeature("javax.wsdl.importDocuments",true);
+
+ Definition definition = wsdlReader.readWSDL("http://localhost:8085/foo/bar?wsdl");
+ assertNotNull(definition);
+ Service service = definition.getService(new QName("http://itests.axis2.ws.binding.sca.tuscany.apache.org", "HelloWorld"));
+ Port port = service.getPort("HelloWorldSOAP11port_http");
+
+ String endpoint = getEndpoint(port);
+ String ip = HttpUtils.getIpAddress();
+ assertEquals("http://" + ip + ":8085/foo/bar", endpoint);
+ }
+
+ protected String getEndpoint(Port port) {
+ List wsdlPortExtensions = port.getExtensibilityElements();
+ for (final Object extension : wsdlPortExtensions) {
+ if (extension instanceof SOAPAddress) {
+ return ((SOAPAddress) extension).getLocationURI();
+ }
+ }
+ throw new RuntimeException("no SOAPAddress");
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ domain = SCADomain.newInstance("org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-wsdl.composite");
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ domain.close();
+ }
+
+}
diff --git a/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/AbstractHelloWorldOMTestCase.java b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/AbstractHelloWorldOMTestCase.java
new file mode 100644
index 0000000000..56d0537a44
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/AbstractHelloWorldOMTestCase.java
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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.
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2.itests.endpoints;
+
+import junit.framework.Assert;
+import junit.framework.TestCase;
+
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMText;
+import org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOM;
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+
+public abstract class AbstractHelloWorldOMTestCase extends TestCase {
+
+ private SCADomain domain;
+ private HelloWorldOM helloWorld;
+
+ public void testCalculator() throws Exception {
+ OMFactory fac = OMAbstractFactory.getOMFactory();
+ OMElement requestOM = fac.createOMElement("getGreetings", "http://helloworld-om", "helloworld");
+ OMElement parmE = fac.createOMElement("name", "http://helloworld-om", "helloworld");
+ requestOM.addChild(parmE);
+ parmE.addChild(fac.createOMText("petra"));
+ OMElement responseOM = helloWorld.getGreetings(requestOM);
+ OMElement child = (OMElement)responseOM.getFirstElement();
+ Assert.assertEquals("Hello petra", ((OMText)child.getFirstOMChild()).getText());
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ domain = SCADomain.newInstance(getCompositeName());
+ helloWorld = domain.getService(HelloWorldOM.class, "HelloWorldComponent");
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ domain.close();
+ }
+
+ protected String getCompositeName() {
+ String className = this.getClass().getName();
+ return className.substring(0, className.length() - 8).replace('.', '/') + ".composite";
+ }
+
+}
diff --git a/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/DefaultMultiServiceTestCase.java b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/DefaultMultiServiceTestCase.java
new file mode 100644
index 0000000000..661afdddad
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/DefaultMultiServiceTestCase.java
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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.
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2.itests.endpoints;
+
+public class DefaultMultiServiceTestCase extends AbstractHelloWorldOMTestCase {
+ // super class does it all getting composite based on this class name
+}
diff --git a/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/DefaultSingleServiceTestCase.java b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/DefaultSingleServiceTestCase.java
new file mode 100644
index 0000000000..9b2e0eafa0
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/DefaultSingleServiceTestCase.java
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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.
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2.itests.endpoints;
+
+public class DefaultSingleServiceTestCase extends AbstractHelloWorldOMTestCase {
+ // super class does it all getting composite based on this class name
+}
diff --git a/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/WSDLExplicitURITestCase.java b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/WSDLExplicitURITestCase.java
new file mode 100644
index 0000000000..98d9a73926
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/WSDLExplicitURITestCase.java
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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.
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2.itests.endpoints;
+
+public class WSDLExplicitURITestCase extends AbstractHelloWorldOMTestCase {
+ // super class does it all getting composite based on this class name
+}
diff --git a/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/WSDLRelativeURITestCase.java b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/WSDLRelativeURITestCase.java
new file mode 100644
index 0000000000..201d11a79f
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/WSDLRelativeURITestCase.java
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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.
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2.itests.endpoints;
+
+public class WSDLRelativeURITestCase extends AbstractHelloWorldOMTestCase {
+ // super class does it all getting composite based on this class name
+}
diff --git a/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/epr/HelloWorldTestCase.java b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/epr/HelloWorldTestCase.java
new file mode 100644
index 0000000000..f5d87cdcee
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/epr/HelloWorldTestCase.java
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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.
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2.itests.epr;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorld;
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+
+public class HelloWorldTestCase extends TestCase {
+
+ private SCADomain domain;
+ private HelloWorld helloWorld;
+
+ public void testCalculator() throws Exception {
+ assertEquals("Hello petra", helloWorld.getGreetings("petra"));
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ domain = SCADomain.newInstance("org/apache/tuscany/sca/binding/ws/axis2/itests/epr/HelloWorld.composite");
+ helloWorld = domain.getService(HelloWorld.class, "HelloWorldComponent");
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ domain.close();
+ }
+
+}
diff --git a/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/AbstractHelloWorldOMTestCase.java b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/AbstractHelloWorldOMTestCase.java
new file mode 100644
index 0000000000..6cdb12c221
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/AbstractHelloWorldOMTestCase.java
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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.
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2.itests.policy.configparams;
+
+import junit.framework.Assert;
+import junit.framework.TestCase;
+
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMText;
+import org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOM;
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+
+public abstract class AbstractHelloWorldOMTestCase extends TestCase {
+
+ private SCADomain domain;
+ private HelloWorldOM helloWorld;
+
+ public void testHelloWorld() throws Exception {
+ OMFactory fac = OMAbstractFactory.getOMFactory();
+ OMElement requestOM = fac.createOMElement("getGreetings", "http://helloworld-om", "helloworld");
+ OMElement parmE = fac.createOMElement("name", "http://helloworld-om", "helloworld");
+ requestOM.addChild(parmE);
+ parmE.addChild(fac.createOMText("petra"));
+ OMElement responseOM = helloWorld.getGreetings(requestOM);
+ OMElement child = (OMElement)responseOM.getFirstElement();
+ Assert.assertEquals("Hello petra", ((OMText)child.getFirstOMChild()).getText());
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ domain = SCADomain.newInstance(getCompositeName());
+ helloWorld = domain.getService(HelloWorldOM.class, "HelloWorldComponent");
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ domain.close();
+ }
+
+ protected String getCompositeName() {
+ String className = this.getClass().getName();
+ return className.substring(0, className.length() - 8).replace('.', '/') + ".composite";
+ }
+
+}
diff --git a/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/ClientPWCBHandler.java b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/ClientPWCBHandler.java
new file mode 100644
index 0000000000..dcc4081230
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/ClientPWCBHandler.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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.
+ */
+package org.apache.tuscany.sca.binding.ws.axis2.itests.policy.configparams;
+
+import java.io.IOException;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.UnsupportedCallbackException;
+
+import org.apache.ws.security.WSPasswordCallback;
+
+/**
+ * Sample userid passwd generation class
+ */
+public class ClientPWCBHandler implements CallbackHandler {
+
+ public void handle(Callback[] callbacks) throws IOException,
+ UnsupportedCallbackException {
+ for (int i = 0; i < callbacks.length; i++) {
+ System.out.println("*** Calling Client UserId/Password Handler .... ");
+ WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i];
+ pwcb.setPassword("TuscanyWsUserPasswd");
+ }
+ }
+
+}
diff --git a/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/IntegrityPWCBHandler.java b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/IntegrityPWCBHandler.java
new file mode 100644
index 0000000000..38e8d87944
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/IntegrityPWCBHandler.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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.
+ */
+package org.apache.tuscany.sca.binding.ws.axis2.itests.policy.configparams;
+
+import java.io.IOException;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.UnsupportedCallbackException;
+
+import org.apache.ws.security.WSPasswordCallback;
+
+/**
+ * Sample userid passwd generation class
+ */
+public class IntegrityPWCBHandler implements CallbackHandler {
+
+ public void handle(Callback[] callbacks) throws IOException,
+ UnsupportedCallbackException {
+ for (int i = 0; i < callbacks.length; i++) {
+ System.out.println("*** Calling Integrity Password Handler .... ");
+ WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i];
+ pwcb.setPassword("TuscanyWsUserPasswd");
+ }
+ }
+
+}
diff --git a/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/ServerPWCBHandler.java b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/ServerPWCBHandler.java
new file mode 100644
index 0000000000..4e9ca3a32e
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/ServerPWCBHandler.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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.
+ */
+package org.apache.tuscany.sca.binding.ws.axis2.itests.policy.configparams;
+
+import java.io.IOException;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.UnsupportedCallbackException;
+
+import org.apache.ws.security.WSPasswordCallback;
+
+/**
+ * Sample userid passwd generation class
+ */
+public class ServerPWCBHandler implements CallbackHandler {
+
+ public void handle(Callback[] callbacks) throws IOException,
+ UnsupportedCallbackException {
+ for (int i = 0; i < callbacks.length; i++) {
+ System.out.println("*** Calling Server User/Passwd Handler....");
+ WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i];
+ pwcb.setPassword("TuscanyWsUserPasswd");
+ }
+ }
+
+}
diff --git a/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityAuthenticationTestCase.java b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityAuthenticationTestCase.java
new file mode 100644
index 0000000000..c6b1195040
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityAuthenticationTestCase.java
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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.
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2.itests.policy.configparams;
+
+public class WSSecurityAuthenticationTestCase extends AbstractHelloWorldOMTestCase {
+ // super class does it all getting composite based on this class name
+}
diff --git a/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityConfidentialityTestCaseFIXBouncyCastleIssue.java b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityConfidentialityTestCaseFIXBouncyCastleIssue.java
new file mode 100644
index 0000000000..1fd1b8d48e
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityConfidentialityTestCaseFIXBouncyCastleIssue.java
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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.
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2.itests.policy.configparams;
+
+import java.security.Provider;
+import java.security.Security;
+
+public class WSSecurityConfidentialityTestCaseFIXBouncyCastleIssue extends AbstractHelloWorldOMTestCase {
+
+ /**
+ * @see org.apache.tuscany.sca.binding.ws.axis2.itests.policy.configparams.AbstractHelloWorldOMTestCase#setUp()
+ */
+ @Override
+ protected void setUp() throws Exception {
+ // Workaround an issue with IBM JDK
+ Provider jce = Security.getProvider("IBMJCE");
+ if (jce != null) {
+ // Make sure IBMJCE is used first
+ Security.removeProvider("IBMJCE");
+ Security.insertProviderAt(jce, 1);
+ }
+ super.setUp();
+ }
+ // super class does it all getting composite based on this class name
+}
diff --git a/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityIntegrityTestCase.java b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityIntegrityTestCase.java
new file mode 100644
index 0000000000..824132161c
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityIntegrityTestCase.java
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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.
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2.itests.policy.configparams;
+
+public class WSSecurityIntegrityTestCase extends AbstractHelloWorldOMTestCase {
+ // super class does it all getting composite based on this class name
+}
diff --git a/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/AbstractHelloWorldOMTestCase.java b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/AbstractHelloWorldOMTestCase.java
new file mode 100644
index 0000000000..04de589fb1
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/AbstractHelloWorldOMTestCase.java
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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.
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2.itests.policy.wspolicy;
+
+import junit.framework.Assert;
+import junit.framework.TestCase;
+
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMText;
+import org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOM;
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+
+public abstract class AbstractHelloWorldOMTestCase extends TestCase {
+
+ private SCADomain domain;
+ private HelloWorldOM helloWorld;
+
+ public void testHelloWorld() throws Exception {
+ OMFactory fac = OMAbstractFactory.getOMFactory();
+ OMElement requestOM = fac.createOMElement("getGreetings", "http://helloworld-om", "helloworld");
+ OMElement parmE = fac.createOMElement("name", "http://helloworld-om", "helloworld");
+ requestOM.addChild(parmE);
+ parmE.addChild(fac.createOMText("petra"));
+ OMElement responseOM = helloWorld.getGreetings(requestOM);
+ OMElement child = (OMElement)responseOM.getFirstElement();
+ Assert.assertEquals("Hello petra", ((OMText)child.getFirstOMChild()).getText());
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ domain = SCADomain.newInstance(getCompositeName());
+ helloWorld = domain.getService(HelloWorldOM.class, "HelloWorldComponent");
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ domain.close();
+ }
+
+ protected String getCompositeName() {
+ String className = this.getClass().getName();
+ return className.substring(0, className.length() - 8).replace('.', '/') + ".composite";
+ }
+
+}
diff --git a/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/ClientPWCBHandler.java b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/ClientPWCBHandler.java
new file mode 100644
index 0000000000..9159d25b85
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/ClientPWCBHandler.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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.
+ */
+package org.apache.tuscany.sca.binding.ws.axis2.itests.policy.wspolicy;
+
+import java.io.IOException;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.UnsupportedCallbackException;
+
+import org.apache.ws.security.WSPasswordCallback;
+
+/**
+ * Sample userid passwd generation class
+ */
+public class ClientPWCBHandler implements CallbackHandler {
+
+ public void handle(Callback[] callbacks) throws IOException,
+ UnsupportedCallbackException {
+ for (int i = 0; i < callbacks.length; i++) {
+ System.out.println("*** Calling Client UserId/Password Handler .... ");
+ WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i];
+ pwcb.setPassword("TuscanyWsUserPasswd");
+ }
+ }
+
+}
diff --git a/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/IntegrityPWCBHandler.java b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/IntegrityPWCBHandler.java
new file mode 100644
index 0000000000..17ad8a0677
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/IntegrityPWCBHandler.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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.
+ */
+package org.apache.tuscany.sca.binding.ws.axis2.itests.policy.wspolicy;
+
+import java.io.IOException;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.UnsupportedCallbackException;
+
+import org.apache.ws.security.WSPasswordCallback;
+
+/**
+ * Sample userid passwd generation class
+ */
+public class IntegrityPWCBHandler implements CallbackHandler {
+
+ public void handle(Callback[] callbacks) throws IOException,
+ UnsupportedCallbackException {
+ for (int i = 0; i < callbacks.length; i++) {
+ System.out.println("*** Calling Integrity Password Handler .... ");
+ WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i];
+ pwcb.setPassword("TuscanyWsUserPasswd");
+ }
+ }
+
+}
diff --git a/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/ServerPWCBHandler.java b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/ServerPWCBHandler.java
new file mode 100644
index 0000000000..cd4c402667
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/ServerPWCBHandler.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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.
+ */
+package org.apache.tuscany.sca.binding.ws.axis2.itests.policy.wspolicy;
+
+import java.io.IOException;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.UnsupportedCallbackException;
+
+import org.apache.ws.security.WSPasswordCallback;
+
+/**
+ * Sample userid passwd generation class
+ */
+public class ServerPWCBHandler implements CallbackHandler {
+
+ public void handle(Callback[] callbacks) throws IOException,
+ UnsupportedCallbackException {
+ for (int i = 0; i < callbacks.length; i++) {
+ System.out.println("*** Calling Server User/Passwd Handler....");
+ WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i];
+ pwcb.setPassword("TuscanyWsUserPasswd");
+ }
+ }
+
+}
diff --git a/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityAuthenticationTestCase.java b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityAuthenticationTestCase.java
new file mode 100644
index 0000000000..a439ff4c8f
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityAuthenticationTestCase.java
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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.
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2.itests.policy.wspolicy;
+
+public class WSSecurityAuthenticationTestCase extends AbstractHelloWorldOMTestCase {
+ // super class does it all getting composite based on this class name
+}
diff --git a/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityConfidentialityTestCaseFIXBouncyCastleIssue.java b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityConfidentialityTestCaseFIXBouncyCastleIssue.java
new file mode 100644
index 0000000000..f37a8deeb7
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityConfidentialityTestCaseFIXBouncyCastleIssue.java
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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.
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2.itests.policy.wspolicy;
+
+import java.security.Provider;
+import java.security.Security;
+
+public class WSSecurityConfidentialityTestCaseFIXBouncyCastleIssue extends AbstractHelloWorldOMTestCase {
+
+ /**
+ * @see org.apache.tuscany.sca.binding.ws.axis2.itests.policy.configparams.AbstractHelloWorldOMTestCase#setUp()
+ */
+ @Override
+ protected void setUp() throws Exception {
+ // Workaround an issue with IBM JDK
+ Provider jce = Security.getProvider("IBMJCE");
+ if (jce != null) {
+ // Make sure IBMJCE is used first
+ Security.removeProvider("IBMJCE");
+ Security.insertProviderAt(jce, 1);
+ }
+ super.setUp();
+ }
+ // super class does it all getting composite based on this class name
+}
diff --git a/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityIntegrityTestCase.java b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityIntegrityTestCase.java
new file mode 100644
index 0000000000..18bbf98628
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityIntegrityTestCase.java
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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.
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2.itests.policy.wspolicy;
+
+public class WSSecurityIntegrityTestCase extends AbstractHelloWorldOMTestCase {
+ // super class does it all getting composite based on this class name
+}
diff --git a/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/soap12/HelloWorldSOAP12TestCase.java b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/soap12/HelloWorldSOAP12TestCase.java
new file mode 100644
index 0000000000..b2ccd7f97d
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/soap12/HelloWorldSOAP12TestCase.java
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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.
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2.itests.soap12 ;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorld;
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+
+public class HelloWorldSOAP12TestCase extends TestCase {
+
+ private SCADomain domain;
+
+ public void testHelloWorld() throws Exception {
+ HelloWorld helloWorld = domain.getService(HelloWorld.class, "HelloWorldClient");
+ assertEquals("Hello petra", helloWorld.getGreetings("petra"));
+ }
+ public void testHelloWorldSOAP() throws Exception {
+ HelloWorld helloWorld = domain.getService(HelloWorld.class, "HelloWorldClientSOAP");
+ assertEquals("Hello petra", helloWorld.getGreetings("petra"));
+ }
+ public void testHelloWorldSOAP11() throws Exception {
+ HelloWorld helloWorld = domain.getService(HelloWorld.class, "HelloWorldClientSOAP11");
+ assertEquals("Hello petra", helloWorld.getGreetings("petra"));
+ }
+ public void testHelloWorldSOAP12() throws Exception {
+ HelloWorld helloWorld = domain.getService(HelloWorld.class, "HelloWorldClientSOAP12");
+ assertEquals("Hello petra", helloWorld.getGreetings("petra"));
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ domain = SCADomain.newInstance("org/apache/tuscany/sca/binding/ws/axis2/itests/soap12/HelloWorldSOAP12.composite");
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ domain.close();
+ }
+
+}
diff --git a/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/soap12/QuestionMarkWSDLTestCase.java b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/soap12/QuestionMarkWSDLTestCase.java
new file mode 100644
index 0000000000..9b92f6862f
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0.1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/soap12/QuestionMarkWSDLTestCase.java
@@ -0,0 +1,121 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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.
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2.itests.soap12;
+
+import java.util.List;
+
+import javax.wsdl.Definition;
+import javax.wsdl.Port;
+import javax.wsdl.Service;
+import javax.wsdl.extensions.soap.SOAPAddress;
+import javax.wsdl.extensions.soap12.SOAP12Address;
+import javax.wsdl.factory.WSDLFactory;
+import javax.wsdl.xml.WSDLReader;
+import javax.xml.namespace.QName;
+
+import junit.framework.TestCase;
+
+import org.apache.axis2.transport.http.server.HttpUtils;
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+
+/**
+ * Test ?wsdl works and that the returned wsdl has the correct endpoint
+ */
+public class QuestionMarkWSDLTestCase extends TestCase {
+
+ private SCADomain domain;
+
+ /**
+ * Tests ?wsdl returns a soap 1.1 port by default
+ */
+ public void testSOAPDefault() throws Exception {
+ WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader();
+ wsdlReader.setFeature("javax.wsdl.verbose",false);
+ wsdlReader.setFeature("javax.wsdl.importDocuments",true);
+
+ Definition definition = wsdlReader.readWSDL("http://localhost:8085/ep1?wsdl");
+ assertNotNull(definition);
+ Service service = definition.getService(new QName("http://itests.axis2.ws.binding.sca.tuscany.apache.org", "HelloWorld"));
+ Port port = service.getPort("HelloWorldSOAP11port_http");
+
+ String endpoint = getEndpoint(port);
+ String ip = HttpUtils.getIpAddress();
+ assertEquals("http://" + ip + ":8085/ep1", endpoint);
+ }
+
+ /**
+ * Tests ?wsdl returns a soap 1.1 port when binding uses requires="soap11"
+ */
+ public void testSOAP11Endpoint() throws Exception {
+ WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader();
+ wsdlReader.setFeature("javax.wsdl.verbose",false);
+ wsdlReader.setFeature("javax.wsdl.importDocuments",true);
+
+ Definition definition = wsdlReader.readWSDL("http://localhost:8085/ep2?wsdl");
+ assertNotNull(definition);
+ Service service = definition.getService(new QName("http://itests.axis2.ws.binding.sca.tuscany.apache.org", "HelloWorld"));
+ Port port = service.getPort("HelloWorldSOAP11port_http");
+
+ String endpoint = getEndpoint(port);
+ String ip = HttpUtils.getIpAddress();
+ assertEquals("http://" + ip + ":8085/ep2", endpoint);
+ }
+
+ /**
+ * Tests ?wsdl returns a soap 1.2 port when binding uses requires="soap12"
+ */
+ public void testSOAP12Endpoint() throws Exception {
+ WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader();
+ wsdlReader.setFeature("javax.wsdl.verbose",false);
+ wsdlReader.setFeature("javax.wsdl.importDocuments",true);
+
+ Definition definition = wsdlReader.readWSDL("http://localhost:8085/ep3?wsdl");
+ assertNotNull(definition);
+ Service service = definition.getService(new QName("http://itests.axis2.ws.binding.sca.tuscany.apache.org", "HelloWorld"));
+ Port port = service.getPort("HelloWorldSOAP12port_http");
+
+ String endpoint = getEndpoint(port);
+ String ip = HttpUtils.getIpAddress();
+ assertEquals("http://" + ip + ":8085/ep3", endpoint);
+ }
+
+ protected String getEndpoint(Port port) {
+ List wsdlPortExtensions = port.getExtensibilityElements();
+ for (final Object extension : wsdlPortExtensions) {
+ if (extension instanceof SOAPAddress) {
+ return ((SOAPAddress) extension).getLocationURI();
+ } else if (extension instanceof SOAP12Address) {
+ return ((SOAP12Address) extension).getLocationURI();
+ }
+ }
+ throw new RuntimeException("no SOAPAddress");
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ domain = SCADomain.newInstance("org/apache/tuscany/sca/binding/ws/axis2/itests/soap12/questionmark-wsdl.composite");
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ domain.close();
+ }
+
+}