cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject svn commit: r521142 - in /incubator/cxf/trunk/tools: common/src/main/java/org/apache/cxf/tools/common/ javato/src/test/java/org/apache/cxf/tools/common/ javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/ wsdlto/misc/src/test/java/org/apache...
Date Thu, 22 Mar 2007 07:51:15 GMT
Author: mmao
Date: Thu Mar 22 00:51:13 2007
New Revision: 521142

URL: http://svn.apache.org/viewvc?view=rev&rev=521142
Log:
Remove duplicate ProcessorTestBase

Added:
    incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ProcessorTestBase.java
      - copied, changed from r520813, incubator/cxf/trunk/tools/wsdlto/misc/src/test/java/org/apache/cxf/tools/common/ProcessorTestBase.java
Removed:
    incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/common/
    incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/ProcessorTestBase.java
    incubator/cxf/trunk/tools/wsdlto/misc/src/test/java/org/apache/cxf/tools/common/ProcessorTestBase.java
    incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/common/
Modified:
    incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java
    incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLNoAnnoTest.java
    incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessorTest.java
    incubator/cxf/trunk/tools/wsdlto/misc/src/test/java/org/apache/cxf/tools/misc/processor/WSDLToServiceProcessorTest.java
    incubator/cxf/trunk/tools/wsdlto/misc/src/test/java/org/apache/cxf/tools/misc/processor/WSDLToSoapProcessorTest.java
    incubator/cxf/trunk/tools/wsdlto/misc/src/test/java/org/apache/cxf/tools/misc/processor/WSDLToXMLProcessorTest.java
    incubator/cxf/trunk/tools/wsdlto/misc/src/test/java/org/apache/cxf/tools/misc/processor/XSDToWSDLProcessorTest.java
    incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java
    incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenOptionTest.java
    incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java
    incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/validator/ValidatorTest.java

Copied: incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ProcessorTestBase.java
(from r520813, incubator/cxf/trunk/tools/wsdlto/misc/src/test/java/org/apache/cxf/tools/common/ProcessorTestBase.java)
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ProcessorTestBase.java?view=diff&rev=521142&p1=incubator/cxf/trunk/tools/wsdlto/misc/src/test/java/org/apache/cxf/tools/common/ProcessorTestBase.java&r1=520813&p2=incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ProcessorTestBase.java&r2=521142
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/misc/src/test/java/org/apache/cxf/tools/common/ProcessorTestBase.java
(original)
+++ incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ProcessorTestBase.java
Thu Mar 22 00:51:13 2007
@@ -20,109 +20,32 @@
 package org.apache.cxf.tools.common;
 
 import java.io.File;
+import java.net.URISyntaxException;
 import java.net.URL;
 import java.net.URLClassLoader;
-import java.util.Locale;
 
 import junit.framework.TestCase;
 
