You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@axis.apache.org by ve...@apache.org on 2012/02/22 22:41:38 UTC

svn commit: r1292527 - in /axis/axis1/java/trunk: integration/ integration/src/main/java/test/wsdl/gateway/ integration/src/test/java/test/wsdl/gateway/ maven/maven-java2wsdl-plugin/src/main/java/org/apache/axis/maven/java2wsdl/ test/wsdl/gateway/

Author: veithen
Date: Wed Feb 22 21:41:37 2012
New Revision: 1292527

URL: http://svn.apache.org/viewvc?rev=1292527&view=rev
Log:
Mavenized test.wsdl.gateway.

Added:
    axis/axis1/java/trunk/integration/src/main/java/test/wsdl/gateway/
    axis/axis1/java/trunk/integration/src/main/java/test/wsdl/gateway/Gateway.java
      - copied unchanged from r1291001, axis/axis1/java/trunk/test/wsdl/gateway/Gateway.java
    axis/axis1/java/trunk/integration/src/main/java/test/wsdl/gateway/MyClass.java
      - copied unchanged from r1291001, axis/axis1/java/trunk/test/wsdl/gateway/MyClass.java
    axis/axis1/java/trunk/integration/src/main/java/test/wsdl/gateway/OutClass.java
      - copied unchanged from r1291001, axis/axis1/java/trunk/test/wsdl/gateway/OutClass.java
    axis/axis1/java/trunk/integration/src/test/java/test/wsdl/gateway/
    axis/axis1/java/trunk/integration/src/test/java/test/wsdl/gateway/GatewayServiceTestCase.java
      - copied unchanged from r1291001, axis/axis1/java/trunk/test/wsdl/gateway/GatewayServiceTestCase.java
    axis/axis1/java/trunk/integration/src/test/java/test/wsdl/gateway/GatewaySoapBindingImpl.java
      - copied unchanged from r1291001, axis/axis1/java/trunk/test/wsdl/gateway/GatewaySoapBindingImpl.java
Removed:
    axis/axis1/java/trunk/test/wsdl/gateway/
Modified:
    axis/axis1/java/trunk/integration/pom.xml
    axis/axis1/java/trunk/maven/maven-java2wsdl-plugin/src/main/java/org/apache/axis/maven/java2wsdl/AbstractGenerateWsdlMojo.java

Modified: axis/axis1/java/trunk/integration/pom.xml
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/integration/pom.xml?rev=1292527&r1=1292526&r2=1292527&view=diff
==============================================================================
--- axis/axis1/java/trunk/integration/pom.xml (original)
+++ axis/axis1/java/trunk/integration/pom.xml Wed Feb 22 21:41:37 2012
@@ -116,6 +116,29 @@
                         </configuration>
                     </execution>
                     <execution>
+                        <id>gateway</id>
+                        <goals>
+                            <goal>generate-wsdl</goal>
+                        </goals>
+                        <phase>process-classes</phase>
+                        <configuration>
+                            <output>${project.build.directory}/work/test/wsdl/gateway/Gateway.wsdl</output>
+                            <className>test.wsdl.gateway.Gateway</className>
+                            <extraClasses>
+                                <extraClass>test.wsdl.gateway.MyClass</extraClass>
+                                <extraClass>test.wsdl.gateway.OutClass</extraClass>
+                            </extraClasses>
+                            <namespace>http://test.com/gateway</namespace>
+                            <location>http://localhost:8080/axis/services/Gateway</location>
+                            <mappings>
+                                <mapping>
+                                    <package>test.wsdl.gateway</package>
+                                    <namespace>http://test.com/gateway</namespace>
+                                </mapping>
+                            </mappings>
+                        </configuration>
+                    </execution>
+                    <execution>
                         <id>map</id>
                         <goals>
                             <goal>generate-wsdl</goal>
@@ -555,6 +578,23 @@
                             </mappings>
                         </configuration>
                     </execution>
+                    <execution>
+                        <id>gateway</id>
+                        <goals>
+                            <goal>wsdl2java-test</goal>
+                        </goals>
+                        <configuration>
+                            <file>${project.build.directory}/work/test/wsdl/gateway/Gateway.wsdl</file>
+                            <serverSide>true</serverSide>
+                            <all>true</all>
+                            <mappings>
+                                <mapping>
+                                    <namespace>http://test.com/gateway</namespace>
+                                    <package>test.wsdl.gateway</package>
+                                </mapping>
+                            </mappings>
+                        </configuration>
+                    </execution>
                     <!-- This tests the getPort method in generated services.  -->
                     <execution>
                         <id>getPort</id>

Modified: axis/axis1/java/trunk/maven/maven-java2wsdl-plugin/src/main/java/org/apache/axis/maven/java2wsdl/AbstractGenerateWsdlMojo.java
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/maven/maven-java2wsdl-plugin/src/main/java/org/apache/axis/maven/java2wsdl/AbstractGenerateWsdlMojo.java?rev=1292527&r1=1292526&r2=1292527&view=diff
==============================================================================
--- axis/axis1/java/trunk/maven/maven-java2wsdl-plugin/src/main/java/org/apache/axis/maven/java2wsdl/AbstractGenerateWsdlMojo.java (original)
+++ axis/axis1/java/trunk/maven/maven-java2wsdl-plugin/src/main/java/org/apache/axis/maven/java2wsdl/AbstractGenerateWsdlMojo.java Wed Feb 22 21:41:37 2012
@@ -33,6 +33,7 @@ import org.apache.maven.plugin.AbstractM
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
 import org.apache.maven.project.MavenProject;
+import org.codehaus.plexus.util.StringUtils;
 
 import com.github.veithen.ulog.PlexusLoggerInjector;
 
@@ -62,6 +63,13 @@ public abstract class AbstractGenerateWs
     private String className;
 
     /**
+     * A list of classes to include in the schema generation.
+     * 
+     * @parameter
+     */
+    private String[] extraClasses;
+    
+    /**
      * The target namespace for the interface.
      * 
      * @parameter
@@ -131,8 +139,14 @@ public abstract class AbstractGenerateWs
                 throw new MojoExecutionException("Unexpected exception", ex);
             }
         }
+        ClassLoader cl = new URLClassLoader(urls);
         // TODO: this will likely make the plugin non thread safe
-        ClassUtils.setDefaultClassLoader(new URLClassLoader(urls));
+        ClassUtils.setDefaultClassLoader(cl);
+        if (extraClasses != null) {
+            for (int i=0; i<extraClasses.length; i++) {
+                ClassUtils.setClassLoader(extraClasses[i], cl);
+            }
+        }
         try {
             Emitter emitter = new Emitter();
             if (mappings != null && mappings.length > 0) {
@@ -143,6 +157,13 @@ public abstract class AbstractGenerateWs
             } catch (ClassNotFoundException ex) {
                 throw new MojoFailureException("Class " + className + " not found");
             }
+            if (extraClasses != null) {
+                try {
+                    emitter.setExtraClasses(StringUtils.join(extraClasses, ","));
+                } catch (ClassNotFoundException ex) {
+                    throw new MojoExecutionException("Extra class not found: " + ex.getMessage());
+                }
+            }
             if (style != null) {
                 emitter.setStyle(style);
             }