tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r1041988 - in /tuscany/sca-java-1.x/trunk/itest/jaxws/src: main/java/jtest/ main/java/jtest/impl/ test/java/jtest/
Date Fri, 03 Dec 2010 20:52:19 GMT
Author: nash
Date: Fri Dec  3 20:52:19 2010
New Revision: 1041988

URL: http://svn.apache.org/viewvc?rev=1041988&view=rev
Log:
Add more tests

Added:
    tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/Bean1.java
    tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/Bean2.java
    tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/WrapBean.java
    tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/WrapMap.java
Modified:
    tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/TestClient.java
    tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/TestService.java
    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/TestClientImpl.java
    tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/impl/TestServiceImpl.java
    tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/impl/TestWebServiceImpl.java
    tuscany/sca-java-1.x/trunk/itest/jaxws/src/test/java/jtest/DatatypesTestCase.java

Added: tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/Bean1.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/Bean1.java?rev=1041988&view=auto
==============================================================================
--- tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/Bean1.java (added)
+++ tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/Bean1.java Fri Dec  3 20:52:19
2010
@@ -0,0 +1,63 @@
+/*
+ * 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;
+
+/**
+ * @version $Rev: 832193 $ $Date: 2009-11-02 23:31:15 +0000 (Mon, 02 Nov 2009) $
+ */
+public class Bean1<T> {
+    private T item;
+    
+    public Bean1() {
+    }
+
+    public Bean1(T item) {
+        this.item = item;
+    }
+
+    public void setItem(T item) {
+        this.item = item;
+    }
+    
+    public T getItem() {
+        return item;
+    }
+    
+    public boolean equals(Object that) {
+        if(that == null) {
+            return false;
+        }
+        if(that.getClass() != this.getClass()) {
+            return false;
+        }
+
+        Bean1<?> that1 = (Bean1<?>)that;
+        if(this == that1) {
+            return true;
+        } else if(this.item != null) {
+            return this.item.equals(that1.item);
+        } else {
+            return that1.item == null;
+        }
+    }
+    
+    public String toString() {
+        return this.getClass().getSimpleName()+"[item = "+item+"]";
+    }
+}

Added: tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/Bean2.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/Bean2.java?rev=1041988&view=auto
==============================================================================
--- tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/Bean2.java (added)
+++ tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/Bean2.java Fri Dec  3 20:52:19
2010
@@ -0,0 +1,59 @@
+/*
+ * 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;
+
+//import javax.xml.bind.annotation.XmlSeeAlso;
+
+/**
+ * @version $Rev: 832193 $ $Date: 2009-11-02 23:31:15 +0000 (Mon, 02 Nov 2009) $
+ */
+//@XmlSeeAlso({Bean3.class, Bean3[].class, Bean31.class, Bean31[].class})
+public class Bean2 {
+    private String name;
+    
+    public void setName(String name) {
+        this.name = name;
+    }
+    
+    public String getName() {
+        return name;
+    }
+    
+    public boolean equals(Object that) {
+        if(that == null) {
+            return false;
+        }
+        
+        if(this.getClass() != that.getClass()) {
+            return false;
+        }
+        
+        if(this == that) {
+            return true;
+        } else if(this.name != null) {
+            return this.name.equals(((Bean2)that).name);
+        } else {
+            return ((Bean2)that).name == null;
+        }
+    }
+    
+    public String toString() {
+        return this.getClass().getSimpleName()+"[name = "+name+"]";
+    }
+}

Modified: tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/TestClient.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/TestClient.java?rev=1041988&r1=1041987&r2=1041988&view=diff
==============================================================================
--- tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/TestClient.java (original)
+++ tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/TestClient.java Fri Dec  3
20:52:19 2010
@@ -29,4 +29,12 @@ public interface TestClient {
     void runAbstractExceptionTest();
 
     void runListTypeTest();
+
+    void runMapTypeTest();
+
+    void runWrapMapTypeTest();
+
+    void runWildcardExtendsTest();
+
+    void runWrapBeanTest();
 }

Modified: tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/TestService.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/TestService.java?rev=1041988&r1=1041987&r2=1041988&view=diff
==============================================================================
--- tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/TestService.java (original)
+++ tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/TestService.java Fri Dec  3
20:52:19 2010
@@ -19,7 +19,10 @@
 
 package jtest;
 
+//import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
+//import javax.xml.bind.annotation.XmlSeeAlso;
 
 import org.osoa.sca.annotations.Remotable;
 
@@ -30,6 +33,7 @@ import jtest.TestAbstract;
  * The test service interface
  */
 @Remotable