-/*import org.apache.cxf.tools.common.ProcessorEnvironment;
-import org.apache.cxf.tools.common.ToolException;*/
+import org.apache.cxf.helpers.FileUtils;
 
 public class ProcessorTestBase extends TestCase {
 
-    private static final int RETRY_SLEEP_MILLIS = 10;
     protected ToolContext env = new ToolContext();
     protected File output;
 
     public void setUp() throws Exception {
-        URL url = ProcessorTestBase.class.getResource(".");
+        URL url = getClass().getResource(".");
         output = new File(url.toURI());
         output = new File(output, "/resources");
-        mkDir(output);
+        FileUtils.mkDir(output);
     }
 
     public void tearDown() {
-        removeDir(output);
+        FileUtils.removeDir(output);
         output = null;
         env = null;
     }
 
-    private void mkDir(File dir) {
-        if (dir == null) {
-            throw new ToolException("dir attribute is required");
-        }
-
-        if (dir.isFile()) {
-            throw new ToolException("Unable to create directory as a file "
-                                    + "already exists with that name: " + dir.getAbsolutePath());
-        }
-
-        if (!dir.exists()) {
-            boolean result = doMkDirs(dir);
-            if (!result) {
-                String msg = "Directory " + dir.getAbsolutePath()
-                             + " creation was not successful for an unknown reason";
-                throw new ToolException(msg);
-            }
-        }
-    }
-
-    /**
-     * Attempt to fix possible race condition when creating directories on
-     * WinXP, also Windows2000. If the mkdirs does not work, wait a little and
-     * try again.
-     */
-    private boolean doMkDirs(File f) {
-        if (!f.mkdirs()) {
-            try {
-                Thread.sleep(RETRY_SLEEP_MILLIS);
-                return f.mkdirs();
-            } catch (InterruptedException ex) {
-                return f.mkdirs();
-            }
-        }
-        return true;
-    }
-
-    private void removeDir(File d) {
-        String[] list = d.list();
-        if (list == null) {
-            list = new String[0];
-        }
-        for (int i = 0; i < list.length; i++) {
-            String s = list[i];
-            File f = new File(d, s);
-            if (f.isDirectory()) {
-                removeDir(f);
-            } else {
-                delete(f);
-            }
-        }
-        delete(d);
-    }
-
-    private void delete(File f) {
-        if (!f.delete()) {
-            if (isWindows()) {
-                System.gc();
-            }
-            try {
-                Thread.sleep(RETRY_SLEEP_MILLIS);
-            } catch (InterruptedException ex) {
-                // Ignore Exception
-            }
-            if (!f.delete()) {
-                f.deleteOnExit();
-            }
-        }
-    }
-
-    private boolean isWindows() {
-        String osName = System.getProperty("os.name").toLowerCase(Locale.US);
-        return osName.indexOf("windows") > -1;
-    }
-
     protected String getClassPath() {
         ClassLoader loader = getClass().getClassLoader();
         StringBuffer classPath = new StringBuffer();
@@ -139,5 +62,8 @@
         }
         return classPath.toString();
     }
-
+    
+    protected String getLocation(String wsdlFile) throws URISyntaxException {
+        return getClass().getResource(wsdlFile).toString();
+    }
 }

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=521142&r1=521141&r2=521142
==============================================================================
--- 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 Mar 22 00:51:13 2007
@@ -26,6 +26,7 @@
 import javax.xml.namespace.QName;
 
 import org.apache.cxf.helpers.WSDLHelper;
+import org.apache.cxf.tools.common.ProcessorTestBase;
 import org.apache.cxf.tools.common.ToolConstants;
 import org.apache.cxf.tools.common.ToolContext;
 import org.apache.cxf.tools.common.WSDLConstants;
