summaryrefslogtreecommitdiffstats
path: root/sandbox/mobile-android/interface-java-jaxws/src/test/java/org/apache
diff options
context:
space:
mode:
Diffstat (limited to 'sandbox/mobile-android/interface-java-jaxws/src/test/java/org/apache')
-rw-r--r--sandbox/mobile-android/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/Bean.java23
-rw-r--r--sandbox/mobile-android/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/Bean1.java36
-rw-r--r--sandbox/mobile-android/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/Bean2.java36
-rw-r--r--sandbox/mobile-android/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessorTestCase.java98
-rw-r--r--sandbox/mobile-android/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/MyException.java49
-rw-r--r--sandbox/mobile-android/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/MyServiceImpl.java52
6 files changed, 294 insertions, 0 deletions
diff --git a/sandbox/mobile-android/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/Bean.java b/sandbox/mobile-android/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/Bean.java
new file mode 100644
index 0000000000..9a31cb6127
--- /dev/null
+++ b/sandbox/mobile-android/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/Bean.java
@@ -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.
+ */
+package org.apache.tuscany.sca.interfacedef.java.jaxws;
+
+public interface Bean<T> {
+ T getP1();
+}
diff --git a/sandbox/mobile-android/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/Bean1.java b/sandbox/mobile-android/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/Bean1.java
new file mode 100644
index 0000000000..b41ff14af0
--- /dev/null
+++ b/sandbox/mobile-android/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/Bean1.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.interfacedef.java.jaxws;
+
+public class Bean1 {
+ private String p1;
+ private int p2;
+ public String getP1() {
+ return p1;
+ }
+ public void setP1(String p1) {
+ this.p1 = p1;
+ }
+ public int getP2() {
+ return p2;
+ }
+ public void setP2(int p2) {
+ this.p2 = p2;
+ }
+}
diff --git a/sandbox/mobile-android/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/Bean2.java b/sandbox/mobile-android/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/Bean2.java
new file mode 100644
index 0000000000..34c8d2c67d
--- /dev/null
+++ b/sandbox/mobile-android/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/Bean2.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.interfacedef.java.jaxws;
+
+public class Bean2 implements Bean<String>{
+ private String p1;
+ private int p2;
+ public String getP1() {
+ return p1;
+ }
+ public void setP1(String p1) {
+ this.p1 = p1;
+ }
+ public int getP2() {
+ return p2;
+ }
+ public void setP2(int p2) {
+ this.p2 = p2;
+ }
+}
diff --git a/sandbox/mobile-android/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessorTestCase.java b/sandbox/mobile-android/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessorTestCase.java
new file mode 100644
index 0000000000..7e4114d854
--- /dev/null
+++ b/sandbox/mobile-android/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessorTestCase.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.interfacedef.java.jaxws;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.interfacedef.java.DefaultJavaInterfaceFactory;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
+
+/**
+ *
+ */
+public class JAXWSJavaInterfaceProcessorTestCase extends TestCase {
+ private JAXWSJavaInterfaceProcessor interfaceProcessor;
+
+ /**
+ * @see junit.framework.TestCase#setUp()
+ */
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ interfaceProcessor = new JAXWSJavaInterfaceProcessor();
+ }
+
+ /**
+ * Test method for
+ * {@link org.apache.tuscany.sca.interfacedef.java.jaxws.JAXWSJavaInterfaceProcessor#visitInterface(JavaInterface)}.
+ */
+ public final void testProcessor() throws Exception {
+ DefaultJavaInterfaceFactory iFactory = new DefaultJavaInterfaceFactory();
+ JavaInterface contract = iFactory.createJavaInterface(WebServiceInterfaceWithoutAnnotation.class);
+
+ interfaceProcessor.visitInterface(contract);
+ assertFalse(contract.isRemotable());
+
+ contract = iFactory.createJavaInterface(WebServiceInterfaceWithAnnotation.class);
+ interfaceProcessor.visitInterface(contract);
+ assertTrue(contract.isRemotable());
+
+ Operation op1 = contract.getOperations().get(0);
+ Operation op2 = contract.getOperations().get(1);
+
+ Operation op = null;
+ if ("m1".equals(op1.getName())) {
+ op = op1;
+ } else {
+ op = op2;
+ }
+
+ assertTrue(op.isWrapperStyle());
+
+ if ("M2".equals(op2.getName())) {
+ op = op2;
+ } else {
+ op = op1;
+ }
+ assertTrue(!op2.isWrapperStyle() && op2.getWrapper() != null);
+
+ }
+
+ @WebService
+ private static interface WebServiceInterfaceWithAnnotation {
+
+ @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
+ @WebMethod(operationName = "m1")
+ String m1(String str);
+
+ @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
+ @WebMethod(operationName = "M2")
+ String m2(String str, int i);
+ }
+
+ private static interface WebServiceInterfaceWithoutAnnotation {
+
+ }
+}
diff --git a/sandbox/mobile-android/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/MyException.java b/sandbox/mobile-android/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/MyException.java
new file mode 100644
index 0000000000..b0478f6c71
--- /dev/null
+++ b/sandbox/mobile-android/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/MyException.java
@@ -0,0 +1,49 @@
+/*
+ * 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.interfacedef.java.jaxws;
+
+public class MyException extends Exception {
+ private String error;
+
+ public MyException() {
+ super();
+ }
+
+ public MyException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public MyException(String message) {
+ super(message);
+ }
+
+ public MyException(Throwable cause) {
+ super(cause);
+ }
+
+ public String getError() {
+ return error;
+ }
+
+ public void setError(String error) {
+ this.error = error;
+ }
+
+}
diff --git a/sandbox/mobile-android/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/MyServiceImpl.java b/sandbox/mobile-android/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/MyServiceImpl.java
new file mode 100644
index 0000000000..9597cd892b
--- /dev/null
+++ b/sandbox/mobile-android/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/MyServiceImpl.java
@@ -0,0 +1,52 @@
+/*
+ * 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.interfacedef.java.jaxws;
+
+import java.util.List;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+
+/**
+ * @version $Rev: 639350 $ $Date: 2008-03-20 08:43:46 -0800 (Thu, 20 Mar 2008) $
+ */
+@WebService
+public class MyServiceImpl {
+
+ public MyServiceImpl() {
+ super();
+ }
+
+ @WebMethod
+ public <T extends Bean1> T getBean(T b, Bean2 b2) {
+ return null;
+ }
+
+ @WebMethod
+ public List<? extends Bean1> getBeans() {
+ return null;
+ }
+
+ @WebMethod
+ public String convert(String str, int i) throws MyException {
+ return "ME";
+ }
+
+}