Author: nash
Date: Thu Jun 9 09:58:11 2011
New Revision: 1133760
URL: http://svn.apache.org/viewvc?rev=1133760&view=rev
Log:
TUSCANY-3869: Add tests to 1.x for POJO type in different package than the
interface
Added:
tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/other/
tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/other/TestOther.java
tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/other/package-info.java
tuscany/sca-java-1.x/trunk/itest/wsdlgen-verify/src/main/java/wsdlgen/other/
tuscany/sca-java-1.x/trunk/itest/wsdlgen-verify/src/main/java/wsdlgen/other/OtherPojo.java
tuscany/sca-java-1.x/trunk/itest/wsdlgen-verify/src/main/java/wsdlgen/other/package-info.java
Modified:
tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/TestWebService.java
tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/impl/TestWebServiceImpl.java
tuscany/sca-java-1.x/trunk/itest/wsdlgen-verify/src/main/java/wsdlgen/verify/DataTypes.java
tuscany/sca-java-1.x/trunk/itest/wsdlgen-verify/src/main/java/wsdlgen/verify/impl/DataTypesImpl.java
tuscany/sca-java-1.x/trunk/itest/wsdlgen-verify/src/test/java/wsdlgen/verify/DataTypesTestCase.java
Modified:
tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/TestWebService.java
URL:
http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/TestWebService.java?rev=1133760&r1=1133759&r2=1133760&view=diff
==============================================================================
---
tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/TestWebService.java
(original)
+++
tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/TestWebService.java
Thu Jun 9 09:58:11 2011
@@ -22,6 +22,7 @@ import java.util.List;
import java.util.Map;
import javax.jws.WebMethod;
import javax.jws.WebService;
+import jtest.other.TestOther;
@WebService
public interface TestWebService {
@@ -33,13 +34,16 @@ public interface TestWebService {
String sendConcrete(TestConcrete1 testData);
@WebMethod
+ void sendOtherPackage(TestOther testData);
+
+ @WebMethod
void throwAbstract() throws AbstractException;
@WebMethod
void sendList(List<String> data);
- @WebMethod
- Map<String, String> returnMap();
+ //@WebMethod
+ //Map<String, String> returnMap();
@WebMethod
void sendWildcardExtends(Bean1<Bean2> arg);
Modified:
tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/impl/TestWebServiceImpl.java
URL:
http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/impl/TestWebServiceImpl.java?rev=1133760&r1=1133759&r2=1133760&view=diff
==============================================================================
---
tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/impl/TestWebServiceImpl.java
(original)
+++
tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/impl/TestWebServiceImpl.java
Thu Jun 9 09:58:11 2011
@@ -28,6 +28,7 @@ import jtest.Bean2;
import jtest.ConcreteException;
import jtest.TestAbstract;
import jtest.TestConcrete1;
+import jtest.other.TestOther;
import jtest.TestWebService;
@WebService(endpointInterface = "jtest.TestWebService")
@@ -42,6 +43,10 @@ public class TestWebServiceImpl implemen
return "Hi!";
}
+ public void sendOtherPackage(TestOther testData) {
+ System.out.println(testData.getGreeting());
+ }
+
public void throwAbstract() throws AbstractException {
throw new ConcreteException();
}
@@ -50,9 +55,9 @@ public class TestWebServiceImpl implemen
System.out.println(data.get(0) + " " + data.get(1));
}
- public Map<String, String> returnMap() {
- return null;
- }
+ //public Map<String, String> returnMap() {
+ // return null;
+ //}
public void sendWildcardExtends(Bean1<Bean2> arg) {
System.out.println(arg);
Added:
tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/other/TestOther.java
URL:
http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/other/TestOther.java?rev=1133760&view=auto
==============================================================================
---
tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/other/TestOther.java
(added)
+++
tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/other/TestOther.java
Thu Jun 9 09:58:11 2011
@@ -0,0 +1,37 @@
+/*
+ * 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 jtest.other;
+
+import javax.xml.bind.annotation.XmlSchema;
+
+/**
+ * A test class in a different package than the interface
+ */
+public class TestOther {
+ private String greeting;
+
+ public TestOther() {
+ greeting = "Hello Stranger";
+ }
+
+ public String getGreeting() {
+ return greeting;
+ }
+}
Added:
tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/other/package-info.java
URL:
http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/other/package-info.java?rev=1133760&view=auto
==============================================================================
---
tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/other/package-info.java
(added)
+++
tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/other/package-info.java
Thu Jun 9 09:58:11 2011
@@ -0,0 +1,23 @@
+/*
+ * 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.
+ */
+
+@XmlSchema(namespace = "http://other.jtest/")
+package jtest.other;
+
+import javax.xml.bind.annotation.XmlSchema;
Added:
tuscany/sca-java-1.x/trunk/itest/wsdlgen-verify/src/main/java/wsdlgen/other/OtherPojo.java
URL:
http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/itest/wsdlgen-verify/src/main/java/wsdlgen/other/OtherPojo.java?rev=1133760&view=auto
==============================================================================
---
tuscany/sca-java-1.x/trunk/itest/wsdlgen-verify/src/main/java/wsdlgen/other/OtherPojo.java
(added)
+++
tuscany/sca-java-1.x/trunk/itest/wsdlgen-verify/src/main/java/wsdlgen/other/OtherPojo.java
Thu Jun 9 09:58:11 2011
@@ -0,0 +1,48 @@
+/*
+ * 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 wsdlgen.other;
+
+public class OtherPojo {
+ private double real, imaginary;
+
+ public OtherPojo(double real, double imaginary) {
+ this.real = real;
+ this.imaginary = imaginary;
+ }
+
+ public OtherPojo() {
+ }
+
+ public double getReal() {
+ return real;
+ }
+
+ public void setReal(double real) {
+ this.real = real;
+ }
+
+ public double getImaginary() {
+ return imaginary;
+ }
+
+ public void setImaginary(double imaginary) {
+ this.imaginary = imaginary;
+ }
+}
Added:
tuscany/sca-java-1.x/trunk/itest/wsdlgen-verify/src/main/java/wsdlgen/other/package-info.java
URL:
http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/itest/wsdlgen-verify/src/main/java/wsdlgen/other/package-info.java?rev=1133760&view=auto
==============================================================================
---
tuscany/sca-java-1.x/trunk/itest/wsdlgen-verify/src/main/java/wsdlgen/other/package-info.java
(added)
+++
tuscany/sca-java-1.x/trunk/itest/wsdlgen-verify/src/main/java/wsdlgen/other/package-info.java
Thu Jun 9 09:58:11 2011
@@ -0,0 +1,23 @@
+/*
+ * 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.
+ */
+
+@XmlSchema(namespace = "http://other.jtest/")
+package wsdlgen.other;
+
+import javax.xml.bind.annotation.XmlSchema;
Modified:
tuscany/sca-java-1.x/trunk/itest/wsdlgen-verify/src/main/java/wsdlgen/verify/DataTypes.java
URL:
http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/itest/wsdlgen-verify/src/main/java/wsdlgen/verify/DataTypes.java?rev=1133760&r1=1133759&r2=1133760&view=diff
==============================================================================
---
tuscany/sca-java-1.x/trunk/itest/wsdlgen-verify/src/main/java/wsdlgen/verify/DataTypes.java
(original)
+++
tuscany/sca-java-1.x/trunk/itest/wsdlgen-verify/src/main/java/wsdlgen/verify/DataTypes.java
Thu Jun 9 09:58:11 2011
@@ -25,6 +25,7 @@ import javax.jws.soap.SOAPBinding;
import commonj.sdo.DataObject;
import org.osoa.sca.ServiceReference;
import org.osoa.sca.annotations.Remotable;
+import wsdlgen.other.OtherPojo;
@Remotable
public interface DataTypes {
@@ -49,6 +50,8 @@ public interface DataTypes {
void testComplex(ComplexNumber complex);
+ void testOtherPackage(OtherPojo pojo);
+
void testByteArray(byte[] byteArray);
void testBaseExtension(ExtClass ext);
Modified:
tuscany/sca-java-1.x/trunk/itest/wsdlgen-verify/src/main/java/wsdlgen/verify/impl/DataTypesImpl.java
URL:
http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/itest/wsdlgen-verify/src/main/java/wsdlgen/verify/impl/DataTypesImpl.java?rev=1133760&r1=1133759&r2=1133760&view=diff
==============================================================================
---
tuscany/sca-java-1.x/trunk/itest/wsdlgen-verify/src/main/java/wsdlgen/verify/impl/DataTypesImpl.java
(original)
+++
tuscany/sca-java-1.x/trunk/itest/wsdlgen-verify/src/main/java/wsdlgen/verify/impl/DataTypesImpl.java
Thu Jun 9 09:58:11 2011
@@ -24,6 +24,7 @@ import javax.jws.WebParam;
import javax.jws.soap.SOAPBinding;
import commonj.sdo.DataObject;
import org.osoa.sca.ServiceReference;
+import wsdlgen.other.OtherPojo;
import wsdlgen.verify.BaseClass;
import wsdlgen.verify.ComplexNumber;
import wsdlgen.verify.DataTypes;
@@ -62,6 +63,9 @@ public class DataTypesImpl implements Da
public void testComplex(ComplexNumber complex) {
}
+ public void testOtherPackage(OtherPojo pojo) {
+ }
+
public void testByteArray(byte[] byteArray) {
}
Modified:
tuscany/sca-java-1.x/trunk/itest/wsdlgen-verify/src/test/java/wsdlgen/verify/DataTypesTestCase.java
URL:
http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/itest/wsdlgen-verify/src/test/java/wsdlgen/verify/DataTypesTestCase.java?rev=1133760&r1=1133759&r2=1133760&view=diff
==============================================================================
---
tuscany/sca-java-1.x/trunk/itest/wsdlgen-verify/src/test/java/wsdlgen/verify/DataTypesTestCase.java
(original)
+++
tuscany/sca-java-1.x/trunk/itest/wsdlgen-verify/src/test/java/wsdlgen/verify/DataTypesTestCase.java
Thu Jun 9 09:58:11 2011
@@ -48,14 +48,18 @@ public class DataTypesTestCase extends B
@Test
public void testSimpleMultiArrayInt() throws Exception {
Element paramElement = parameterElement("testSimpleMultiArrayInt");
- assertEquals("ns1:intArray", paramElement.getAttribute("type"));
+ // prefix name can vary, so compare only the fixed parts
+ assertEquals("ns", paramElement.getAttribute("type").substring(0, 2));
+ assertEquals(":intArray",
paramElement.getAttribute("type").substring(3));
assertEquals("unbounded", paramElement.getAttribute("maxOccurs"));
}
@Test
public void testSimpleMulti3ArrayInt() throws Exception {
Element paramElement = parameterElement("testSimpleMulti3ArrayInt");
- assertEquals("ns1:intArrayArray", paramElement.getAttribute("type"));
+ // prefix name can vary, so compare only the fixed parts
+ assertEquals("ns", paramElement.getAttribute("type").substring(0, 2));
+ assertEquals(":intArrayArray",
paramElement.getAttribute("type").substring(3));
assertEquals("unbounded", paramElement.getAttribute("maxOccurs"));
}
@@ -102,6 +106,15 @@ public class DataTypesTestCase extends B
}
@Test
+ public void testOtherPackage() throws Exception {
+ String paramType = parameterType("testOtherPackage");
+ // prefix name can vary, so compare only the fixed parts
+ assertEquals("ns", paramType.substring(0, 2));
+ assertEquals(":otherPojo", paramType.substring(3));
+ assertEquals("xs:double",
firstChild(typeDefinition(paramType)).getAttribute("type"));
+ }
+
+ @Test
public void testByteArray() throws Exception {
assertEquals("xs:base64Binary", parameterType("testByteArray"));
}