@@ -33,6 +34,10 @@
 public class JavaToProcessorTest extends ProcessorTestBase {
     JavaToProcessor processor = new JavaToProcessor();
     private WSDLHelper wsdlHelper = new WSDLHelper();
+    
+    public void setUp() throws Exception {
+        super.setUp();
+    }
     
     public void tearDown() {
         super.tearDown();

Modified: incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLNoAnnoTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLNoAnnoTest.java?view=diff&rev=521142&r1=521141&r2=521142
==============================================================================
--- incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLNoAnnoTest.java
(original)
+++ incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLNoAnnoTest.java
Thu Mar 22 00:51:13 2007
@@ -19,8 +19,7 @@
 
 package org.apache.cxf.tools.java2wsdl.processor;
 
-//import java.io.File;
-
+import org.apache.cxf.tools.common.ProcessorTestBase;
 import org.apache.cxf.tools.common.ToolConstants;
 
 public class JavaToWSDLNoAnnoTest extends ProcessorTestBase {

Modified: incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessorTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessorTest.java?view=diff&rev=521142&r1=521141&r2=521142
==============================================================================
--- incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessorTest.java
(original)
+++ incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessorTest.java
Thu Mar 22 00:51:13 2007
@@ -22,7 +22,6 @@
 import java.io.BufferedInputStream;
 import java.io.File;
 import java.io.FileInputStream;
-import java.net.URISyntaxException;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
@@ -42,14 +41,17 @@
 import org.apache.cxf.helpers.WSDLHelper;
 import org.apache.cxf.helpers.XMLUtils;
 import org.apache.cxf.helpers.XPathUtils;
+import org.apache.cxf.tools.common.ProcessorTestBase;
 import org.apache.cxf.tools.common.ToolConstants;
 import org.apache.cxf.tools.common.ToolException;
 import org.apache.cxf.tools.common.WSDLConstants;
 import org.apache.cxf.tools.common.extensions.soap.SoapBinding;
 import org.apache.cxf.tools.util.SOAPBindingUtil;
+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;
 
-
 public class JavaToWSDLProcessorTest extends ProcessorTestBase {
 
     private JavaToWSDLProcessor j2wProcessor;
@@ -60,7 +62,6 @@
     private File classFile;
     
     public void setUp() throws Exception {
-
         super.setUp();
         j2wProcessor = new JavaToWSDLProcessor();
         classFile = new java.io.File(output.getCanonicalPath() + "/classes");
@@ -68,6 +69,8 @@
         System.setProperty("java.class.path", getClassPath() + classFile.getCanonicalPath()
                                               + File.separatorChar);
         wj2Processor = new JAXWSContainer(null);
+        env.put(FrontEndProfile.class, PluginLoader.getInstance().getFrontEndProfile("jaxws"));
+        env.put(DataBindingProfile.class, PluginLoader.getInstance().getDataBindingProfile("jaxb"));
       
     }
 
     public void tearDown() {
@@ -412,9 +415,4 @@
             fail("Should not happen other exception " + e.getMessage());
         }
     }
-
-    private String getLocation(String wsdlFile) throws URISyntaxException {
-        return JavaToWSDLProcessorTest.class.getResource(wsdlFile).toString();
-    }
-
 }

Modified: incubator/cxf/trunk/tools/wsdlto/misc/src/test/java/org/apache/cxf/tools/misc/processor/WSDLToServiceProcessorTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/misc/src/test/java/org/apache/cxf/tools/misc/processor/WSDLToServiceProcessorTest.java?view=diff&rev=521142&r1=521141&r2=521142
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/misc/src/test/java/org/apache/cxf/tools/misc/processor/WSDLToServiceProcessorTest.java
(original)
+++ incubator/cxf/trunk/tools/wsdlto/misc/src/test/java/org/apache/cxf/tools/misc/processor/WSDLToServiceProcessorTest.java
Thu Mar 22 00:51:13 2007
@@ -20,7 +20,6 @@
 package org.apache.cxf.tools.misc.processor;
 
 import java.io.File;
-import java.net.URISyntaxException;
 import java.util.Iterator;
 
 import javax.wsdl.Service;
@@ -293,9 +292,5 @@
                      + "catch other unexpected exception!");
             }
         }
-    }
-
-    private String getLocation(String wsdlFile) throws URISyntaxException {
-        return WSDLToServiceProcessorTest.class.getResource(wsdlFile).toURI().toString();
     }
 }

Modified: incubator/cxf/trunk/tools/wsdlto/misc/src/test/java/org/apache/cxf/tools/misc/processor/WSDLToSoapProcessorTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/misc/src/test/java/org/apache/cxf/tools/misc/processor/WSDLToSoapProcessorTest.java?view=diff&rev=521142&r1=521141&r2=521142
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/misc/src/test/java/org/apache/cxf/tools/misc/processor/WSDLToSoapProcessorTest.java
(original)
+++ incubator/cxf/trunk/tools/wsdlto/misc/src/test/java/org/apache/cxf/tools/misc/processor/WSDLToSoapProcessorTest.java
Thu Mar 22 00:51:13 2007
@@ -486,9 +486,4 @@
             }
         }
     }
-
-    private String getLocation(String wsdlFile) throws Exception {
-        return WSDLToSoapProcessorTest.class.getResource(wsdlFile).toURI().toString();
-    }
-
 }

