cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r532674 - in /incubator/cxf/trunk: rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java
Date Thu, 26 Apr 2007 09:02:21 GMT
Author: ema
Date: Thu Apr 26 02:02:21 2007
New Revision: 532674

URL: http://svn.apache.org/viewvc?view=rev&rev=532674
Log:
[CXF-531]Enable -cp flag for java2wsdl tool

Modified:
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
    incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java?view=diff&rev=532674&r1=532673&r2=532674
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
Thu Apr 26 02:02:21 2007
@@ -394,7 +394,7 @@
         
         if (clsName.length() > 0) {
             try {
-                return ClassLoaderUtils.loadClass(clsName, getClass());
+                return ClassLoaderUtils.loadClass(clsName, implInfo.getEndpointClass());
             } catch (ClassNotFoundException e) {
                 if (isWrapperSpecifiedByAnno) {
                     throw new ServiceConstructionException(e);
@@ -423,7 +423,7 @@
 
         if (clsName.length() > 0) {
             try {
-                return ClassLoaderUtils.loadClass(clsName, getClass());
+                return ClassLoaderUtils.loadClass(clsName, implInfo.getEndpointClass());
             } catch (ClassNotFoundException e) {
                 if (isWrapperSpecifiedByAnno) {
                     throw new ServiceConstructionException(e);

Modified: incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java?view=diff&rev=532674&r1=532673&r2=532674
==============================================================================
--- incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java
(original)
+++ incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java
Thu Apr 26 02:02:21 2007
@@ -34,8 +34,11 @@
 import org.apache.cxf.tools.common.ToolConstants;
 import org.apache.cxf.tools.common.ToolContext;
 import org.apache.cxf.tools.common.WSDLConstants;
+import org.apache.cxf.tools.wsdlto.core.DataBindingProfile;
+import org.apache.cxf.tools.wsdlto.core.FrontEndProfile;
+import org.apache.cxf.tools.wsdlto.core.PluginLoader;
+import org.apache.cxf.tools.wsdlto.frontend.jaxws.JAXWSContainer;
 import org.junit.After;
-import org.junit.Ignore;
 import org.junit.Test;
 
 public class JavaToProcessorTest extends ProcessorTestBase {
@@ -130,20 +133,41 @@
         assertFileEquals(new File(expectedFile), new File(output, "hello_soap12.wsdl"));
     }
     
-    @Ignore
+    @Test
     public void testDocLitUseClassPathFlag() throws Exception {
-        String tns = "org.apache.asyn_lit";
+        File classFile = new java.io.File(output.getCanonicalPath() + "/classes");
+        classFile.mkdir();
+        
+        System.setProperty("java.class.path", getClassPath() + classFile.getCanonicalPath()
+                           + File.separatorChar);
+        
+        env.put(ToolConstants.CFG_COMPILE, ToolConstants.CFG_COMPILE);
+        env.put(ToolConstants.CFG_CLASSDIR, output.getCanonicalPath() + "/classes");
+        env.put(FrontEndProfile.class, PluginLoader.getInstance().getFrontEndProfile("jaxws"));
+        env.put(DataBindingProfile.class, PluginLoader.getInstance().getDataBindingProfile("jaxb"));
+        env.put(ToolConstants.CFG_OUTPUTDIR, output.getCanonicalPath());
+        env.put(ToolConstants.CFG_PACKAGENAME, "org.apache.cxf.classpath");
+        env.put(ToolConstants.CFG_CLASSDIR, output.getCanonicalPath() + "/classes");
+        env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl/hello_world_doc_lit.wsdl"));
+        JAXWSContainer w2jProcessor = new JAXWSContainer(null);
+        w2jProcessor.setContext(env);
+        w2jProcessor.execute();
+        
+        
+        String tns = "http://apache.org/hello_world_doc_lit";
         String serviceName = "cxfService";
 
         System.setProperty("java.class.path", "");
-        env.put(ToolConstants.CFG_OUTPUTFILE, output.getPath() + "/doc_lit.wsdl");
-        env.put(ToolConstants.CFG_CLASSNAME, "org.apache.hello_world_doc_lit.Greeter");
+        
+        env.put(ToolConstants.CFG_OUTPUTFILE, output.getPath() + "/doc_lit_classpath.wsdl");
+        env.put(ToolConstants.CFG_CLASSNAME, "org.apache.cxf.classpath.Greeter");
         env.put(ToolConstants.CFG_TNS, tns);
-        //env.put(ToolConstants.CFG_CLASSPATH, classFile.getCanonicalPath());
+        env.put(ToolConstants.CFG_CLASSPATH, classFile.getCanonicalPath());
         env.put(ToolConstants.CFG_SERVICENAME, serviceName);
         processor.setEnvironment(env);
         processor.process();
-        File wsdlFile = new File(output, "doc_lit.wsdl");
+        
+        File wsdlFile = new File(output, "doc_lit_classpath.wsdl");
         assertTrue("Generate Wsdl Fail", wsdlFile.exists());
 
         Definition def = wsdlHelper.getDefinition(wsdlFile);



Mime
View raw message