+//@XmlSeeAlso(Bean2.class)
 public interface TestService {
 
     void sendAbstract(TestAbstract data);
@@ -37,4 +41,12 @@ public interface TestService {
     void throwAbstract() throws AbstractException;
 
     void sendList(List<String> data);
+
+    Map<String, String> returnMap();
+
+    WrapMap returnWrapMap();
+
+    void sendWildcardExtends(Bean1</*? extends*/ Bean2> arg);
+
+    void sendWrapBean(WrapBean arg);
 }

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=1041988&r1=1041987&r2=1041988&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 Fri Dec
 3 20:52:19 2010
@@ -19,6 +19,7 @@
 package jtest;
 
 import java.util.List;
+import java.util.Map;
 import javax.jws.WebMethod;
 import javax.jws.WebService;
 
@@ -29,8 +30,17 @@ public interface TestWebService {
     void sendAbstract(TestAbstract testData);
 
     @WebMethod
+    String sendConcrete(TestConcrete1 testData);
+
+    @WebMethod
     void throwAbstract() throws AbstractException;
 
     @WebMethod
     void sendList(List<String> data);
+
+    @WebMethod
+    Map<String, String> returnMap();
+
+    @WebMethod
+    void sendWildcardExtends(Bean1<Bean2> arg);
 }

Added: tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/WrapBean.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/WrapBean.java?rev=1041988&view=auto
==============================================================================
--- tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/WrapBean.java (added)
+++ tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/WrapBean.java Fri Dec  3 20:52:19
2010
@@ -0,0 +1,38 @@
+/*
+ * 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;
+
+import javax.xml.bind.annotation.XmlSeeAlso;
+
+/**
+ * The wrapped bean class
+ */
+@XmlSeeAlso(Bean2.class)
+public class WrapBean {
+    private Bean1<Bean2> bean;
+
+    public Bean1<Bean2> getBean() {
+        return bean;
+    }
+
+    public void setBean(Bean1<Bean2> bean) {
+        this.bean = bean;
+    }
+}

Added: tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/WrapMap.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/WrapMap.java?rev=1041988&view=auto
==============================================================================
--- tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/WrapMap.java (added)
+++ tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/WrapMap.java Fri Dec  3 20:52:19
2010
@@ -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;
+
+import java.util.Map;
+
+/**
+ * The wrapped map class
+ */
+public class WrapMap {
+    private Map<String, String> map;
+
+    public Map<String, String> getMap() {
+        return map;
+    }
+
+    public void setMap(Map<String, String> map) {
+        this.map = map;
+    }
+}

Modified: tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/impl/TestClientImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/impl/TestClientImpl.java?rev=1041988&r1=1041987&r2=1041988&view=diff
==============================================================================
--- tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/impl/TestClientImpl.java (original)
+++ tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/impl/TestClientImpl.java Fri
Dec  3 20:52:19 2010
@@ -20,14 +20,19 @@
 package jtest.impl;
 
 import java.util.ArrayList;
+import java.util.Map;
 import org.osoa.sca.annotations.Reference;
 import org.osoa.sca.annotations.Service;
 
 import jtest.AbstractException;
+import jtest.Bean1;
+import jtest.Bean2;
 import jtest.TestClient;
 import jtest.TestConcrete1;
 import jtest.TestConcrete2;
 import jtest.TestService;
+import jtest.WrapBean;
+import jtest.WrapMap;
 
 /**
  * The test client implementation
@@ -64,4 +69,31 @@ public class TestClientImpl implements T
         data.add("World!");
         ref.sendList(data);
     }
+
+    public void runMapTypeTest() {
+        Map<String, String> myMap = ref.returnMap();
+        System.out.println(myMap.get("greeting"));
+    }
+
+    public void runWrapMapTypeTest() {
+        WrapMap myWrapMap = ref.returnWrapMap();
+        Map<String, String> myMap = myWrapMap.getMap();
+        System.out.println(myMap.get("greeting"));
+    }
+
+    public void runWildcardExtendsTest() {
+        Bean2 temp = new Bean2();
+        temp.setName("Me");
+        Bean1<Bean2> arg = new Bean1<Bean2>(temp);
+        ref.sendWildcardExtends(arg);
+    }
+
+    public void runWrapBeanTest() {
+        Bean2 temp = new Bean2();
+        temp.setName("Me");
+        Bean1<Bean2> arg = new Bean1<Bean2>(temp);
+        WrapBean bean = new WrapBean();
+        bean.setBean(arg);
+        ref.sendWrapBean(bean);
+    }
 }

Modified: tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/impl/TestServiceImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/impl/TestServiceImpl.java?rev=1041988&r1=1041987&r2=1041988&view=diff
==============================================================================
--- tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/impl/TestServiceImpl.java (original)
+++ tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/impl/TestServiceImpl.java Fri
Dec  3 20:52:19 2010
@@ -19,14 +19,20 @@
 
 package jtest.impl;
 
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 import org.osoa.sca.annotations.Service;
 
 import jtest.AbstractException;
+import jtest.Bean1;
+import jtest.Bean2;
 import jtest.ConcreteException;
 import jtest.TestAbstract;
 import jtest.TestService;
+import jtest.WrapBean;
+import jtest.WrapMap;
 
 /**
  * The test service implementation
@@ -48,4 +54,26 @@ public class TestServiceImpl implements 
     public void sendList(List<String> data) {
         System.out.println(data.get(0) + " " + data.get(1));
     }
+
+    public Map<String, String> returnMap() {
+        Map<String, String> yourMap = new HashMap<String, String>();
+        yourMap.put("greeting", "Hello, World Map!");
+        return yourMap;
+    }
+
+    public WrapMap returnWrapMap() {
+        Map<String, String> yourMap = new HashMap<String, String>();
+        yourMap.put("greeting", "Hello, World Map!");
+        WrapMap wrapped = new WrapMap();
+        wrapped.setMap(yourMap);
+        return wrapped;
+    }
+
+    public void sendWildcardExtends(Bean1</*? extends*/ Bean2> arg) {
+        System.out.println("TestServiceImpl received generic bean " + arg);
+    }
+
+    public void sendWrapBean(WrapBean arg) {
+        System.out.println("TestServiceImpl received wrapped bean " + arg.getBean());
+    }
 }

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=1041988&r1=1041987&r2=1041988&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
Fri Dec  3 20:52:19 2010
@@ -19,11 +19,15 @@
 package jtest.impl;
 
 import java.util.List;