Modified: incubator/cxf/trunk/tools/wsdlto/misc/src/test/java/org/apache/cxf/tools/misc/processor/WSDLToXMLProcessorTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/misc/src/test/java/org/apache/cxf/tools/misc/processor/WSDLToXMLProcessorTest.java?view=diff&rev=521142&r1=521141&r2=521142
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/misc/src/test/java/org/apache/cxf/tools/misc/processor/WSDLToXMLProcessorTest.java
(original)
+++ incubator/cxf/trunk/tools/wsdlto/misc/src/test/java/org/apache/cxf/tools/misc/processor/WSDLToXMLProcessorTest.java
Thu Mar 22 00:51:13 2007
@@ -20,7 +20,6 @@
 package org.apache.cxf.tools.misc.processor;
 
 import java.io.File;
-import java.net.URISyntaxException;
 import java.util.Iterator;
 
 import javax.wsdl.Binding;
@@ -125,9 +124,4 @@
             fail("Exception Encountered when parsing wsdl, error: " + e.getMessage());
         }
     }
-
-    private String getLocation(String wsdlFile) throws URISyntaxException {
-        return WSDLToXMLProcessorTest.class.getResource(wsdlFile).toURI().toString();
-    }
-
 }

Modified: incubator/cxf/trunk/tools/wsdlto/misc/src/test/java/org/apache/cxf/tools/misc/processor/XSDToWSDLProcessorTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/misc/src/test/java/org/apache/cxf/tools/misc/processor/XSDToWSDLProcessorTest.java?view=diff&rev=521142&r1=521141&r2=521142
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/misc/src/test/java/org/apache/cxf/tools/misc/processor/XSDToWSDLProcessorTest.java
(original)
+++ incubator/cxf/trunk/tools/wsdlto/misc/src/test/java/org/apache/cxf/tools/misc/processor/XSDToWSDLProcessorTest.java
Thu Mar 22 00:51:13 2007
@@ -92,7 +92,7 @@
     }
 
 
-    private String getLocation(String wsdlFile) throws URISyntaxException {
+    protected String getLocation(String wsdlFile) throws URISyntaxException {
         return new File(XSDToWSDLProcessorTest.class.getResource(wsdlFile).toURI()).getAbsolutePath();
     }
 

Modified: incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java?view=diff&rev=521142&r1=521141&r2=521142
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java
(original)
+++ incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java
Thu Mar 22 00:51:13 2007
@@ -22,7 +22,6 @@
 import java.io.File;
 import java.io.FileInputStream;
 import java.lang.reflect.Modifier;
-import java.net.URISyntaxException;
 
 import javax.jws.WebService;
 
@@ -30,6 +29,9 @@
 import org.apache.cxf.tools.common.ToolConstants;
 import org.apache.cxf.tools.util.AnnotationUtil;
 import org.apache.cxf.tools.wsdlto.WSDLToJava;
+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;
 
 public class CodeGenBugTest extends ProcessorTestBase {
@@ -46,6 +48,10 @@
         classLoader = AnnotationUtil.getClassLoader(Thread.currentThread().getContextClassLoader());
         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_IMPL, "impl");
+        env.put(ToolConstants.CFG_OUTPUTDIR, output.getCanonicalPath());
 
         processor = new JAXWSContainer(null);
 
@@ -311,15 +317,10 @@
         processor.setContext(env);
         processor.execute();      
     }
-    
-    public void testWsdlNoService() throws Exception {      
+
+	public void testWsdlNoService() throws Exception {      
         env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/helloworld_withnoservice.wsdl"));
         processor.setContext(env);
-        processor.execute();      
-    }
-    
-    
-    private String getLocation(String wsdlFile) throws URISyntaxException {
-        return this.getClass().getResource(wsdlFile).toString();
+        processor.execute();
     }
 }

Modified: incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenOptionTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenOptionTest.java?view=diff&rev=521142&r1=521141&r2=521142
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenOptionTest.java
(original)
+++ incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenOptionTest.java
Thu Mar 22 00:51:13 2007
@@ -19,11 +19,13 @@
 package org.apache.cxf.tools.wsdlto.jaxws;
 
 import java.io.File;
