From 26c7d87982e6eb53ff3f5b394b06af135395824b Mon Sep 17 00:00:00 2001 From: antelder Date: Wed, 6 Oct 2010 13:54:26 +0000 Subject: Copy itest and compliance test to be under testing folder git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1005039 13f79535-47bb-0310-9956-ffa450edef68 --- .../tuscany/sca/binding/ws/axis2/Account.java | 34 ++++++ .../sca/binding/ws/axis2/AccountService.java | 33 ++++++ .../sca/binding/ws/axis2/CustomerProfileData.java | 113 ++++++++++++++++++ .../tuscany/sca/binding/ws/axis2/HelloWorld.java | 29 +++++ .../tuscany/sca/binding/ws/axis2/HelloWorldOM.java | 30 +++++ .../binding/ws/axis2/HelloWorldOMComponent.java | 34 ++++++ .../sca/binding/ws/axis2/HelloWorldOMService.java | 41 +++++++ .../sca/binding/ws/axis2/HelloWorldService.java | 28 +++++ .../tuscany/sca/binding/ws/axis2/package-info.java | 21 ++++ .../tuscany/sca/binding/ws/axis2/customerdata.xsd | 36 ++++++ .../tuscany/sca/binding/ws/axis2/customerdefs.xsd | 27 +++++ .../tuscany/sca/binding/ws/axis2/customerinfo.xsd | 31 +++++ .../ws/axis2/helloworld-om-merged.composite | 43 +++++++ .../sca/binding/ws/axis2/helloworld-om-merged.wsdl | 59 ++++++++++ .../tuscany/sca/binding/ws/axis2/helloworld.wsdl | 86 ++++++++++++++ .../ws/axis2/questionmark-import-nested.wsdl | 70 ++++++++++++ .../sca/binding/ws/axis2/questionmark-import.wsdl | 49 ++++++++ .../sca/binding/ws/axis2/questionmark-include.wsdl | 90 +++++++++++++++ .../ws/axis2/questionmark-wsdl-import.composite | 31 +++++ .../ws/axis2/questionmark-wsdl-include.composite | 31 +++++ .../binding/ws/axis2/questionmark-wsdl.composite | 33 ++++++ .../ws/axis2/HelloWorldWSDLMergedTestCase.java | 62 ++++++++++ .../ws/axis2/QuestionMarkWSDLImportTestCase.java | 99 ++++++++++++++++ .../ws/axis2/QuestionMarkWSDLIncludeTestCase.java | 98 ++++++++++++++++ .../binding/ws/axis2/QuestionMarkWSDLTestCase.java | 126 +++++++++++++++++++++ 25 files changed, 1334 insertions(+) create mode 100644 sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Account.java create mode 100644 sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/AccountService.java create mode 100644 sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/CustomerProfileData.java create mode 100644 sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorld.java create mode 100644 sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOM.java create mode 100644 sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOMComponent.java create mode 100644 sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOMService.java create mode 100644 sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldService.java create mode 100644 sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/package-info.java create mode 100644 sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/customerdata.xsd create mode 100644 sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/customerdefs.xsd create mode 100644 sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/customerinfo.xsd create mode 100644 sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-om-merged.composite create mode 100644 sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-om-merged.wsdl create mode 100644 sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld.wsdl create mode 100644 sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-import-nested.wsdl create mode 100644 sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-import.wsdl create mode 100644 sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-include.wsdl create mode 100644 sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-wsdl-import.composite create mode 100644 sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-wsdl-include.composite create mode 100644 sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-wsdl.composite create mode 100644 sca-java-2.x/trunk/testing/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldWSDLMergedTestCase.java create mode 100644 sca-java-2.x/trunk/testing/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/QuestionMarkWSDLImportTestCase.java create mode 100644 sca-java-2.x/trunk/testing/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/QuestionMarkWSDLIncludeTestCase.java create mode 100644 sca-java-2.x/trunk/testing/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/QuestionMarkWSDLTestCase.java (limited to 'sca-java-2.x/trunk/testing/itest/ws/wsdl/src') diff --git a/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Account.java b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Account.java new file mode 100644 index 0000000000..963712c0c2 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Account.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; + +import org.oasisopen.sca.annotation.Remotable; + +/** + * Test ?wsdl works and that the returned WSDL has the correct endpoint + * + * @version $Rev$ $Date$ + */ +@Remotable +public interface Account { + + CustomerProfileData getCustomerProfile(String loginID); + +} diff --git a/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/AccountService.java b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/AccountService.java new file mode 100644 index 0000000000..ab5fc0f873 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/AccountService.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; + +/** + * Test ?wsdl works and that the returned WSDL has the correct endpoint + * + * @version $Rev$ $Date$ + */ +public class AccountService implements Account { + + public CustomerProfileData getCustomerProfile(String loginID) { + return new CustomerProfileData(loginID); + } + +} diff --git a/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/CustomerProfileData.java b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/CustomerProfileData.java new file mode 100644 index 0000000000..6f6a374450 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/CustomerProfileData.java @@ -0,0 +1,113 @@ +/* + * 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; + +/** + * Test ?wsdl works and that the returned WSDL has the correct endpoint + * + * @version $Rev$ $Date$ + */ +public class CustomerProfileData { + + private String firstName; + private String lastName; + private String address; + private String email; + private String loginID; + private String password; + private int id; + + public CustomerProfileData() { + firstName = "John"; + lastName = "Doe"; + address = "345 Main Street"; + email = "john@doe.org"; + this.loginID = "DefaultloginID"; + password = "hello"; + id = 1234; + } + + public CustomerProfileData(String loginID) { + firstName = "John"; + lastName = "Doe"; + address = "345 Main Street"; + email = "john@doe.org"; + this.loginID = loginID; + password = "hello"; + id = 1234; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getLoginID() { + return loginID; + } + + public void setLoginID(String loginID) { + this.loginID = loginID; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + +} diff --git a/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorld.java b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorld.java new file mode 100644 index 0000000000..d6db1c2d0b --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/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; + +import org.oasisopen.sca.annotation.Remotable; + +@Remotable +public interface HelloWorld { + + String getGreetings(String s); + +} diff --git a/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOM.java b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOM.java new file mode 100644 index 0000000000..e248815805 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/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; + +import org.apache.axiom.om.OMElement; +import org.oasisopen.sca.annotation.Remotable; + +@Remotable +public interface HelloWorldOM { + + OMElement getGreetings(OMElement parmE); + +} diff --git a/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOMComponent.java b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOMComponent.java new file mode 100644 index 0000000000..8439696fa8 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/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; + +import org.apache.axiom.om.OMElement; +import org.oasisopen.sca.annotation.Reference; + +public class HelloWorldOMComponent implements HelloWorldOM { + + @Reference + public HelloWorldOM helloWorldWS; + + public OMElement getGreetings(OMElement om) { + return helloWorldWS.getGreetings(om); + } + +} diff --git a/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOMService.java b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOMService.java new file mode 100644 index 0000000000..5b8578c816 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOMService.java @@ -0,0 +1,41 @@ +/* + * 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 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) { + System.out.println(" **** getGreetings **** "); + 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-2.x/trunk/testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldService.java b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldService.java new file mode 100644 index 0000000000..052b49ff55 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/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; + +public class HelloWorldService implements HelloWorld { + + public String getGreetings(String s) { + return "Hello " + s; + } + +} diff --git a/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/package-info.java b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/package-info.java new file mode 100644 index 0000000000..805a515382 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/package-info.java @@ -0,0 +1,21 @@ +/* + * 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. + */ + +@javax.xml.bind.annotation.XmlSchema(namespace = "http://accounts") +package org.apache.tuscany.sca.binding.ws.axis2; diff --git a/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/customerdata.xsd b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/customerdata.xsd new file mode 100644 index 0000000000..2479f3dbe5 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/customerdata.xsd @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + diff --git a/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/customerdefs.xsd b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/customerdefs.xsd new file mode 100644 index 0000000000..24cf3eebad --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/customerdefs.xsd @@ -0,0 +1,27 @@ + + + + + + + + diff --git a/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/customerinfo.xsd b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/customerinfo.xsd new file mode 100644 index 0000000000..b78909142f --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/customerinfo.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-om-merged.composite b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-om-merged.composite new file mode 100644 index 0000000000..c520d2e3b2 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-om-merged.composite @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-om-merged.wsdl b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-om-merged.wsdl new file mode 100644 index 0000000000..29be66fb71 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-om-merged.wsdl @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld.wsdl b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld.wsdl new file mode 100644 index 0000000000..1a2272d7ee --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld.wsdl @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-import-nested.wsdl b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-import-nested.wsdl new file mode 100644 index 0000000000..686b08a1d4 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-import-nested.wsdl @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-import.wsdl b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-import.wsdl new file mode 100644 index 0000000000..105c82a411 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-import.wsdl @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-include.wsdl b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-include.wsdl new file mode 100644 index 0000000000..7a7a4033ce --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-include.wsdl @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-wsdl-import.composite b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-wsdl-import.composite new file mode 100644 index 0000000000..65270b8d6c --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-wsdl-import.composite @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-wsdl-include.composite b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-wsdl-include.composite new file mode 100644 index 0000000000..02395c4615 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-wsdl-include.composite @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-wsdl.composite b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-wsdl.composite new file mode 100644 index 0000000000..6b06cec722 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-wsdl.composite @@ -0,0 +1,33 @@ + + + + + + + + + + + + + diff --git a/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldWSDLMergedTestCase.java b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldWSDLMergedTestCase.java new file mode 100644 index 0000000000..b79ee7d254 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldWSDLMergedTestCase.java @@ -0,0 +1,62 @@ +/* + * 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.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.node.Contribution; +import org.apache.tuscany.sca.node.Node; +import org.apache.tuscany.sca.node.NodeFactory; + +public class HelloWorldWSDLMergedTestCase extends TestCase { + + private Node node; + private HelloWorldOM helloWorld; + + @Override + protected void setUp() throws Exception { + String contribution = "target/classes"; + node = NodeFactory.newInstance().createNode("org/apache/tuscany/sca/binding/ws/axis2/helloworld-om-merged.composite", new Contribution("test", contribution)); + node.start(); + helloWorld = node.getService(HelloWorldOM.class, "HelloWorldWSDLMergedComponent"); + } + + 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 tearDown() throws Exception { + node.stop(); + } + +} diff --git a/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/QuestionMarkWSDLImportTestCase.java b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/QuestionMarkWSDLImportTestCase.java new file mode 100644 index 0000000000..76ea53681f --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/QuestionMarkWSDLImportTestCase.java @@ -0,0 +1,99 @@ +/* + * 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.io.BufferedReader; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.net.URL; +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.tuscany.sca.node.Contribution; +import org.apache.tuscany.sca.node.Node; +import org.apache.tuscany.sca.node.NodeFactory; + +/** + * Test ?wsdl works and that the returned WSDL has the correct endpoint + * + * @version $Rev$ $Date$ + */ +public class QuestionMarkWSDLImportTestCase extends TestCase { + + private Node node; + + /** + * Tests ?wsdl works and returns the correct port endpoint from the WSDL + */ + public void testWSDLImportPortEndpoint() throws Exception { + InputStream inp = new URL("http://localhost:8086/AccountService?wsdl").openStream(); + BufferedReader br = new BufferedReader(new InputStreamReader(inp)); + String line; + while((line = br.readLine()) != null) { + System.out.println(line); + } + br.close(); + + WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader(); + wsdlReader.setFeature("javax.wsdl.verbose", false); + wsdlReader.setFeature("javax.wsdl.importDocuments", true); + + Definition definition = wsdlReader.readWSDL("http://localhost:8086/AccountService?wsdl"); + assertNotNull(definition); + Service service = definition.getService(new QName("http://account2/AccountService/Account", "AccountService")); + Port port = service.getPort("AccountPort"); + + String endpoint = getEndpoint(port); + // String ip = HttpUtils.getIpAddress(); + assertEquals("http://localhost:8086/AccountService", endpoint); + } + + private 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 { + String contribution = "target/classes"; + node = NodeFactory.newInstance().createNode("org/apache/tuscany/sca/binding/ws/axis2/questionmark-wsdl-import.composite", new Contribution("test", contribution)); + node.start(); + } + + @Override + protected void tearDown() throws Exception { + node.stop(); + } + +} diff --git a/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/QuestionMarkWSDLIncludeTestCase.java b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/QuestionMarkWSDLIncludeTestCase.java new file mode 100644 index 0000000000..54a40afc63 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/QuestionMarkWSDLIncludeTestCase.java @@ -0,0 +1,98 @@ +/* + * 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.io.BufferedReader; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.net.URL; +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.tuscany.sca.node.Contribution; +import org.apache.tuscany.sca.node.Node; +import org.apache.tuscany.sca.node.NodeFactory; + +/** + * Test ?wsdl works and that the returned WSDL has the correct endpoint + * + * @version $Rev$ $Date$ + */ +public class QuestionMarkWSDLIncludeTestCase extends TestCase { + + private Node node; + + /** + * Tests ?wsdl works and returns the correct port endpoint from the WSDL + */ + public void testWSDLIncludePortEndpoint() throws Exception { + InputStream inp = new URL("http://localhost:8085/AccountService?wsdl").openStream(); + BufferedReader br = new BufferedReader(new InputStreamReader(inp)); + String line; + while((line = br.readLine()) != null) { + System.out.println(line); + } + br.close(); + + WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader(); + wsdlReader.setFeature("javax.wsdl.verbose", false); + wsdlReader.setFeature("javax.wsdl.importDocuments", true); + + Definition definition = wsdlReader.readWSDL("http://localhost:8085/AccountService?wsdl"); + assertNotNull(definition); + Service service = definition.getService(new QName("http://accounts/AccountService/Account", "AccountService")); + Port port = service.getPort("AccountPort"); + + String endpoint = getEndpoint(port); + assertEquals("http://localhost:8085/AccountService", endpoint); + } + + private 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 { + String contribution = "target/classes"; + node = NodeFactory.newInstance().createNode("org/apache/tuscany/sca/binding/ws/axis2/questionmark-wsdl-include.composite", new Contribution("test", contribution)); + node.start(); + } + + @Override + protected void tearDown() throws Exception { + node.stop(); + } + +} diff --git a/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/QuestionMarkWSDLTestCase.java b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/QuestionMarkWSDLTestCase.java new file mode 100644 index 0000000000..0148460b5c --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/QuestionMarkWSDLTestCase.java @@ -0,0 +1,126 @@ +/* + * 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.io.BufferedReader; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.net.URL; +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.tuscany.sca.node.Contribution; +import org.apache.tuscany.sca.node.Node; +import org.apache.tuscany.sca.node.NodeFactory; + +/** + * Test ?wsdl works and that the returned WSDL has the correct endpoint + * + * @version $Rev$ $Date$ + */ +public class QuestionMarkWSDLTestCase extends TestCase { + + private Node node; + + /** + * Tests ?wsdl works and returns the correct port endpoint from the WSDL + */ + public void testWSDLPortEndpoint() throws Exception { + InputStream inp = new URL("http://localhost:8085/services/HelloWorldWebService2?wsdl").openStream(); + BufferedReader br = new BufferedReader(new InputStreamReader(inp)); + String line; + while((line = br.readLine()) != null) { + System.out.println(line); + } + br.close(); + + 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/HelloWorldWebService2?wsdl"); + assertNotNull(definition); + Service service = definition.getService(new QName("http://helloworld/HelloWorldService/HelloWorld", + "HelloWorldService")); + Port port = service.getPort("HelloWorldPort"); + + String endpoint = getEndpoint(port); + assertEquals("http://localhost:8085/services/HelloWorldWebService2", endpoint); + } + + /** + * Tests ?wsdl works and returns the correct port endpoint from binding.ws with a custom URI + */ + public void testCustomEndpoint() throws Exception { + InputStream inp = new URL("http://localhost:8085/foo/bar?wsdl").openStream(); + BufferedReader br = new BufferedReader(new InputStreamReader(inp)); + String line; + while((line = br.readLine()) != null) { + System.out.println(line); + } + br.close(); + + 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://axis2.ws.binding.sca.tuscany.apache.org/", + "HelloWorldService")); + Port port = service.getPort("HelloWorldPort"); + + String endpoint = getEndpoint(port); + // TODO - used to get the real host here but WSDL seems to have localhost in it atm? + assertEquals("http://localhost: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 { + String contribution = "target/classes"; + node = NodeFactory.newInstance().createNode("org/apache/tuscany/sca/binding/ws/axis2/questionmark-wsdl.composite", new Contribution("test", contribution)); + node.start(); + } + + @Override + protected void tearDown() throws Exception { + node.stop(); + } + +} -- cgit v1.2.3