cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1440730 - in /cxf/branches/2.6.x-fixes: ./ tools/wadlto/jaxrs/ tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/ tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxb/ tools/wadlto/jaxrs/src/main/java/org/apache/cxf...
Date Wed, 30 Jan 2013 23:07:12 GMT
Author: sergeyb
Date: Wed Jan 30 23:07:12 2013
New Revision: 1440730

URL: http://svn.apache.org/viewvc?rev=1440730&view=rev
Log:
Reverting wadl gen related merge on 2.6.x for now

Modified:
    cxf/branches/2.6.x-fixes/   (props changed)
    cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/pom.xml
    cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/WadlToolConstants.java
    cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxb/CustomizationParser.java
    cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/JAXRSContainer.java
    cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/jaxrs-toolspec.xml
    cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/src/test/java/org/apache/cxf/tools/wadlto/jaxrs/WADLToJavaTest.java

Propchange: cxf/branches/2.6.x-fixes/
            ('svn:mergeinfo' removed)

Propchange: cxf/branches/2.6.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/pom.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/pom.xml?rev=1440730&r1=1440729&r2=1440730&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/pom.xml (original)
+++ cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/pom.xml Wed Jan 30 23:07:12 2013
@@ -68,12 +68,6 @@
                 </exclusion>
             </exclusions>
         </dependency>
-        <dependency>
-            <groupId>org.jvnet.jaxb2_commons</groupId>
-            <artifactId>jaxb2-basics</artifactId>
-            <version>0.6.4</version>
-            <scope>test</scope>
-        </dependency>
 
         
     </dependencies>