-import java.net.URISyntaxException;
 
 import org.apache.cxf.tools.common.ProcessorTestBase;
 import org.apache.cxf.tools.common.ToolConstants;
 import org.apache.cxf.tools.util.AnnotationUtil;
+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;
 
 public class CodeGenOptionTest extends ProcessorTestBase {
@@ -39,6 +41,10 @@
         classLoader = AnnotationUtil.getClassLoader(Thread.currentThread().getContextClassLoader());
         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_IMPL, "impl");
+        env.put(ToolConstants.CFG_OUTPUTDIR, output.getCanonicalPath());
 
         processor = new JAXWSContainer(null); 
 
@@ -98,10 +104,4 @@
         assertEquals(3, clz.getMethods().length);
 
     }
-    
-    private String getLocation(String wsdlFile) throws URISyntaxException {
-        return this.getClass().getResource(wsdlFile).toURI().getPath();
-    }
-    
-    
 }

Modified: incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java?view=diff&rev=521142&r1=521141&r2=521142
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java
(original)
+++ incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java
Thu Mar 22 00:51:13 2007
@@ -24,7 +24,6 @@
 import java.lang.reflect.Modifier;
 import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Type;
-import java.net.URISyntaxException;
 
 import javax.jws.HandlerChain;
 import javax.jws.Oneway;
@@ -41,6 +40,9 @@
 import org.apache.cxf.tools.common.ProcessorTestBase;
 import org.apache.cxf.tools.common.ToolConstants;
 import org.apache.cxf.tools.util.AnnotationUtil;
+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;
 
 public class CodeGenTest extends ProcessorTestBase {
@@ -56,10 +58,12 @@
         classLoader = AnnotationUtil.getClassLoader(Thread.currentThread().getContextClassLoader());
         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_IMPL, "impl");
+        env.put(ToolConstants.CFG_OUTPUTDIR, output.getCanonicalPath());
 
         processor = new JAXWSContainer(null);
-
-
     }
 
     public void tearDown() {
@@ -807,10 +811,5 @@
         WebFault webFault = AnnotationUtil.getPrivClassAnnotation(cls, WebFault.class);
         assertEquals("http://www.w3.org/2001/XMLSchema", webFault.targetNamespace());
 
-    }
-
-
-    private String getLocation(String wsdlFile) throws URISyntaxException {
-        return this.getClass().getResource(wsdlFile).toString();
     }
 }

Modified: incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/validator/ValidatorTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/validator/ValidatorTest.java?view=diff&rev=521142&r1=521141&r2=521142
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/validator/ValidatorTest.java
(original)
+++ incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/validator/ValidatorTest.java
Thu Mar 22 00:51:13 2007
@@ -21,6 +21,9 @@
 import org.apache.cxf.tools.common.ProcessorTestBase;
 import org.apache.cxf.tools.common.ToolConstants;
 import org.apache.cxf.tools.wsdlto.WSDLToJavaContainer;
+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;
     
 public class ValidatorTest extends ProcessorTestBase {
@@ -29,6 +32,8 @@
     public void setUp() throws Exception {
         super.setUp();
         env.put(ToolConstants.CFG_VERBOSE, ToolConstants.CFG_VERBOSE);
+        env.put(FrontEndProfile.class, PluginLoader.getInstance().getFrontEndProfile("jaxws"));
+        env.put(DataBindingProfile.class, PluginLoader.getInstance().getDataBindingProfile("jaxb"));
         //env.put(ToolConstants.CFG_VALIDATE_WSDL, ToolConstants.CFG_VALIDATE_WSDL);
     }
     
@@ -47,9 +52,4 @@
 
         // TODO 3: change the jaxwscontainer to jaxws_wsdl_to_java_processor, so we can catch
the exception
     }
-    
-    private String getLocation(String wsdlFile) {
-        return this.getClass().getResource(wsdlFile).getFile();
-    }
-
 }



Mime
View raw message