You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by va...@apache.org on 2008/07/22 14:18:59 UTC

svn commit: r678733 - in /tuscany/java/sca/itest/databindings/jaxb-top-down/src: main/java/org/apache/tuscany/sca/itest/databindings/jaxb/ main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/ main/resources/wsdl/wrapped/ test/java/org/apache/...

Author: vamsic007
Date: Tue Jul 22 05:18:58 2008
New Revision: 678733

URL: http://svn.apache.org/viewvc?rev=678733&view=rev
Log:
Databinding tests - JAXB Top Down tests for List and Map

Modified:
    tuscany/java/sca/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/HelloService.java
    tuscany/java/sca/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/HelloServiceClient.java
    tuscany/java/sca/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/HelloServiceClientImpl.java
    tuscany/java/sca/itest/databindings/jaxb-top-down/src/main/resources/wsdl/wrapped/hello-service.wsdl
    tuscany/java/sca/itest/databindings/jaxb-top-down/src/test/java/org/apache/tuscany/sca/itest/databindings/jaxb/topdown/DatabindingTestCase.java

Modified: tuscany/java/sca/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/HelloService.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/HelloService.java?rev=678733&r1=678732&r2=678733&view=diff
==============================================================================
--- tuscany/java/sca/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/HelloService.java (original)
+++ tuscany/java/sca/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/HelloService.java Tue Jul 22 05:18:58 2008
@@ -34,9 +34,9 @@
 public interface HelloService {
     String getGreetings(String name);
     String[] getGreetingsArray(String[] names);
-    //List<String> getGreetingsList(List<String> names);
-    //ArrayList<String> getGreetingsArrayList(ArrayList<String> names);
-    //Map<String, String> getGreetingsMap(Map<String, String> namesMap);
-    //HashMap<String, String> getGreetingsHashMap(HashMap<String, String> namesMap);
+    List<String> getGreetingsList(List<String> names);
+    ArrayList<String> getGreetingsArrayList(ArrayList<String> names);
+    Map<String, String> getGreetingsMap(Map<String, String> namesMap);
+    HashMap<String, String> getGreetingsHashMap(HashMap<String, String> namesMap);
     String getGreetingsVarArgs(String... names);
 }

Modified: tuscany/java/sca/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/HelloServiceClient.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/HelloServiceClient.java?rev=678733&r1=678732&r2=678733&view=diff
==============================================================================
--- tuscany/java/sca/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/HelloServiceClient.java (original)
+++ tuscany/java/sca/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/HelloServiceClient.java Tue Jul 22 05:18:58 2008
@@ -33,9 +33,9 @@
 public interface HelloServiceClient {
     String getGreetingsForward(String name);
     String[] getGreetingsArrayForward(String[] names);
-    //List<String> getGreetingsListForward(List<String> names);
-    //ArrayList<String> getGreetingsArrayListForward(ArrayList<String> names);
-    //Map<String, String> getGreetingsMapForward(Map<String, String> namesMap);
-    //HashMap<String, String> getGreetingsHashMapForward(HashMap<String, String> namesMap);
+    List<String> getGreetingsListForward(List<String> names);
+    ArrayList<String> getGreetingsArrayListForward(ArrayList<String> names);
+    Map<String, String> getGreetingsMapForward(Map<String, String> namesMap);
+    HashMap<String, String> getGreetingsHashMapForward(HashMap<String, String> namesMap);
     String getGreetingsVarArgsForward(String... names);
 }

Modified: tuscany/java/sca/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/HelloServiceClientImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/HelloServiceClientImpl.java?rev=678733&r1=678732&r2=678733&view=diff
==============================================================================
--- tuscany/java/sca/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/HelloServiceClientImpl.java (original)
+++ tuscany/java/sca/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/HelloServiceClientImpl.java Tue Jul 22 05:18:58 2008
@@ -51,21 +51,21 @@
         return service.getGreetingsArray(names);
     }
 