Modified: cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/WadlToolConstants.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/WadlToolConstants.java?rev=1440730&r1=1440729&r2=1440730&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/WadlToolConstants.java
(original)
+++ cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/WadlToolConstants.java
Wed Jan 30 23:07:12 2013
@@ -26,7 +26,6 @@ public final class WadlToolConstants {
     public static final String CFG_OUTPUTDIR = ToolConstants.CFG_OUTPUTDIR;
     public static final String CFG_COMPILE = ToolConstants.CFG_COMPILE;
     public static final String CFG_CLASSDIR = ToolConstants.CFG_CLASSDIR;
-    public static final String CFG_XJC_ARGS = ToolConstants.CFG_XJC_ARGS;
     
     /**
      * Default

Modified: cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxb/CustomizationParser.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxb/CustomizationParser.java?rev=1440730&r1=1440729&r2=1440730&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxb/CustomizationParser.java
(original)
+++ cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxb/CustomizationParser.java
Wed Jan 30 23:07:12 2013
@@ -22,7 +22,6 @@ import java.io.File;
 import java.io.FileOutputStream;
 import java.net.URL;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.List;
 import java.util.logging.Logger;
 
@@ -88,14 +87,6 @@ public final class CustomizationParser {
             InputSource ins = new InputSource(bindingFileUrl.toString());
             jaxbBindings.add(ins);
         }
-
-        //pass additional JAXB compiler arguments
-        Object jaxbCompilerArgs = env.get(WadlToolConstants.CFG_XJC_ARGS);
-        if (jaxbCompilerArgs != null) {
-            String[] jaxbArgs = jaxbCompilerArgs instanceof String
-                    ? new String[]{(String)jaxbCompilerArgs} : (String[])jaxbCompilerArgs;
-            compilerArgs.addAll(Arrays.asList(jaxbArgs));
-        }
         
         // Schema Namespace to Package customizations
         for (String ns : env.getNamespacePackageMap().keySet()) {

Modified: cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/JAXRSContainer.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/JAXRSContainer.java?rev=1440730&r1=1440729&r2=1440730&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/JAXRSContainer.java
(original)
+++ cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/JAXRSContainer.java
Wed Jan 30 23:07:12 2013
@@ -104,7 +104,6 @@ public class JAXRSContainer extends Abst
         set.add(WadlToolConstants.CFG_SCHEMA_PACKAGENAME);
         set.add(WadlToolConstants.CFG_SCHEMA_TYPE_MAP);
         set.add(WadlToolConstants.CFG_MEDIA_TYPE_MAP);
-        set.add(WadlToolConstants.CFG_XJC_ARGS);
         return set;
     }
     

Modified: cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/jaxrs-toolspec.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/jaxrs-toolspec.xml?rev=1440730&r1=1440729&r2=1440730&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/jaxrs-toolspec.xml
(original)
+++ cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/jaxrs-toolspec.xml
Wed Jan 30 23:07:12 2013
@@ -308,23 +308,23 @@ TODO: consider implementing most of the 
                 </annotation>
                 <switch>keep</switch>
             </option>
--->
+            
             <option id="xjc" maxOccurs="unbounded">
                 <annotation>
                     Specifies a comma separated list of arguments that are passed directly
to XJC when the
-                    JAXB data binding  is used. This option causes XJC to load additional
plugins that
-                    augment code generation. For example to load the toString(ts) plugin
that will add a toString()
-                    method to all generated types the following &lt;xjc arguments&gt;
would
+                    JAXB data binding  is used. This option causes XJC to load additional
plugins that 
+                    augment code generation. For example to load the toString(ts) plugin
that will add a toString() 
+                    method to all generated types the following &lt;xjc arguments&gt;
would 
                     be used:
                           -xjc-Xts
-                    A list of available XJC plugins can be obtained by using -xjc-X.
+                    A list of available XJC plugins can be obtained by using -xjc-X.    
                
                 </annotation>
                 <associatedArgument placement="immediate">
                     <annotation>xjc-arguments</annotation>
                 </associatedArgument>
                 <switch>xjc</switch>
             </option>
-
+-->
         </optionGroup>
         <optionGroup id="common_options">
             <option id="help" maxOccurs="1">

Modified: cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/src/test/java/org/apache/cxf/tools/wadlto/jaxrs/WADLToJavaTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/src/test/java/org/apache/cxf/tools/wadlto/jaxrs/WADLToJavaTest.java?rev=1440730&r1=1440729&r2=1440730&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/src/test/java/org/apache/cxf/tools/wadlto/jaxrs/WADLToJavaTest.java
(original)
+++ cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/src/test/java/org/apache/cxf/tools/wadlto/jaxrs/WADLToJavaTest.java
Wed Jan 30 23:07:12 2013
@@ -21,9 +21,6 @@ package org.apache.cxf.tools.wadlto.jaxr
 
 import java.io.File;
 import java.net.URISyntaxException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.cxf.helpers.FileUtils;
@@ -58,91 +55,6 @@ public class WADLToJavaTest extends Proc
             fail();
         }
     }
-
-    @Test
-    public void testGenerateJAXBToString() throws Exception {
-
-        try {
-            String[] args = new String[] {
-                "-d",
-                output.getCanonicalPath(),
-                "-p",
-                "custom.service",
-                "-async getName,delete",
-                "-compile",
-                "-xjc-XtoString",
-                getLocation("/wadl/bookstore.xml"),
-            };
-
-            WADLToJava tool = new WADLToJava(args);
-            tool.run(new ToolContext());
-            assertNotNull(output.list());
-
-            verifyFiles("java", true, false, "superbooks", "custom.service");
-            verifyFiles("class", true, false, "superbooks", "custom.service");
-
-            List<Class<?>> schemaClassFiles = getSchemaClassFiles();
-            assertEquals(4, schemaClassFiles.size());
-            for (Class<?> c : schemaClassFiles) {
-                c.getMethod("toString");
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-            fail();
-        }
-    }
-    
-    private List<Class<?>> getSchemaClassFiles() throws Exception {
-        ClassLoader cl = new URLClassLoader(new URL[] {output.toURI().toURL()},
-                                            Thread.currentThread().getContextClassLoader());
-           
-        List<Class<?>> files = new ArrayList<Class<?>>(4);
-        files.add(cl.loadClass("superbooks.EnumType"));
-        files.add(cl.loadClass("superbooks.Book"));
-        files.add(cl.loadClass("superbooks.TheBook2"));
-        files.add(cl.loadClass("superbooks.Chapter"));
-        return files;
-    }
-
-    @Test
-    public void testGenerateJAXBToStringAndEqualsAndHashCode() throws Exception {
-
-        try {
-            String[] args = new String[] {
-                "-d",
-                output.getCanonicalPath(),
-                "-p",
-                "custom.service",
-                "-async getName,delete",
-                "-compile",
-                "-xjc-XtoString",
-                "-xjc-Xequals",
-                "-xjc-XhashCode",
-                getLocation("/wadl/bookstore.xml"),
-            };
-
-            WADLToJava tool = new WADLToJava(args);
-            tool.run(new ToolContext());
-            assertNotNull(output.list());
-
-            verifyFiles("java", true, false, "superbooks", "custom.service");
-            verifyFiles("class", true, false, "superbooks", "custom.service");
-
-            List<Class<?>> schemaClassFiles = getSchemaClassFiles();
-            assertEquals(4, schemaClassFiles.size());
-            for (Class<?> c : schemaClassFiles) {
-                c.getMethod("toString");
-                c.getMethod("hashCode");
-                c.getMethod("equals", Object.class);
-            }
-            
-        } catch (Exception e) {
-            e.printStackTrace();
-            fail();
-        }
-    }
-
-
     
     private void verifyFiles(String ext, boolean subresourceExpected, boolean interfacesAndImpl,

                              String schemaPackage, String resourcePackage) {    
@@ -176,17 +88,13 @@ public class WADLToJavaTest extends Proc
     
     private boolean checkContains(List<File> clsFiles, String name) {
         for (File f : clsFiles) {
-            if (checkFileContains(f, name)) {
+            if (f.getAbsolutePath().replace(File.separatorChar, '.').endsWith(name)) {
                 return true;
             }
         }
         return false;
     }
     
-    private boolean checkFileContains(File f, String name) {
-        return f.getAbsolutePath().replace(File.separatorChar, '.').endsWith(name);
-    }
-    
     protected String getLocation(String wsdlFile) throws URISyntaxException {
         return getClass().getResource(wsdlFile).toString();
     }



Mime
View raw message