diff options
Diffstat (limited to 'branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache')
20 files changed, 0 insertions, 875 deletions
diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/Axis2ReferenceTestCase.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/Axis2ReferenceTestCase.java deleted file mode 100755 index 6b364eec68..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/Axis2ReferenceTestCase.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * 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.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/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/Axis2ServiceTestCase.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/Axis2ServiceTestCase.java deleted file mode 100755 index 13ea94dd66..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/Axis2ServiceTestCase.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * 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.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/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/Greeter.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/Greeter.java deleted file mode 100755 index c604b954a4..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/Greeter.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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.axis2; - -public interface Greeter { - - String sayHi(); - - String greetMe(String requestType); - - void greetMeOneWay(String requestType); - - void greetMeWithCallback(String requestType); - -} diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/GreetingCallback.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/GreetingCallback.java deleted file mode 100644 index bcf9baa42d..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/GreetingCallback.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * 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.axis2; - -public interface GreetingCallback { - - void greetMeCallback(String greetMeResponse); -} diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorld.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorld.java deleted file mode 100644 index dfc78e7cd8..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorld.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * 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.axis2.itests; - -import org.osoa.sca.annotations.Remotable; - -@Remotable -public interface HelloWorld { - - public String getGreetings(String s); - -} diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldComponent.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldComponent.java deleted file mode 100644 index 3978726f2a..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldComponent.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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.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/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldMultiService.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldMultiService.java deleted file mode 100644 index 8c1120f545..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldMultiService.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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.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/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldOM.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldOM.java deleted file mode 100644 index 897ac8dcb9..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldOM.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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.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/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldOM2.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldOM2.java deleted file mode 100644 index 8981541ad8..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldOM2.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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.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/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldOMComponent.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldOMComponent.java deleted file mode 100644 index 6b6abb843f..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldOMComponent.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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.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/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldOMService.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldOMService.java deleted file mode 100644 index 861509c003..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldOMService.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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.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/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldOMTestCase.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldOMTestCase.java deleted file mode 100644 index 40aa0e4480..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldOMTestCase.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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.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 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()); - } - - protected void setUp() throws Exception { - domain = SCADomain.newInstance("org/apache/tuscany/sca/binding/axis2/itests/helloworld-om.composite"); - helloWorld = domain.getService(HelloWorldOM.class, "HelloWorldComponent"); - } - - protected void tearDown() throws Exception { - domain.close(); - } - -} diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldService.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldService.java deleted file mode 100644 index d7d6b93f34..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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.axis2.itests; - -public class HelloWorldService implements HelloWorld { - - public String getGreetings(String s) { - return "Hello " + s; - } - -} diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldTestCaseFIXME.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldTestCaseFIXME.java deleted file mode 100644 index ee42e8cb5f..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldTestCaseFIXME.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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.axis2.itests; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.host.embedded.SCADomain; - -public class HelloWorldTestCaseFIXME extends TestCase { - - private SCADomain domain; - private HelloWorld helloWorld; - - public void testCalculator() throws Exception { - assertEquals("Hello petra", helloWorld.getGreetings("petra")); - } - - protected void setUp() throws Exception { - domain = SCADomain.newInstance("org/apache/tuscany/sca/binding/axis2/itests/HelloWorld.composite"); - helloWorld = domain.getService(HelloWorld.class, "HelloWorldComponent"); - } - - protected void tearDown() throws Exception { - domain.close(); - } - -} diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/QuestionMarkWSDLTestCaseFIXME.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/QuestionMarkWSDLTestCaseFIXME.java deleted file mode 100644 index 11eba9a8c4..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/QuestionMarkWSDLTestCaseFIXME.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * 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.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; - -/** - * TODO: This doesn't work right now as it seems to cause hangs when running - * from mvn. Also running in eclipse mostly only works if you comment out - * one of the test methods. - */ -public class QuestionMarkWSDLTestCaseFIXME 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:8080/services/HelloWorldWebService?wsdl"); - assertNotNull(definition); - Service service = definition.getService(new QName("http://helloworld-om", "HelloWorldService")); - Port port = service.getPort("HelloWorldSoapPort"); - - String endpoint = getEndpoint(port); - String ip = HttpUtils.getIpAddress(); - assertEquals("http://" + ip + ":8080/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:8080/HelloWorldService/foo/bar?wsdl"); - assertNotNull(definition); - Service service = definition.getService(new QName("http://helloworld-om", "HelloWorldService")); - Port port = service.getPort("HelloWorldSoapPort"); - - String endpoint = getEndpoint(port); - String ip = HttpUtils.getIpAddress(); - assertEquals("http://" + ip + ":8080/HelloWorldService/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"); - } - - protected void setUp() throws Exception { - domain = SCADomain.newInstance("org/apache/tuscany/sca/binding/axis2/itests/questionmark-wsdl.composite"); - } - - protected void tearDown() throws Exception { - domain.close(); - } - -} diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/endpoints/AbstractHelloWorldOMTestCase.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/endpoints/AbstractHelloWorldOMTestCase.java deleted file mode 100644 index b52c10e341..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/endpoints/AbstractHelloWorldOMTestCase.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * 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.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.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()); - } - - protected void setUp() throws Exception { - domain = SCADomain.newInstance(getCompositeName()); - helloWorld = domain.getService(HelloWorldOM.class, "HelloWorldComponent"); - } - - 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/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/endpoints/DefaultMultiServiceTestCase.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/endpoints/DefaultMultiServiceTestCase.java deleted file mode 100644 index 3f1677fa90..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/endpoints/DefaultMultiServiceTestCase.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * 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.axis2.itests.endpoints; - -public class DefaultMultiServiceTestCase extends AbstractHelloWorldOMTestCase { - // super class does it all getting composite based on this class name -} diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/endpoints/DefaultSingleServiceTestCase.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/endpoints/DefaultSingleServiceTestCase.java deleted file mode 100644 index 9b0ee7304d..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/endpoints/DefaultSingleServiceTestCase.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * 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.axis2.itests.endpoints; - -public class DefaultSingleServiceTestCase extends AbstractHelloWorldOMTestCase { - // super class does it all getting composite based on this class name -} diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/endpoints/WSDLExplicitURITestCase.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/endpoints/WSDLExplicitURITestCase.java deleted file mode 100644 index 7155d80100..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/endpoints/WSDLExplicitURITestCase.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * 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.axis2.itests.endpoints; - -public class WSDLExplicitURITestCase extends AbstractHelloWorldOMTestCase { - // super class does it all getting composite based on this class name -} diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/endpoints/WSDLRelativeURITestCase.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/endpoints/WSDLRelativeURITestCase.java deleted file mode 100644 index ce862be74e..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/endpoints/WSDLRelativeURITestCase.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * 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.axis2.itests.endpoints; - -public class WSDLRelativeURITestCase extends AbstractHelloWorldOMTestCase { - // super class does it all getting composite based on this class name -} |