cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1124961 - in /cxf/trunk: rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/codegen/ tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/ tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/ tools/wadlto/jaxrs...
Date Thu, 19 May 2011 15:43:42 GMT
Author: sergeyb
Date: Thu May 19 15:43:42 2011
New Revision: 1124961

URL: http://svn.apache.org/viewvc?rev=1124961&view=rev
Log:
[CXF-3948] Adding a basic JAXRSContainer loader

Added:
    cxf/trunk/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/WADLToJava.java
  (with props)
    cxf/trunk/tools/wadlto/jaxrs/src/test/java/org/apache/cxf/tools/wadlto/jaxrs/WADLToJavaTest.java
  (with props)
Modified:
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/codegen/SourceGenerator.java
    cxf/trunk/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/JAXRSContainer.java
    cxf/trunk/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/jaxrs-toolspec.xml

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/codegen/SourceGenerator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/codegen/SourceGenerator.java?rev=1124961&r1=1124960&r2=1124961&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/codegen/SourceGenerator.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/codegen/SourceGenerator.java
Thu May 19 15:43:42 2011
@@ -962,7 +962,7 @@ public class SourceGenerator {
         private static final String JAVAX_PREFIX = "javax";
         public int compare(String s1, String s2) {
             boolean javax1 = s1.startsWith(JAVAX_PREFIX);
-            boolean javax2 = s1.startsWith(JAVAX_PREFIX);
+            boolean javax2 = s2.startsWith(JAVAX_PREFIX);
             if (javax1 && !javax2) {
                 return -1;
             } else if (!javax1 && javax2) {

Added: cxf/trunk/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/WADLToJava.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/WADLToJava.java?rev=1124961&view=auto
==============================================================================
--- cxf/trunk/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/WADLToJava.java
(added)
+++ cxf/trunk/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/WADLToJava.java
Thu May 19 15:43:42 2011
@@ -0,0 +1,129 @@
+/**
+ * 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.wadlto;
+
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.cxf.common.util.StringUtils;
+import org.apache.cxf.tools.common.CommandInterfaceUtils;
+import org.apache.cxf.tools.common.ToolContext;
+import org.apache.cxf.tools.common.ToolException;
+import org.apache.cxf.tools.common.toolspec.ToolContainer;
+import org.apache.cxf.tools.common.toolspec.ToolRunner;
+import org.apache.cxf.tools.wadlto.jaxrs.JAXRSContainer;
+
+public class WADLToJava {
+
+
+    private String[] args;
+    
+    public WADLToJava() {
+        args = new String[0];
+    }
+    public WADLToJava(String pargs[]) {
+        args = pargs;
+    }
+
+
+    private boolean isExitOnFinish() {
+        String exit = System.getProperty("exitOnFinish");
+        if (StringUtils.isEmpty(exit)) {
+            return false;
+        }
+        return "YES".equalsIgnoreCase(exit) || "TRUE".equalsIgnoreCase(exit);
+    }
+    
+    public void run(ToolContext context) throws Exception {
+        run(context, null);
+    }
+
+    public void run(ToolContext context, OutputStream os) throws Exception {
+        Class<? extends ToolContainer> containerClass = JAXRSContainer.class;
+
+        InputStream toolspecStream = getResourceAsStream(containerClass, "jaxrs-toolspec.xml");
+
+        ToolRunner.runTool(containerClass,
+                           toolspecStream,
+                           false,
+                           args,
+                           isExitOnFinish(),
+                           context,
+                           os);
+    }
+
+    protected boolean isVerbose() {
+        return isSet(new String[]{"-V", "-verbose"});
+    }
+
+    private boolean isSet(String[] keys) {
+        if (args == null) {
+            return false;
+        }
+        List<String> pargs = Arrays.asList(args);
+
+        for (String key : keys) {
+            if (pargs.contains(key)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    
+    public static void main(String[] pargs) {
+
+        CommandInterfaceUtils.commandCommonMain();
+        WADLToJava w2j = new WADLToJava(pargs);
+        try {
+
+            w2j.run(new ToolContext());
+
+        } catch (ToolException ex) {
+            System.err.println();
+            System.err.println("WADLToJava Error: " + ex.getMessage());
+            System.err.println();
+            if (w2j.isVerbose()) {
+                ex.printStackTrace();
+            }
+            if (w2j.isExitOnFinish()) {
+                System.exit(1);
+            }
+        } catch (Exception ex) {
+            System.err.println("WADLToJava Error: " + ex.getMessage());
+            System.err.println();
+            if (w2j.isVerbose()) {
+                ex.printStackTrace();
+            }
+            if (w2j.isExitOnFinish()) {
+                System.exit(1);
+            }
+        }
+        if (w2j.isExitOnFinish()) {
+            System.exit(0);
+        }
+    }
+
+    private static InputStream getResourceAsStream(Class clz, String file) {
+        return clz.getResourceAsStream(file);
+    }
+}

Propchange: cxf/trunk/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/WADLToJava.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/WADLToJava.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: cxf/trunk/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/JAXRSContainer.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/JAXRSContainer.java?rev=1124961&r1=1124960&r2=1124961&view=diff
==============================================================================
--- cxf/trunk/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/JAXRSContainer.java
(original)
+++ cxf/trunk/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/JAXRSContainer.java
Thu May 19 15:43:42 2011
@@ -22,7 +22,9 @@ package org.apache.cxf.tools.wadlto.jaxr
 import java.io.File;
 import java.io.IOException;
 import java.net.URL;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
 
 import org.xml.sax.InputSource;
 
@@ -78,12 +80,17 @@ public class JAXRSContainer extends Abst
 
     public void buildToolContext() {
         getContext();
+        context.addParameters(getParametersMap(getArrayKeys()));
         if (context.get(WadlToolConstants.CFG_OUTPUTDIR) == null) {
             context.put(WadlToolConstants.CFG_OUTPUTDIR, ".");
         }
         setPackageAndNamespaces();
     }
 
+    public Set<String> getArrayKeys() {
+        return new HashSet<String>();
+    }
+    
     private void processWadl() {
         File outDir = new File((String)context.get(WadlToolConstants.CFG_OUTPUTDIR));
         String wadlURL = getAbsoluteWadlURL();

Modified: cxf/trunk/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/jaxrs-toolspec.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/jaxrs-toolspec.xml?rev=1124961&r1=1124960&r2=1124961&view=diff
==============================================================================
--- cxf/trunk/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/jaxrs-toolspec.xml
(original)
+++ cxf/trunk/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/jaxrs-toolspec.xml
Thu May 19 15:43:42 2011
@@ -26,72 +26,51 @@
     <annotation>
 Examples:
 
-        wsdl2java HelloWorld.wsdl
-        wsdl2java -p com.iona.greeting Greeting.wsdl
-        wsdl2java -client HelloWorld.wsdl
+        wadl2java application.wadl
+        wadl2java -p com.books application.wadl
     </annotation>
 
     <usage>
         <optionGroup id="options">
-            <option id="frontend" maxOccurs="1">
+            <option id="packagename">
                 <annotation>
-                    Specifies the front end. (defaults to JAXWS)
+                    Specifies the java package name to use for the generated code
+                    representing WADL resource elements.
                 </annotation>
-                <switch>fe</switch>
-                <switch>frontend</switch>
-                <associatedArgument placement="afterSpace">
-                    <annotation>front-end-name</annotation>
-                </associatedArgument>
-            </option>
-
-            <option id="databinding" maxOccurs="1">
-                <annotation>
-                    Specifies the data binding. (defaults to JAXB)
-                </annotation>
-                <switch>db</switch>
-                <switch>databinding</switch>
-                <associatedArgument placement="afterSpace">
-                    <annotation>data-binding-name</annotation>
-                </associatedArgument>
-            </option>
-
-            <option id="wsdlversion" maxOccurs="1">
-                <annotation>
-                    Specifies the WSDL version. (default is WSDL1.1)
-                </annotation>
-                <switch>wv</switch>
+                <switch>p</switch>
                 <associatedArgument placement="afterSpace">
-                    <annotation>wsdl-version</annotation>
+                    <annotation>package-name</annotation>
                 </associatedArgument>
             </option>
-
-            <option id="packagename" maxOccurs="unbounded">
+            
+            <option id="typePackagename" maxOccurs="unbounded">
                 <annotation>
-                    Specifies the java package name to use for the generated code.
-                    Optionally  specify a WSDL namespace to Java package name
+                    Specifies the java package name to use for the generated code
+                    representing WADL grammar elements.
+                    Optionally specify a namespace to Java package name
                     mapping.
                 </annotation>
-                <switch>p</switch>
+                <switch>sp</switch>
                 <associatedArgument placement="afterSpace">
                     <valuetype>NamingSpacePackageString</valuetype>
-                    <annotation>[wsdl-namespace =]package-name</annotation>
+                    <annotation>[schema-namespace =]package-name</annotation>
                 </associatedArgument>
             </option>
 
-            <option id="servicename">
+            <option id="resourcename">
                 <annotation>
-                    Specify he WSDL service name to use for the generated code.
-                    Also, optionally specify the WSDL namespace.
+                    Specify the simple class name to use for the generated code
+                    representing a WADL resource without the id attribute.
                 </annotation>
-                <switch>sn</switch>
+                <switch>resource</switch>
                 <associatedArgument placement="afterSpace">
-                    <annotation>service-name</annotation>
+                    <annotation>resource-name</annotation>
                 </associatedArgument>
             </option>
-
+            
             <option id="binding" maxOccurs="unbounded">
                 <annotation>
-                    Specify an external jaxws or jaxb binding files. Use one
+                    Specify external jaxb binding files. Use one
                     -b flag for each binding file.
                 </annotation>
                 <switch>b</switch>
@@ -99,21 +78,10 @@ Examples:
                     <annotation>binding-file-name</annotation>
                 </associatedArgument>
             </option>
-            <option id="reserveClass" maxOccurs="unbounded">
-                <annotation>
-                    Reserve a class name to keep the code generator from generating
-                    a class of the given name.   In name cases, a binding file or 
-                    use of -autoNameResolution flag may be necessary for the 
-                    code generator to completely generate usable code.
-                </annotation>
-                <switch>reserveClass</switch>
-                <associatedArgument placement="afterSpace">
-                    <annotation>class-name</annotation>
-                </associatedArgument>
-            </option>
+            
             <option id="catalog" maxOccurs="1">
                 <annotation>
-                    Specify catalog file to map the imported wsdl/schema.
+                    Specify catalog file to map the imported wadl/schema.
                 </annotation>
                 <switch>catalog</switch>
                 <associatedArgument placement="afterSpace">
@@ -152,29 +120,23 @@ Examples:
                 </annotation>
                 <switch>impl</switch>
             </option>
+            
+<!-- 
 
-            <option id="server" maxOccurs="1">
-                <annotation>
-                    Specifies that server code is generated.
-                </annotation>
-                <switch>server</switch>
-            </option>
-
-            <option id="client" maxOccurs="1">
-                <annotation>
-                    Specifies that client code is generated.
-                </annotation>
-                <switch>client</switch>
-            </option>
+TODO: consider implementing most of the following options
 
-            <option id="all" maxOccurs="1">
+            <option id="reserveClass" maxOccurs="unbounded">
                 <annotation>
-                    Specifies that interfaces, types , service, server , dummy impl, client
-                    and ant script are generated.
+                    Reserve a class name to keep the code generator from generating
+                    a class of the given name.   In name cases, a binding file or 
+                    use of -autoNameResolution flag may be necessary for the 
+                    code generator to completely generate usable code.
                 </annotation>
-                <switch>all</switch>
+                <switch>reserveClass</switch>
+                <associatedArgument placement="afterSpace">
+                    <annotation>class-name</annotation>
+                </associatedArgument>
             </option>
-            
             <option id="autoNameResolution" maxOccurs="1">
                 <annotation>
                     Specifies that the tool will attempt to resolve class naming conflicts

@@ -183,34 +145,27 @@ Examples:
                 <switch>autoNameResolution</switch>
             </option>
             
-            <option id="allowElementReferences" maxOccurs="1">
-            	<annotaion>
-            	</annotaion>
-            	<associatedArgument placement="immediate">
-                    <annotation>=true</annotation>
-                    <valueenum>true|false</valueenum>
-                </associatedArgument>
-            	<switch>allowElementReferences</switch>
-            	<switch>aer</switch>
+
+            <option id="server" maxOccurs="1">
+                <annotation>
+                    Specifies that server code is generated.
+                </annotation>
+                <switch>server</switch>
             </option>
 
-	        <option id="defaultValues" maxOccurs="1">
+            <option id="client" maxOccurs="1">
                 <annotation>
-                    Specifies that default values are generated for the dummy implementation
and client. 
-                    You can specify the name of the class to provide the default values.
The default is 
-                    RandomValueProvider.
+                    Specifies that client code is generated.
                 </annotation>
-                <switch>defaultValues</switch>
-                <associatedArgument placement="immediate">
-                    <annotation>=class-name-for-DefaultValueProvider</annotation>
-                </associatedArgument>
+                <switch>client</switch>
             </option>
 
-            <option id="ant" maxOccurs="1">
+            <option id="all" maxOccurs="1">
                 <annotation>
-                    Specifies that an ant build script is generated for the project.
+                    Specifies that interfaces, types , service, server , dummy impl, client
+                    and ant script are generated.
                 </annotation>
-                <switch>ant</switch>
+                <switch>all</switch>
             </option>
 
             <option id="nexclude" maxOccurs="unbounded">
@@ -224,23 +179,11 @@ Examples:
                     <annotation>schema-namespace [= java-package-name]</annotation>
                 </associatedArgument>
             </option>
-
-            <option id="exsoapheader" maxOccurs="1">
-                <annotation>
-                    Enables the processing of extended SOAP header message binding.
-                </annotation>
-                <switch>exsh</switch>
-                <associatedArgument placement="afterSpace">
-                    <annotation>(true, false)</annotation>
-                    <valueenum>true|false</valueenum>
-                </associatedArgument>
-            </option>
-            
+ 
             <option id="notypes" maxOccurs="1">
                 <annotation>Turns off generating types</annotation>
                 <switch>noTypes</switch>
             </option>
-
             <option id="defaultns" maxOccurs="1">
                 <annotation>
                     Enables loading the default namespace package name mapping. The default
is true.
@@ -261,32 +204,22 @@ Examples:
                     <valueenum>true|false</valueenum>
                 </associatedArgument>
             </option>
-
+        
             <option id="validate" maxOccurs="1">
                 <annotation>
-                    Specifies that the WSDL is validated before generating the code. Using

+                    Specifies that the WADL is validated before generating the code. Using

                     this option is highly recommended.
                 </annotation>
                 <switch>validate</switch>
             </option>
-
+            
             <option id="newonly" maxOccurs="1">
                 <annotation>
                     Specifies that existing code will not be over written. NOTE: You will
have to solve any resulting compilation problems by yourself
                 </annotation>
                 <switch>keep</switch>
             </option>
-
-            <option id="wsdlLocation" maxOccurs="1">
-                <annotation>
-                    Specifies the value of the @WebServiceClient annotation's wsdlLocation
property.
-                </annotation>
-                <associatedArgument placement="afterSpace">
-                    <annotation>wsdlLocation</annotation>
-                </associatedArgument>
-                <switch>wsdlLocation</switch>
-            </option>
-
+            
             <option id="xjc" maxOccurs="unbounded">
                 <annotation>
                     Specifies a comma separated list of arguments that are passed directly
to XJC when the
@@ -302,30 +235,7 @@ Examples:
                 </associatedArgument>
                 <switch>xjc</switch>
             </option>
-            
-           <option id="noAddressBinding" maxOccurs="1">
-                <annotation>
-                    Specifies that the generator should not use the address jaxb binding
file to map wsa:EndpointReferenceType 
-                    or wsa:EndpointReference to javax.xml.ws.wsaddressing.W3CEndpointReference.
-                </annotation>
-                <switch>noAddressBinding</switch>
-            </option>
-
-            <option id="useFQCNForFaultSerialVersionUID" maxOccurs="1">
-                <annotation>
-                    Enable generation of Serial Version UID in fault Exception(s) based on
hashcode
-                    of the fully qualified class name of the Exception.
-                </annotation>
-                <switch>useFQCNForFaultSerialVersionUID</switch>
-            </option>
-
-            <option id="mark-generated" maxOccurs="1">
-                <annotation>
-                    Adds @Generated annotation in all java files that are generated.
-                </annotation>
-                <switch>mark-generated</switch>
-            </option>
-
+-->
         </optionGroup>
         <optionGroup id="common_options">
             <option id="help" maxOccurs="1">
@@ -356,21 +266,11 @@ Examples:
                 <switch>quiet</switch>
                 <switch>q</switch>
             </option>
-
-	        <option id="wsdlList" maxOccurs="1">
-	            <annotation>
-	                Indicates the wsdlurl is a plain text list of wsdlurls that are new line
delimited.
-	                As an example the wsdlurl might point to 
-	                http://127.0.0.1:8080/context_path/ws?formatted=false&amp;wsdlList=true
on a cxf 
-	                server. 
-	            </annotation>
-	            <switch>wsdlList</switch>
-	        </option>
-
         </optionGroup>
-        <argument id="wsdlurl" minOccurs="1" maxOccurs="1">
+        <argument id="wadl" minOccurs="1" maxOccurs="1">
             <annotation>
-                wsdl-url</annotation>
+                wadl-url
+            </annotation>
         </argument>
     </usage>
 </toolspec>
\ No newline at end of file

Added: cxf/trunk/tools/wadlto/jaxrs/src/test/java/org/apache/cxf/tools/wadlto/jaxrs/WADLToJavaTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wadlto/jaxrs/src/test/java/org/apache/cxf/tools/wadlto/jaxrs/WADLToJavaTest.java?rev=1124961&view=auto
==============================================================================
--- cxf/trunk/tools/wadlto/jaxrs/src/test/java/org/apache/cxf/tools/wadlto/jaxrs/WADLToJavaTest.java
(added)
+++ cxf/trunk/tools/wadlto/jaxrs/src/test/java/org/apache/cxf/tools/wadlto/jaxrs/WADLToJavaTest.java
Thu May 19 15:43:42 2011
@@ -0,0 +1,100 @@
+/**
+ * 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.wadlto.jaxrs;
+
+import java.io.File;
+import java.net.URISyntaxException;
+import java.util.List;
+
+import org.apache.cxf.helpers.FileUtils;
+import org.apache.cxf.tools.common.ProcessorTestBase;
+import org.apache.cxf.tools.common.ToolContext;
+import org.apache.cxf.tools.wadlto.WADLToJava;
+
+import org.junit.Test;
+
+public class WADLToJavaTest extends ProcessorTestBase {
+
+    @Test    
+    public void testCodeGenInterfaces() {
+        try {
+            String[] args = new String[] {
+                "-d", 
+                output.getCanonicalPath(),
+                "-p",
+                "custom.service",
+                "-compile",
+                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");
+            
+        } catch (Exception e) {
+            e.printStackTrace();
+            fail();
+        }
+    }
+    
+    private void verifyFiles(String ext, boolean subresourceExpected, boolean interfacesAndImpl,

+                             String schemaPackage, String resourcePackage) {    
+        List<File> files = FileUtils.getFilesRecurse(output, ".+\\." + ext + "$");
+        int size = interfacesAndImpl ? 9 : 7;
+        if (!subresourceExpected) {
+            size--;
+        }
+        assertEquals(size, files.size());
+        doVerifyTypes(files, schemaPackage, ext);
+        if (subresourceExpected) {
+            assertTrue(checkContains(files, resourcePackage + ".FormInterface." + ext));
+        }
+        assertTrue(checkContains(files, resourcePackage + ".BookStore." + ext));
+        if (interfacesAndImpl) {
+            if (subresourceExpected) {
+                assertTrue(checkContains(files, resourcePackage + ".FormInterfaceImpl." +
ext));
+            }
+            assertTrue(checkContains(files, resourcePackage + ".BookStoreImpl." + ext));
+        }
+    }
+    
+    private void doVerifyTypes(List<File> files, String schemaPackage, String ext)
{
+        assertTrue(checkContains(files, schemaPackage + ".Book." + ext));
+        assertTrue(checkContains(files, schemaPackage + ".Book2." + ext));
+        assertTrue(checkContains(files, schemaPackage + ".Chapter." + ext));
+        assertTrue(checkContains(files, schemaPackage + ".ObjectFactory." + ext));
+        assertTrue(checkContains(files, schemaPackage + ".package-info." + ext));
+    }
+    
+    private boolean checkContains(List<File> clsFiles, String name) {
+        for (File f : clsFiles) {
+            if (f.getAbsolutePath().replace(File.separatorChar, '.').endsWith(name)) {
+                return true;
+            }
+        }
+        return false;
+    }
+    
+    protected String getLocation(String wsdlFile) throws URISyntaxException {
+        return getClass().getResource(wsdlFile).toString();
+    }
+}

Propchange: cxf/trunk/tools/wadlto/jaxrs/src/test/java/org/apache/cxf/tools/wadlto/jaxrs/WADLToJavaTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/tools/wadlto/jaxrs/src/test/java/org/apache/cxf/tools/wadlto/jaxrs/WADLToJavaTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date



Mime
View raw message