-//    public List<String> getGreetingsListForward(List<String> names) {
-//        return service.getGreetingsList(names);
-//    }
+    public List<String> getGreetingsListForward(List<String> names) {
+        return service.getGreetingsList(names);
+    }
 
-//    public Map<String, String> getGreetingsMapForward(Map<String, String> namesMap) {
-//        return service.getGreetingsMap(namesMap);
-//    }
+    public Map<String, String> getGreetingsMapForward(Map<String, String> namesMap) {
+        return service.getGreetingsMap(namesMap);
+    }
 
-//    public ArrayList<String> getGreetingsArrayListForward(ArrayList<String> names) {
-//        return service.getGreetingsArrayList(names);
-//    }
+    public ArrayList<String> getGreetingsArrayListForward(ArrayList<String> names) {
+        return service.getGreetingsArrayList(names);
+    }
 
-//    public HashMap<String, String> getGreetingsHashMapForward(HashMap<String, String> namesMap) {
-//        return service.getGreetingsHashMap(namesMap);
-//    }
+    public HashMap<String, String> getGreetingsHashMapForward(HashMap<String, String> namesMap) {
+        return service.getGreetingsHashMap(namesMap);
+    }
 
     public String getGreetingsVarArgsForward(String... names) {
         return service.getGreetingsVarArgs(names[0], names[1], names[2]);

Modified: tuscany/java/sca/itest/databindings/jaxb-top-down/src/main/resources/wsdl/wrapped/hello-service.wsdl
URL: http://svn.apache.org/viewvc/tuscany/java/sca/itest/databindings/jaxb-top-down/src/main/resources/wsdl/wrapped/hello-service.wsdl?rev=678733&r1=678732&r2=678733&view=diff
==============================================================================
--- tuscany/java/sca/itest/databindings/jaxb-top-down/src/main/resources/wsdl/wrapped/hello-service.wsdl (original)
+++ tuscany/java/sca/itest/databindings/jaxb-top-down/src/main/resources/wsdl/wrapped/hello-service.wsdl Tue Jul 22 05:18:58 2008
@@ -28,6 +28,36 @@
     xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
     xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
     <wsdl:types>
+        <xs:schema targetNamespace="http://util.java/"
+            version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+            <xs:complexType name="arrayList">
+                <xs:complexContent>
+                    <xs:extension base="abstractList">
+                        <xs:sequence />
+                    </xs:extension>
+                </xs:complexContent>
+            </xs:complexType>
+            <xs:complexType abstract="true" name="abstractList">
+                <xs:complexContent>
+                    <xs:extension base="abstractCollection">
+                        <xs:sequence />
+                    </xs:extension>
+                </xs:complexContent>
+            </xs:complexType>
+            <xs:complexType abstract="true" name="abstractCollection">
+                <xs:sequence />
+            </xs:complexType>
+            <xs:complexType name="hashMap">
+                <xs:complexContent>
+                    <xs:extension base="abstractMap">
+                        <xs:sequence />
+                    </xs:extension>
+                </xs:complexContent>
+            </xs:complexType>
+            <xs:complexType abstract="true" name="abstractMap">
+                <xs:sequence />
+            </xs:complexType>
+        </xs:schema>
         <xs:schema targetNamespace="http://jaxb.dev.java.net/array"
             version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
             <xs:complexType final="#all" name="stringArray">
@@ -40,6 +70,7 @@
         <xs:schema attributeFormDefault="qualified"
             elementFormDefault="unqualified"
             targetNamespace="http://jaxb.databindings.itest.sca.tuscany.apache.org/"
+            xmlns:ns0="http://util.java/"
             xmlns:xs="http://www.w3.org/2001/XMLSchema">
             <xs:element name="getGreetings">
                 <xs:complexType>
@@ -73,6 +104,70 @@
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
+            <xs:element name="getGreetingsList">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="arg0"
+                            nillable="true" type="xs:anyType" />
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="getGreetingsListResponse">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="return"
+                            nillable="true" type="xs:anyType" />
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="getGreetingsArrayList">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="arg0"
+                            nillable="true" type="ns0:arrayList" />
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="getGreetingsArrayListResponse">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="return"
+                            nillable="true" type="ns0:arrayList" />
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="getGreetingsMap">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="arg0"
+                            nillable="true" type="xs:anyType" />
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="getGreetingsMapResponse">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="return"
+                            nillable="true" type="xs:anyType" />
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="getGreetingsHashMap">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="arg0"
+                            nillable="true" type="ns0:hashMap" />
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="getGreetingsHashMapResponse">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="return"
+                            nillable="true" type="ns0:hashMap" />
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
             <xs:element name="getGreetingsVarArgs">
                 <xs:complexType>
                     <xs:sequence>
@@ -110,6 +205,46 @@
             element="tns:getGreetingsArrayResponse">
         </wsdl:part>
     </wsdl:message>
+    <wsdl:message name="getGreetingsList">
+        <wsdl:part name="getGreetingsList"
+            element="tns:getGreetingsList">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="getGreetingsListResponse">
+        <wsdl:part name="getGreetingsListResponse"
+            element="tns:getGreetingsListResponse">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="getGreetingsArrayList">
+        <wsdl:part name="getGreetingsArrayList"
+            element="tns:getGreetingsArrayList">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="getGreetingsArrayListResponse">
+        <wsdl:part name="getGreetingsArrayListResponse"
+            element="tns:getGreetingsArrayListResponse">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="getGreetingsMap">
+        <wsdl:part name="getGreetingsMap"
+            element="tns:getGreetingsMap">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="getGreetingsMapResponse">
+        <wsdl:part name="getGreetingsMapResponse"
+            element="tns:getGreetingsMapResponse">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="getGreetingsHashMap">
+        <wsdl:part name="getGreetingsHashMap"
+            element="tns:getGreetingsHashMap">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="getGreetingsHashMapResponse">
+        <wsdl:part name="getGreetingsHashMapResponse"
+            element="tns:getGreetingsHashMapResponse">
+        </wsdl:part>
+    </wsdl:message>
     <wsdl:message name="getGreetingsVarArgs">
         <wsdl:part name="getGreetingsVarArgs"
             element="tns:getGreetingsVarArgs">
@@ -131,6 +266,28 @@
             <wsdl:output message="tns:getGreetingsArrayResponse">
             </wsdl:output>
         </wsdl:operation>
+        <wsdl:operation name="getGreetingsList">
+            <wsdl:input message="tns:getGreetingsList"></wsdl:input>
+            <wsdl:output message="tns:getGreetingsListResponse">
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="getGreetingsArrayList">
+            <wsdl:input message="tns:getGreetingsArrayList">
+            </wsdl:input>
+            <wsdl:output message="tns:getGreetingsArrayListResponse">
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="getGreetingsMap">
+            <wsdl:input message="tns:getGreetingsMap">
+            </wsdl:input>
+            <wsdl:output message="tns:getGreetingsMapResponse">
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="getGreetingsHashMap">
+            <wsdl:input message="tns:getGreetingsHashMap"></wsdl:input>
+            <wsdl:output message="tns:getGreetingsHashMapResponse">
+            </wsdl:output>
+        </wsdl:operation>
         <wsdl:operation name="getGreetingsVarArgs">
             <wsdl:input message="tns:getGreetingsVarArgs">
             </wsdl:input>
@@ -159,6 +316,42 @@
                 <soap11:body use="literal" />
             </wsdl:output>
         </wsdl:operation>
+        <wsdl:operation name="getGreetingsList">
+            <soap11:operation />
+            <wsdl:input>
+                <soap11:body use="literal" />
+            </wsdl:input>
+            <wsdl:output>
+                <soap11:body use="literal" />
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="getGreetingsArrayList">
+            <soap11:operation />
+            <wsdl:input>
+                <soap11:body use="literal" />
+            </wsdl:input>
+            <wsdl:output>
+                <soap11:body use="literal" />
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="getGreetingsMap">
+            <soap11:operation />
+            <wsdl:input>
+                <soap11:body use="literal" />
+            </wsdl:input>
+            <wsdl:output>
+                <soap11:body use="literal" />
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="getGreetingsHashMap">
+            <soap11:operation />
+            <wsdl:input>
+                <soap11:body use="literal" />
+            </wsdl:input>
+            <wsdl:output>
+                <soap11:body use="literal" />
+            </wsdl:output>
+        </wsdl:operation>
         <wsdl:operation name="getGreetingsVarArgs">
             <soap11:operation />
             <wsdl:input>

Modified: tuscany/java/sca/itest/databindings/jaxb-top-down/src/test/java/org/apache/tuscany/sca/itest/databindings/jaxb/topdown/DatabindingTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/itest/databindings/jaxb-top-down/src/test/java/org/apache/tuscany/sca/itest/databindings/jaxb/topdown/DatabindingTestCase.java?rev=678733&r1=678732&r2=678733&view=diff
==============================================================================
--- tuscany/java/sca/itest/databindings/jaxb-top-down/src/test/java/org/apache/tuscany/sca/itest/databindings/jaxb/topdown/DatabindingTestCase.java (original)
+++ tuscany/java/sca/itest/databindings/jaxb-top-down/src/test/java/org/apache/tuscany/sca/itest/databindings/jaxb/topdown/DatabindingTestCase.java Tue Jul 22 05:18:58 2008
@@ -19,6 +19,11 @@
 
 package org.apache.tuscany.sca.itest.databindings.jaxb.topdown;
 
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
 import junit.framework.Assert;
 
 import org.apache.tuscany.sca.itest.databindings.jaxb.HelloServiceClient;
@@ -27,7 +32,6 @@
 import org.apache.tuscany.sca.node.SCANode2Factory;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
-import org.junit.Ignore;
 import org.junit.Test;
 
 /**
@@ -82,10 +86,9 @@
      * Service method invoked is getGreetingsList.
      */
     @Test
-    @Ignore
     public void testW2WList() throws Exception {
         HelloServiceClient helloServiceClient = client.getService(HelloServiceClient.class, "HelloServiceClientW2WComponent");
-        //performTestList(helloServiceClient);
+        performTestList(helloServiceClient);
     }
 
     /**
@@ -93,10 +96,9 @@
      * Service method invoked is getGreetingsArrayList.
      */
     @Test
-    @Ignore
     public void testW2WArrayList() throws Exception {
         HelloServiceClient helloServiceClient = client.getService(HelloServiceClient.class, "HelloServiceClientW2WComponent");
-        //performTestArrayList(helloServiceClient);
+        performTestArrayList(helloServiceClient);
     }
 
     /**
@@ -104,10 +106,9 @@
      * Service method invoked is getGreetingsMap.
      */
     @Test
-    @Ignore
     public void testW2WMap() throws Exception {
         HelloServiceClient helloServiceClient = client.getService(HelloServiceClient.class, "HelloServiceClientW2WComponent");
-        //performTestMap(helloServiceClient);
+        performTestMap(helloServiceClient);
     }
 
     /**
@@ -115,10 +116,9 @@
      * Service method invoked is getGreetingsHashMap.
      */
     @Test
-    @Ignore
     public void testW2WHashMap() throws Exception {
         HelloServiceClient helloServiceClient = client.getService(HelloServiceClient.class, "HelloServiceClientW2WComponent");
-        //performTestHashMap(helloServiceClient);
+        performTestHashMap(helloServiceClient);
     }
 
     /**
@@ -156,10 +156,9 @@
      * Service method invoked is getGreetingsList.
      */
     @Test
-    @Ignore
     public void testJ2WList() throws Exception {
         HelloServiceClient helloServiceClient = client.getService(HelloServiceClient.class, "HelloServiceClientJ2WComponent");
-        //performTestList(helloServiceClient);
+        performTestList(helloServiceClient);
     }
 
     /**
@@ -167,10 +166,9 @@
      * Service method invoked is getGreetingsArrayList.
      */
     @Test
-    @Ignore
     public void testJ2WArrayList() throws Exception {
         HelloServiceClient helloServiceClient = client.getService(HelloServiceClient.class, "HelloServiceClientJ2WComponent");
-        //performTestArrayList(helloServiceClient);
+        performTestArrayList(helloServiceClient);
     }
 
     /**
@@ -178,10 +176,9 @@
      * Service method invoked is getGreetingsMap.
      */
     @Test
-    @Ignore
     public void testJ2WMap() throws Exception {
         HelloServiceClient helloServiceClient = client.getService(HelloServiceClient.class, "HelloServiceClientJ2WComponent");
-        //performTestMap(helloServiceClient);
+        performTestMap(helloServiceClient);
     }
 
     /**
@@ -189,10 +186,9 @@
      * Service method invoked is getGreetingsHashMap.
      */
     @Test
-    @Ignore
     public void testJ2WHashMap() throws Exception {
         HelloServiceClient helloServiceClient = client.getService(HelloServiceClient.class, "HelloServiceClientJ2WComponent");
-        //performTestHashMap(helloServiceClient);
+        performTestHashMap(helloServiceClient);
     }
 
     /**
@@ -230,10 +226,9 @@
      * Service method invoked is getGreetingsList.
      */
     @Test
-    @Ignore
     public void testW2JList() throws Exception {
         HelloServiceClient helloServiceClient = client.getService(HelloServiceClient.class, "HelloServiceClientW2JComponent");
-        //performTestList(helloServiceClient);
+        performTestList(helloServiceClient);
     }
 
     /**
@@ -241,10 +236,9 @@
      * Service method invoked is getGreetingsArrayList.
      */
     @Test
-    @Ignore
     public void testW2JArrayList() throws Exception {
         HelloServiceClient helloServiceClient = client.getService(HelloServiceClient.class, "HelloServiceClientW2JComponent");
-        //performTestArrayList(helloServiceClient);
+        performTestArrayList(helloServiceClient);
     }
 
     /**
@@ -252,10 +246,9 @@
      * Service method invoked is getGreetingsMap.
      */
     @Test
-    @Ignore
     public void testW2JMap() throws Exception {
         HelloServiceClient helloServiceClient = client.getService(HelloServiceClient.class, "HelloServiceClientW2JComponent");
-        //performTestMap(helloServiceClient);
+        performTestMap(helloServiceClient);
     }
 
     /**
@@ -263,10 +256,9 @@
      * Service method invoked is getGreetingsHashMap.
      */
     @Test
-    @Ignore
     public void testW2JHashMap() throws Exception {
         HelloServiceClient helloServiceClient = client.getService(HelloServiceClient.class, "HelloServiceClientW2JComponent");
-        //performTestHashMap(helloServiceClient);
+        performTestHashMap(helloServiceClient);
     }
 
     /**
@@ -293,7 +285,7 @@
         }
     }
 
-/*    private void performTestList(HelloServiceClient helloServiceClient) {
+    private void performTestList(HelloServiceClient helloServiceClient) {
         List<String> namesList = new ArrayList<String>();
         namesList.add("Me");
         namesList.add("Pandu");
@@ -340,7 +332,7 @@
             Assert.assertEquals("Hello "+entry.getKey(), respMap.get(entry.getKey()));
         }
     }
-*/
+
     private void performTestVarArgs(HelloServiceClient helloServiceClient) {
         String[] names = { "Me", "You", "Pandu" }; // Do not change the array size from 3.
         String expected = "Hello Me You Pandu";