cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1464542 - in /cxf/branches/2.6.x-fixes: ./ tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/ tools/wadlto/jaxrs/src/test/java/org/apache/cxf/tools/wadlto/jaxrs/ tools/wadlto/jaxrs/src/test/resources/wadl/sub/
Date Thu, 04 Apr 2013 13:45:59 GMT
Author: sergeyb
Date: Thu Apr  4 13:45:59 2013
New Revision: 1464542

URL: http://svn.apache.org/r1464542
Log:
Merged revisions 1464538 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/branches/2.7.x-fixes

................
  r1464538 | sergeyb | 2013-04-04 16:43:15 +0300 (Thu, 04 Apr 2013) | 9 lines
  
  Merged revisions 1464532 via svnmerge from 
  https://svn.apache.org/repos/asf/cxf/trunk
  
  ........
    r1464532 | sergeyb | 2013-04-04 16:38:52 +0300 (Thu, 04 Apr 2013) | 1 line
    
    [CXF-4946] Better resolving of relative references with parent folders
  ........
................

Added:
    cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/src/test/resources/wadl/sub/
      - copied from r1464538, cxf/branches/2.7.x-fixes/tools/wadlto/jaxrs/src/test/resources/wadl/sub/
    cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/src/test/resources/wadl/sub/bookstoreImport.xml
      - copied unchanged from r1464538, cxf/branches/2.7.x-fixes/tools/wadlto/jaxrs/src/test/resources/wadl/sub/bookstoreImport.xml
Modified:
    cxf/branches/2.6.x-fixes/   (props changed)
    cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java
    cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/src/test/java/org/apache/cxf/tools/wadlto/jaxrs/JAXRSContainerTest.java

Propchange: cxf/branches/2.6.x-fixes/
------------------------------------------------------------------------------
  Merged /cxf/branches/2.7.x-fixes:r1464538
  Merged /cxf/trunk:r1464532

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

Modified: cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.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/SourceGenerator.java?rev=1464542&r1=1464541&r2=1464542&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java
(original)
+++ cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java
Thu Apr  4 13:45:59 2013
@@ -1342,7 +1342,7 @@ public class SourceGenerator {
             if (schemaURI == null) {
                 if (!URI.create(href).isAbsolute() && app.getWadlPath() != null)
{
                     String baseWadlPath = getBaseWadlPath(app.getWadlPath());
-                    if  (!href.startsWith("/")) {
+                    if  (!href.startsWith("/") && !href.contains("..")) {
                         schemaURI = baseWadlPath + href;
                     } else {
                         schemaURI = URI.create(baseWadlPath).resolve(href).toString();

Modified: cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/src/test/java/org/apache/cxf/tools/wadlto/jaxrs/JAXRSContainerTest.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/JAXRSContainerTest.java?rev=1464542&r1=1464541&r2=1464542&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/src/test/java/org/apache/cxf/tools/wadlto/jaxrs/JAXRSContainerTest.java
(original)
+++ cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/src/test/java/org/apache/cxf/tools/wadlto/jaxrs/JAXRSContainerTest.java
Thu Apr  4 13:45:59 2013
@@ -135,6 +135,30 @@ public class JAXRSContainerTest extends 
         }
     }
     
+    @Test
+    public void testCodeGenWithImportedSchemaWithParentRefs() {
+        try {
+            JAXRSContainer container = new JAXRSContainer(null);
+
+            ToolContext context = new ToolContext();
+            context.put(WadlToolConstants.CFG_OUTPUTDIR, output.getCanonicalPath());
+            context.put(WadlToolConstants.CFG_WADLURL, getLocation("/wadl/sub/bookstoreImport.xml"));
+            context.put(WadlToolConstants.CFG_COMPILE, "true");
+
+            container.setContext(context);
+            container.execute();
+
+            assertNotNull(output.list());
+            
+            verifyFiles("java", false, false, "superbooks", "org.apache.cxf.jaxrs.model.wadl",
9);
+            verifyFiles("class", false, false, "superbooks", "org.apache.cxf.jaxrs.model.wadl",
9);
+            
+        } catch (Exception e) {
+            e.printStackTrace();
+            fail();
+        }
+    }
+    
     @Test    
     public void testCodeGenWithMultipleInlinedSchemas() {
         doTestInlinedSchemasWithImport("/wadl/bookstoreMultipleSchemas.xml");



Mime
View raw message