cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject svn commit: r546381 - in /incubator/cxf/trunk/tools/javato: core/src/main/java/org/apache/cxf/tools/java2wsdl/processor/ test/src/test/java/org/apache/cxf/tools/java2wsdl/processor/
Date Tue, 12 Jun 2007 04:55:23 GMT
Author: mmao
Date: Mon Jun 11 21:55:22 2007
New Revision: 546381

URL: http://svn.apache.org/viewvc?view=rev&rev=546381
Log:
* LOG the classpath during the process, and add a unit test


Modified:
    incubator/cxf/trunk/tools/javato/core/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessor.java
    incubator/cxf/trunk/tools/javato/core/src/main/java/org/apache/cxf/tools/java2wsdl/processor/Messages.properties
    incubator/cxf/trunk/tools/javato/test/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java

Modified: incubator/cxf/trunk/tools/javato/core/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/core/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessor.java?view=diff&rev=546381&r1=546380&r2=546381
==============================================================================
--- incubator/cxf/trunk/tools/javato/core/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessor.java
(original)
+++ incubator/cxf/trunk/tools/javato/core/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessor.java
Mon Jun 11 21:55:22 2007
@@ -22,6 +22,7 @@
 import java.io.File;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 import javax.xml.namespace.QName;
 import javax.xml.ws.BindingType;
@@ -50,6 +51,7 @@
 public class JavaToProcessor implements Processor {
     private static final Logger LOG = LogUtils.getL7dLogger(JavaToProcessor.class);
     private static final String DEFAULT_ADDRESS = "http://localhost:9090/hello";
+    private static final String JAVA_CLASS_PATH = "java.class.path";
     private ToolContext context;
     private final List<AbstractGenerator> generators = new ArrayList<AbstractGenerator>();
 
@@ -73,11 +75,14 @@
     }
     
     public void process() throws ToolException {
-        String oldClassPath = System.getProperty("java.class.path");
+        String oldClassPath = System.getProperty(JAVA_CLASS_PATH);
+        LOG.log(Level.INFO, "OLD_CP", oldClassPath);
         if (context.get(ToolConstants.CFG_CLASSPATH) != null) {
             String newCp = (String)context.get(ToolConstants.CFG_CLASSPATH);
-            System.setProperty("java.class.path", newCp + File.pathSeparator + oldClassPath);
+            System.setProperty(JAVA_CLASS_PATH, newCp + File.pathSeparator + oldClassPath);
+            LOG.log(Level.INFO, "NEW_CP", newCp);
         }
+
         ServiceBuilder builder = getServiceBuilder();
         ServiceInfo service = builder.createService();
 
@@ -93,7 +98,8 @@
         generators.add(getFaultBeanGenerator());
         
         generate(service, outputDir);
-        System.setProperty("java.class.path", oldClassPath);
+        System.setProperty(JAVA_CLASS_PATH, oldClassPath);
+        LOG.log(Level.INFO, "RESUME_CP", oldClassPath);
     }
 
     private AbstractGenerator getWrapperBeanGenerator() {

Modified: incubator/cxf/trunk/tools/javato/core/src/main/java/org/apache/cxf/tools/java2wsdl/processor/Messages.properties
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/core/src/main/java/org/apache/cxf/tools/java2wsdl/processor/Messages.properties?view=diff&rev=546381&r1=546380&r2=546381
==============================================================================
--- incubator/cxf/trunk/tools/javato/core/src/main/java/org/apache/cxf/tools/java2wsdl/processor/Messages.properties
(original)
+++ incubator/cxf/trunk/tools/javato/core/src/main/java/org/apache/cxf/tools/java2wsdl/processor/Messages.properties
Mon Jun 11 21:55:22 2007
@@ -36,4 +36,8 @@
 LOAD_RESPONSE_WRAPPER_CLASS_ERROR = Can not load the response wrapper class {0}, please check
the @ResponseWrapper annotation and see if the class is in your classpath
 
 
-OUTFILE_EXISTS = The file [{0}] you are going to generate already exists, please rename
\ No newline at end of file
+OUTFILE_EXISTS = The file [{0}] you are going to generate already exists, please rename
+
+OLD_CP = Classpath before Java2Wsdl: {0}
+NEW_CP = Classpath during Java2Wsdl: {0}
+RESUME_CP = Classpath after Java2Wsdl: {0}
\ No newline at end of file

Modified: incubator/cxf/trunk/tools/javato/test/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/test/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java?view=diff&rev=546381&r1=546380&r2=546381
==============================================================================
--- incubator/cxf/trunk/tools/javato/test/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java
(original)
+++ incubator/cxf/trunk/tools/javato/test/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java
Mon Jun 11 21:55:22 2007
@@ -20,7 +20,6 @@
 package org.apache.cxf.tools.java2wsdl.processor;
 
 import java.io.File;
-
 import javax.wsdl.Definition;
 import javax.wsdl.Port;
 import javax.wsdl.Service;
@@ -38,6 +37,7 @@
 import org.apache.cxf.wsdl.WSDLConstants;
 import org.junit.After;
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 
 public class JavaToProcessorTest extends ProcessorTestBase {
@@ -270,7 +270,9 @@
         assertTrue("Generate Wsdl Fail", wsdlFile.exists());
 
     }
-    
+
+    @Test
+    @Ignore("Can not load the HelloNoPackage")
     public void testHelloNoPackage() throws Exception {
         env.put(ToolConstants.CFG_OUTPUTFILE, output.getPath() + "/hello-no-package.wsdl");
         env.put(ToolConstants.CFG_CLASSNAME, "HelloNoPackage");
@@ -286,6 +288,22 @@
         File responseWrapperClass = new File(output, pkgBase + "/SayHiResponse.java");
         assertTrue(requestWrapperClass.exists());
         assertTrue(responseWrapperClass.exists());
+    }
+
+    @Test
+    public void testResumeClasspath() throws Exception {
+        File classFile = new java.io.File(output.getCanonicalPath() + "/classes");
+
+        String oldCP = System.getProperty("java.class.path");
+    
+        env.put(ToolConstants.CFG_CLASSNAME, "org.apache.cxf.tools.fortest.simple.Hello");
+        env.put(ToolConstants.CFG_CLASSPATH, classFile.toString());
+        processor.setEnvironment(env);
+        processor.process();
+
+        String newCP = System.getProperty("java.class.path");
+
+        assertEquals(oldCP, newCP);
     }
     
 }



Mime
View raw message