Author: dkulp
Date: Sat Apr 28 06:17:59 2007
New Revision: 533341

URL: http://svn.apache.org/viewvc?view=rev&rev=533341
Log:
Add a unit test (disabled for now) to demonstrate a problem with CXF-611

Added:
    
incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/fortest/withannotation/doc/TestDataBean.java
   (with props)
Modified:
    
incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/IOUtils.java
    
incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/fortest/withannotation/doc/GreeterNoWrapperBean.java
    
incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java

Modified: 
incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/IOUtils.java
URL: 
http://svn.apache.org/viewvc/incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/IOUtils.java?view=diff&rev=533341&r1=533340&r2=533341
==============================================================================
--- 
incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/IOUtils.java
 (original)
+++ 
incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/IOUtils.java
 Sat Apr 28 06:17:59 2007
@@ -49,4 +49,18 @@
             n = input.read(buffer);
         }
     }
+    
+    public static String toString(final InputStream input) 
+        throws IOException {
+        
+        StringBuffer buf = new StringBuffer();
+        final byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];
+        int n = 0;
+        n = input.read(buffer);
+        while (-1 != n) {
+            buf.append(new String(buffer, 0, n));
+            n = input.read(buffer);
+        }
+        return buf.toString();
+    }
 }

Modified: 
incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/fortest/withannotation/doc/GreeterNoWrapperBean.java
URL: 
http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/fortest/withannotation/doc/GreeterNoWrapperBean.java?view=diff&rev=533341&r1=533340&r2=533341
==============================================================================
--- 
incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/fortest/withannotation/doc/GreeterNoWrapperBean.java
 (original)
+++ 
incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/fortest/withannotation/doc/GreeterNoWrapperBean.java
 Sat Apr 28 06:17:59 2007
@@ -30,4 +30,9 @@
     @RequestWrapper(className = "org.apache.cxf.SayHi")
     @ResponseWrapper(className = "org.apache.cxf.SayHiResponse")
     String sayHi();
+    
+    @WebMethod
+    @RequestWrapper(className = "org.apache.cxf.EchoDataBean")
+    @ResponseWrapper(className = "org.apache.cxf.EchoDataBeanResponse")
+    TestDataBean echoDataBean(TestDataBean bean);
 }

Added: 
incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/fortest/withannotation/doc/TestDataBean.java
URL: 
http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/fortest/withannotation/doc/TestDataBean.java?view=auto&rev=533341
==============================================================================
--- 
incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/fortest/withannotation/doc/TestDataBean.java
 (added)
+++ 
incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/fortest/withannotation/doc/TestDataBean.java
 Sat Apr 28 06:17:59 2007
@@ -0,0 +1,43 @@
+/**
+ * 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.cxf.tools.fortest.withannotation.doc;
+
+public class TestDataBean {
+    private int intValue;
+    private String stringValue;
+    
+    public int getIntValue() {
+        return intValue;
+    }
+    public void setIntValue(int intValue) {
+        this.intValue = intValue;
+    }
+    
+    public String getStringValue() {
+        return stringValue;
+    }
+    public void setStringValue(String stringValue) {
+        this.stringValue = stringValue;
+    }
+    
+    
+
+    
+    
+}

Propchange: 
incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/fortest/withannotation/doc/TestDataBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/fortest/withannotation/doc/TestDataBean.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: 
incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java
URL: 
http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java?view=diff&rev=533341&r1=533340&r2=533341
==============================================================================
--- 
incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java
 (original)
+++ 
incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java
 Sat Apr 28 06:17:59 2007
@@ -20,6 +20,7 @@
 package org.apache.cxf.tools.java2wsdl.processor;
 
 import java.io.File;
+import java.io.FileInputStream;
 
 import javax.wsdl.Definition;
 import javax.wsdl.Port;
@@ -30,6 +31,7 @@
 import org.apache.cxf.binding.soap.Soap11;
 import org.apache.cxf.binding.soap.Soap12;
 import org.apache.cxf.binding.soap.SoapBindingConfiguration;
+import org.apache.cxf.helpers.IOUtils;
 import org.apache.cxf.helpers.WSDLHelper;
 import org.apache.cxf.tools.common.ProcessorTestBase;
 import org.apache.cxf.tools.common.ToolConstants;
@@ -41,6 +43,7 @@
 import org.apache.cxf.tools.wsdlto.core.PluginLoader;
 import org.apache.cxf.tools.wsdlto.frontend.jaxws.JAXWSContainer;
 import org.junit.After;
+import org.junit.Ignore;
 import org.junit.Test;
 
 public class JavaToProcessorTest extends ProcessorTestBase {
@@ -273,6 +276,7 @@
     }
 
     @Test
+    @Ignore
     public void testGenWrapperInAnotherPackage() throws Exception {
         env.put(ToolConstants.CFG_CLASSNAME,
                 
"org.apache.cxf.tools.fortest.withannotation.doc.GreeterNoWrapperBean");
@@ -286,6 +290,13 @@
         File responseWrapperClass = new File(output, pkgBase + 
"/SayHiResponse.java");
         assertTrue(requestWrapperClass.exists());
         assertTrue(responseWrapperClass.exists());
+        
+        responseWrapperClass = new File(output, pkgBase + 
"/EchoDataBeanResponse.java");
+        assertTrue(requestWrapperClass.exists());
+        //The EchoDataBeanResponse object NEEDS to import the TestDataBean.  
Thus, the
+        //package string should be in there someplace.
+        String contents = IOUtils.toString(new 
FileInputStream(responseWrapperClass));
+        
assertTrue(contents.indexOf("org.apache.cxf.tools.fortest.withannotation.doc") 
!= -1);
     }
 
     @Test


Reply via email to