cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject svn commit: r472741 - in /incubator/cxf/trunk/tools: common/src/main/java/org/apache/cxf/tools/common/model/ wsdl2java/src/test/java/org/apache/cxf/tools/wsdl2java/processor/ wsdl2java/src/test/resources/wsdl2java_wsdl/bug161/
Date Thu, 09 Nov 2006 02:38:48 GMT
Author: mmao
Date: Wed Nov  8 18:38:47 2006
New Revision: 472741

URL: http://svn.apache.org/viewvc?view=rev&rev=472741
Log:
CXF-161 Update
Fix the parameter order of holder parameter, the IN/OUT parameter should replace the IN parameter
instead of remove and add.

Modified:
    incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaMethod.java
    incubator/cxf/trunk/tools/wsdl2java/src/test/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToJavaProcessorTest.java
    incubator/cxf/trunk/tools/wsdl2java/src/test/resources/wsdl2java_wsdl/bug161/header2.wsdl

Modified: incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaMethod.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaMethod.java?view=diff&rev=472741&r1=472740&r2=472741
==============================================================================
--- incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaMethod.java
(original)
+++ incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaMethod.java
Wed Nov  8 18:38:47 2006
@@ -121,16 +121,20 @@
         }
         return false;
     }
-
-    private void removeParameter(JavaParameter param) {
-        parameters.remove(param);
+    
+    private void replaceParameter(JavaParameter p1, JavaParameter p2) {
+        int index = ((ArrayList)parameters).indexOf(p1);
+        parameters.remove(index);
+        parameters.add(index, p2);
     }
 
     public void addParameter(JavaParameter param) {
         if (hasParameter(param.getName())) {
             JavaParameter paramInList = getParameter(param.getName());
             if (paramInList.isIN() || paramInList.isINOUT()) {
-                removeParameter(paramInList);
+                //removeParameter(paramInList);
+                replaceParameter(paramInList, param);
+                return;
             } else {
                 Message message = new Message("PARAMETER_ALREADY_EXIST", LOG, param.getName());
                 throw new ToolException(message);

Modified: incubator/cxf/trunk/tools/wsdl2java/src/test/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToJavaProcessorTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/test/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToJavaProcessorTest.java?view=diff&rev=472741&r1=472740&r2=472741
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/test/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToJavaProcessorTest.java
(original)
+++ incubator/cxf/trunk/tools/wsdl2java/src/test/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToJavaProcessorTest.java
Wed Nov  8 18:38:47 2006
@@ -520,7 +520,7 @@
         assertEquals("DOCUMENT", soapBindingAnno.style().name());
 
         Class para = classLoader.loadClass("org.apache.hello_world_holder.types.GreetMe");
-        Method method = clz.getMethod("sayHi", new Class[] {para, Holder.class});
+        Method method = clz.getMethod("sayHi", new Class[] {Holder.class, para});
         assertEquals("GreetMeResponse", method.getReturnType().getSimpleName());
 
         WebParam webParamAnno = AnnotationUtil.getWebParam(method, "greetMe");
@@ -1108,9 +1108,8 @@
         processor.setEnvironment(env);
         processor.process();
         Class clz = classLoader.loadClass("org.apache.header2.Header2Test");
-        Class headerData = classLoader.loadClass("org.apache.header2.HeaderData");
         Class header = classLoader.loadClass("org.apache.header2.Header");
-        Method method = clz.getMethod("headerMethod", new Class[] {headerData, header});
      
+        Method method = clz.getMethod("headerMethod", new Class[] {Holder.class, header});
      
         assertNotNull("method should be generated", method);
     }
      

Modified: incubator/cxf/trunk/tools/wsdl2java/src/test/resources/wsdl2java_wsdl/bug161/header2.wsdl
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/test/resources/wsdl2java_wsdl/bug161/header2.wsdl?view=diff&rev=472741&r1=472740&r2=472741
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/test/resources/wsdl2java_wsdl/bug161/header2.wsdl
(original)
+++ incubator/cxf/trunk/tools/wsdl2java/src/test/resources/wsdl2java_wsdl/bug161/header2.wsdl
Wed Nov  8 18:38:47 2006
@@ -59,6 +59,7 @@
         <part element="tns:Header" name="the_request"/>
     </message>
     <message name="headerResponse">
+        <part element="tns:HeaderInfo" name="header_info"/>
         <part element="tns:HeaderResponse" name="the_response"/>
     </message>
 



Mime
View raw message