+import java.util.Map;
 import javax.jws.WebService;
 
 import jtest.AbstractException;
+import jtest.Bean1;
+import jtest.Bean2;
 import jtest.ConcreteException;
 import jtest.TestAbstract;
+import jtest.TestConcrete1;
 import jtest.TestWebService;
 
 @WebService(endpointInterface = "jtest.TestWebService")
@@ -33,6 +37,11 @@ public class TestWebServiceImpl implemen
         System.out.println(testData.getGreeting());
     }
 
+    public String sendConcrete(TestConcrete1 testData) {
+        System.out.println(testData.getGreeting());
+        return "Hi!";
+    }
+
     public void throwAbstract() throws AbstractException {
         throw new ConcreteException();
     }    
@@ -40,4 +49,12 @@ public class TestWebServiceImpl implemen
     public void sendList(List<String> data) {
         System.out.println(data.get(0) + " " + data.get(1));
     }
+
+    public Map<String, String> returnMap() {
+        return null;
+    }
+
+    public void sendWildcardExtends(Bean1<Bean2> arg) {
+        System.out.println(arg);
+    }
 }

Modified: tuscany/sca-java-1.x/trunk/itest/jaxws/src/test/java/jtest/DatatypesTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/itest/jaxws/src/test/java/jtest/DatatypesTestCase.java?rev=1041988&r1=1041987&r2=1041988&view=diff
==============================================================================
--- tuscany/sca-java-1.x/trunk/itest/jaxws/src/test/java/jtest/DatatypesTestCase.java (original)
+++ tuscany/sca-java-1.x/trunk/itest/jaxws/src/test/java/jtest/DatatypesTestCase.java Fri
Dec  3 20:52:19 2010
@@ -54,7 +54,7 @@ public class DatatypesTestCase {
         TestClient testClient = client.getService(TestClient.class, "TestClient");
         testClient.runAbstractExceptionTest();
     }
-    
+
     @Test
     public void runListTypeTest() {
         SCAClient client = (SCAClient)node;
@@ -62,6 +62,34 @@ public class DatatypesTestCase {
         testClient.runListTypeTest();
     }
 
+    @Test
+    public void runWrapMapTypeTest() {
+        SCAClient client = (SCAClient)node;
+        TestClient testClient = client.getService(TestClient.class, "TestClient");
+        testClient.runWrapMapTypeTest();
+    }
+
+    @Test
+    public void runMapTypeTest() {
+        SCAClient client = (SCAClient)node;
+        TestClient testClient = client.getService(TestClient.class, "TestClient");
+        testClient.runMapTypeTest();
+    }
+
+    @Test
+    public void runWildcardExtendsTest() {
+        SCAClient client = (SCAClient)node;
+        TestClient testClient = client.getService(TestClient.class, "TestClient");
+        testClient.runWildcardExtendsTest();
+    }
+
+    @Test
+    public void runWrapBeanTest() {
+        SCAClient client = (SCAClient)node;
+        TestClient testClient = client.getService(TestClient.class, "TestClient");
+        testClient.runWrapBeanTest();
+    }
+
     @AfterClass
     public static void tearDownAfterClass() throws Exception {
         if (node != null) {



Mime
View raw message