cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r630270 - in /incubator/cxf/trunk/tools/javato/ws/src: main/java/org/apache/cxf/tools/java2js/processor/ main/java/org/apache/cxf/tools/java2wsdl/processor/ test/java/org/apache/cxf/tools/java2wsdl/processor/
Date Fri, 22 Feb 2008 18:08:08 GMT
Author: dkulp
Date: Fri Feb 22 10:08:04 2008
New Revision: 630270

URL: http://svn.apache.org/viewvc?rev=630270&view=rev
Log:
[CXF-1446] Make sure the target directory actually exists

Modified:
    incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2js/processor/JavaToJSProcessor.java
    incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessor.java
    incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java

Modified: incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2js/processor/JavaToJSProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2js/processor/JavaToJSProcessor.java?rev=630270&r1=630269&r2=630270&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2js/processor/JavaToJSProcessor.java
(original)
+++ incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2js/processor/JavaToJSProcessor.java
Fri Feb 22 10:08:04 2008
@@ -216,11 +216,13 @@
     protected File getOutputDir(File wsdlLocation) {
         String dir = (String)context.get(ToolConstants.CFG_OUTPUTDIR);
         if (dir == null) {
-            if (wsdlLocation == null) {
+            if (wsdlLocation == null 
+                || wsdlLocation.getParentFile() == null
+                || !wsdlLocation.getParentFile().exists()) {
                 dir = "./";
             } else {
                 dir = wsdlLocation.getParent();
-            }
+            } 
         }
         return new File(dir);
     }

Modified: incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessor.java?rev=630270&r1=630269&r2=630270&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessor.java
(original)
+++ incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessor.java
Fri Feb 22 10:08:04 2008
@@ -259,11 +259,13 @@
     protected File getOutputDir(File wsdlLocation) {
         String dir = (String)context.get(ToolConstants.CFG_OUTPUTDIR);
         if (dir == null) {
-            if (wsdlLocation == null) {
+            if (wsdlLocation == null 
+                || wsdlLocation.getParentFile() == null
+                || !wsdlLocation.getParentFile().exists()) {
                 dir = "./";
             } else {
                 dir = wsdlLocation.getParent();
-            }
+            } 
         }
         return new File(dir);
     }

Modified: incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java?rev=630270&r1=630269&r2=630270&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java
(original)
+++ incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java
Fri Feb 22 10:08:04 2008
@@ -62,6 +62,14 @@
         processor.setEnvironment(new ToolContext());
         assertEquals(WSDLConstants.WSDLVersion.WSDL11, processor.getWSDLVersion());
     }
+    @Test
+    public void testGetOutputDir() throws Exception {
+        processor.setEnvironment(env);
+        File wsdlLocation = new File("http:\\\\example.com?wsdl");
+        File f = processor.getOutputDir(wsdlLocation);
+        assertNotNull(f);
+        assertTrue(f.exists());
+    }
 
     @Test
     public void testSimpleClass() throws Exception {



Mime
View raw message