Author: veithen
Date: Sat Sep 29 16:26:51 2012
New Revision: 1391833

URL: http://svn.apache.org/viewvc?rev=1391833&view=rev
Log:
Added a writeStubToTestSources option to maven-wsdl2java-plugin for use in 
projects that don't need to include client-side artifacts in the project 
output, but still require them in the test cases.

Added:
    axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/it/
    axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/it/settings.xml   
(with props)
    
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/it/writeStubToTestSources/
    
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/it/writeStubToTestSources/pom.xml
   (with props)
    
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/it/writeStubToTestSources/src/
    
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/it/writeStubToTestSources/src/main/
    
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/it/writeStubToTestSources/src/main/wsdl/
    
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/it/writeStubToTestSources/src/main/wsdl/AddData.wsdl
    
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/it/writeStubToTestSources/verify.bsh
    
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaServiceIfaceWriterEx.java
   (with props)
    
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaServiceImplWriterEx.java
   (with props)
    
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaServiceWriterEx.java
   (with props)
    
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaStubWriterEx.java
   (with props)
    
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaTestCaseWriterEx.java
   (with props)
Modified:
    axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/pom.xml
    
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/AbstractWsdl2JavaMojo.java
    
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/EmitterEx.java
    
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/GenerateSourcesMojo.java
    
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/GenerateTestSourcesMojo.java
    
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaBindingWriterEx.java
    
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaGeneratorFactoryEx.java
    axis/axis1/java/trunk/pom.xml

Modified: axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/pom.xml
URL: 
http://svn.apache.org/viewvc/axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/pom.xml?rev=1391833&r1=1391832&r2=1391833&view=diff
==============================================================================
--- axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/pom.xml (original)
+++ axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/pom.xml Sat Sep 29 
16:26:51 2012
@@ -61,6 +61,37 @@
             <artifactId>ulog</artifactId>
         </dependency>
     </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <artifactId>maven-invoker-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>integration-test</id>
+                        <goals>
+                            <goal>install</goal>
+                            <goal>run</goal>
+                        </goals>
+                        <configuration>
+                            <projectsDirectory>src/it</projectsDirectory>
+                            
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
+                            <pomIncludes>
+                                <pomInclude>*/pom.xml</pomInclude>
+                            </pomIncludes>
+                            <preBuildHookScript>setup</preBuildHookScript>
+                            <postBuildHookScript>verify</postBuildHookScript>
+                            
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
+                            <settingsFile>src/it/settings.xml</settingsFile>
+                            <goals>
+                                <goal>clean</goal>
+                                <goal>install</goal>
+                            </goals>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
     <reporting>
         <plugins>
             <plugin>

Added: axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/it/settings.xml
URL: 
http://svn.apache.org/viewvc/axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/it/settings.xml?rev=1391833&view=auto
==============================================================================
--- axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/it/settings.xml 
(added)
+++ axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/it/settings.xml Sat 
Sep 29 16:26:51 2012
@@ -0,0 +1,53 @@
+<?xml version="1.0"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements. See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership. The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License. You may obtain a copy of the License at
+  ~
+  ~ http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied. See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+<settings>
+  <profiles>
+    <profile>
+      <id>it-repo</id>
+      <activation>
+        <activeByDefault>true</activeByDefault>
+      </activation>
+      <repositories>
+        <repository>
+          <id>local.central</id>
+          <url>@localRepositoryUrl@</url>
+          <releases>
+            <enabled>true</enabled>
+          </releases>
+          <snapshots>
+            <enabled>true</enabled>
+          </snapshots>
+        </repository>
+      </repositories>
+      <pluginRepositories>
+        <pluginRepository>
+          <id>local.central</id>
+          <url>@localRepositoryUrl@</url>
+          <releases>
+            <enabled>true</enabled>
+          </releases>
+          <snapshots>
+            <enabled>true</enabled>
+          </snapshots>
+        </pluginRepository>
+      </pluginRepositories>
+    </profile>
+  </profiles>
+</settings>

Propchange: 
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/it/settings.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/it/writeStubToTestSources/pom.xml
URL: 
http://svn.apache.org/viewvc/axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/it/writeStubToTestSources/pom.xml?rev=1391833&view=auto
==============================================================================
--- 
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/it/writeStubToTestSources/pom.xml
 (added)
+++ 
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/it/writeStubToTestSources/pom.xml
 Sat Sep 29 16:26:51 2012
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements. See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership. The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License. You may obtain a copy of the License at
+  ~
+  ~ http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied. See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>test</groupId>
+    <artifactId>writeStubToTestSources</artifactId>
+    <version>1</version>
+    <dependencies>
+        <dependency>
+            <groupId>@project.groupId@</groupId>
+            <artifactId>axis</artifactId>
+            <version>@project.version@</version>
+        </dependency>
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>@project.groupId@</groupId>
+                <artifactId>maven-wsdl2java-plugin</artifactId>
+                <version>@project.version@</version>
+                <executions>
+                    <execution>
+                        <id>gen-sources</id>
+                        <goals>
+                            <goal>generate-sources</goal>
+                        </goals>
+                        <configuration>
+                            <file>src/main/wsdl/AddData.wsdl</file>
+                            <generate>both</generate>
+                            
<writeStubToTestSources>true</writeStubToTestSources>
+                            <mappings>
+                                <mapping>
+                                    
<namespace>http://www.example.org/AddData/</namespace>
+                                    <package>test</package>
+                                </mapping>
+                            </mappings>
+                            
<deployWsdd>${project.build.directory}/wsdd/deploy.wsdd</deployWsdd>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>

Propchange: 
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/it/writeStubToTestSources/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/it/writeStubToTestSources/src/main/wsdl/AddData.wsdl
URL: 
http://svn.apache.org/viewvc/axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/it/writeStubToTestSources/src/main/wsdl/AddData.wsdl?rev=1391833&view=auto
==============================================================================
--- 
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/it/writeStubToTestSources/src/main/wsdl/AddData.wsdl
 (added)
+++ 
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/it/writeStubToTestSources/src/main/wsdl/AddData.wsdl
 Sat Sep 29 16:26:51 2012
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements. See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership. The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License. You may obtain a copy of the License at
+  ~
+  ~ http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied. See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"; 
xmlns:tns="http://www.example.org/AddData/"; 
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; name="AddData" 
targetNamespace="http://www.example.org/AddData/";>
+  <wsdl:types>
+    <xsd:schema targetNamespace="http://www.example.org/AddData/";>
+      <xsd:element name="AddData">
+        <xsd:complexType>
+          <xsd:sequence>
+            <xsd:element name="Dummy" type="xsd:string"/>
+            <xsd:element name="Data" type="tns:data" minOccurs="0" 
maxOccurs="unbounded"/>
+          </xsd:sequence>
+        </xsd:complexType>
+      </xsd:element>
+        <xsd:complexType name="data">
+            <xsd:sequence>
+                <xsd:element name="FirstName" type="xsd:string"/>
+                <xsd:element name="LastName" type="xsd:string"/>
+                <xsd:element name="Age" type="xsd:int"/>
+            </xsd:sequence>
+        </xsd:complexType>
+      <xsd:element name="AddDataResponse">
+        <xsd:complexType>
+          <xsd:sequence/>
+        </xsd:complexType>
+      </xsd:element>
+    </xsd:schema>
+  </wsdl:types>
+  <wsdl:message name="AddDataRequest">
+    <wsdl:part element="tns:AddData" name="parameters"/>
+  </wsdl:message>
+  <wsdl:message name="AddDataResponse">
+    <wsdl:part element="tns:AddDataResponse" name="parameters"/>
+  </wsdl:message>
+  <wsdl:portType name="AddData">
+    <wsdl:operation name="AddData">
+      <wsdl:input message="tns:AddDataRequest"/>
+      <wsdl:output message="tns:AddDataResponse"/>
+    </wsdl:operation>
+  </wsdl:portType>
+  <wsdl:binding name="AddDataSOAP" type="tns:AddData">
+    <soap:binding style="document" 
transport="http://schemas.xmlsoap.org/soap/http"/>
+    <wsdl:operation name="AddData">
+      <soap:operation soapAction="http://www.example.org/AddData/AddData"/>
+      <wsdl:input>
+        <soap:body use="literal"/>
+      </wsdl:input>
+      <wsdl:output>
+        <soap:body use="literal"/>
+      </wsdl:output>
+    </wsdl:operation>
+  </wsdl:binding>
+  <wsdl:service name="AddData">
+    <wsdl:port binding="tns:AddDataSOAP" name="AddDataSOAP">
+      <soap:address location="http://www.example.org/"/>
+    </wsdl:port>
+  </wsdl:service>
+</wsdl:definitions>

Added: 
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/it/writeStubToTestSources/verify.bsh
URL: 
http://svn.apache.org/viewvc/axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/it/writeStubToTestSources/verify.bsh?rev=1391833&view=auto
==============================================================================
--- 
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/it/writeStubToTestSources/verify.bsh
 (added)
+++ 
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/it/writeStubToTestSources/verify.bsh
 Sat Sep 29 16:26:51 2012
@@ -0,0 +1,20 @@
+import java.io.*;
+
+String[] wanted = {
+    "target/generated-sources/wsdl2java/test/AddData_PortType.java",
+    "target/generated-sources/wsdl2java/test/Data.java",
+    "target/generated-test-sources/wsdl2java/test/AddData_Service.java",
+    "target/generated-test-sources/wsdl2java/test/AddData_ServiceLocator.java",
+    "target/generated-test-sources/wsdl2java/test/AddDataSOAPStub.java",
+    "target/classes/test/AddData_PortType.class",
+    "target/classes/test/Data.class",
+    "target/test-classes/test/AddData_Service.class",
+    "target/test-classes/test/AddData_ServiceLocator.class",
+    "target/test-classes/test/AddDataSOAPStub.class",
+};
+
+for (String path : wanted) {
+    if (!new File(basedir, path).exists()) {
+        throw new IllegalStateException("wanted path is missing: " + path);
+    }
+}

Modified: 
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/AbstractWsdl2JavaMojo.java
URL: 
http://svn.apache.org/viewvc/axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/AbstractWsdl2JavaMojo.java?rev=1391833&r1=1391832&r2=1391833&view=diff
==============================================================================
--- 
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/AbstractWsdl2JavaMojo.java
 (original)
+++ 
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/AbstractWsdl2JavaMojo.java
 Sat Sep 29 16:26:51 2012
@@ -252,7 +252,6 @@ public abstract class AbstractWsdl2JavaM
 //        emitter.setProperties(properties);
 //        emitter.setImports(!noImports);
         emitter.setAllWanted(all);
-        emitter.setOutputDir(getSourceOutputDirectory().getAbsolutePath());
         emitter.setSkeletonWanted(skeleton);
 //        emitter.setVerbose(verbose);
 //        emitter.setDebug(debug);
@@ -306,10 +305,9 @@ public abstract class AbstractWsdl2JavaM
             throw new MojoFailureException("wsdl2java failed", ex);
         }
         
-        addSourceRoot(project, getSourceOutputDirectory().getAbsolutePath());
+        addSourceRoot(project);
     }
     
-    protected abstract File getSourceOutputDirectory();
     protected abstract void configureEmitter(EmitterEx emitter);
-    protected abstract void addSourceRoot(MavenProject project, String path);
+    protected abstract void addSourceRoot(MavenProject project);
 }

Modified: 
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/EmitterEx.java
URL: 
http://svn.apache.org/viewvc/axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/EmitterEx.java?rev=1391833&r1=1391832&r2=1391833&view=diff
==============================================================================
--- 
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/EmitterEx.java
 (original)
+++ 
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/EmitterEx.java
 Sat Sep 29 16:26:51 2012
@@ -23,6 +23,7 @@ import org.apache.axis.wsdl.toJava.Emitt
 public class EmitterEx extends Emitter {
     private boolean clientSide;
     private boolean generateImplementation;
+    private String clientOutputDirectory;
     private String deployWsdd;
     private String undeployWsdd;
     
@@ -42,6 +43,14 @@ public class EmitterEx extends Emitter {
         this.generateImplementation = generateImplementation;
     }
 
+    public String getClientOutputDirectory() {
+        return clientOutputDirectory;
+    }
+
+    public void setClientOutputDirectory(String clientOutputDirectory) {
+        this.clientOutputDirectory = clientOutputDirectory;
+    }
+
     public String getDeployWsdd() {
         return deployWsdd;
     }

Modified: 
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/GenerateSourcesMojo.java
URL: 
http://svn.apache.org/viewvc/axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/GenerateSourcesMojo.java?rev=1391833&r1=1391832&r2=1391833&view=diff
==============================================================================
--- 
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/GenerateSourcesMojo.java
 (original)
+++ 
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/GenerateSourcesMojo.java
 Sat Sep 29 16:26:51 2012
@@ -35,12 +35,31 @@ public class GenerateSourcesMojo extends
      * @parameter 
default-value="${project.build.directory}/generated-sources/wsdl2java"
      */
     private File sourceOutputDirectory;
-
-    protected File getSourceOutputDirectory() {
-        return sourceOutputDirectory;
-    }
+    
+    /**
+     * Flag indicating whether the stub and locator should be written to
+     * {@link #sourceOutputDirectory} (<code>false</code>) or to {@link 
#testSourceOutputDirectory}
+     * (<code>false</code>). Set this parameter to <code>true</code> if the 
main artifact of your
+     * project should not contain client-side code, but you need it in your 
test cases. Note that
+     * this parameter is only meaningful if <code>generate</code> is set to 
<code>both</code>.
+     * 
+     * @parameter default-value="false"
+     */
+    private boolean writeStubToTestSources;
+    
+    /**
+     * Output directory used for the stub and locator if {@link 
#writeStubToTestSources} is
+     * <code>true</code>.
+     * 
+     * @parameter 
default-value="${project.build.directory}/generated-test-sources/wsdl2java"
+     */
+    private File testSourceOutputDirectory;
 
     protected void configureEmitter(EmitterEx emitter) {
+        emitter.setOutputDir(sourceOutputDirectory.getAbsolutePath());
+        if (writeStubToTestSources) {
+            
emitter.setClientOutputDirectory(testSourceOutputDirectory.getAbsolutePath());
+        }
         // In a Maven build, generated sources are always written to a 
directory other than
         // the source directory. By default, the emitter would generate an 
empty implementation
         // because it doesn't see the implementation provided by the 
developer. We don't want this
@@ -49,7 +68,10 @@ public class GenerateSourcesMojo extends
         emitter.setGenerateImplementation(false);
     }
 
-    protected void addSourceRoot(MavenProject project, String path) {
-        project.addCompileSourceRoot(path);
+    protected void addSourceRoot(MavenProject project) {
+        project.addCompileSourceRoot(sourceOutputDirectory.getAbsolutePath());
+        if (writeStubToTestSources) {
+            
project.addTestCompileSourceRoot(testSourceOutputDirectory.getAbsolutePath());
+        }
     }
 }

Modified: 
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/GenerateTestSourcesMojo.java
URL: 
http://svn.apache.org/viewvc/axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/GenerateTestSourcesMojo.java?rev=1391833&r1=1391832&r2=1391833&view=diff
==============================================================================
--- 
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/GenerateTestSourcesMojo.java
 (original)
+++ 
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/GenerateTestSourcesMojo.java
 Sat Sep 29 16:26:51 2012
@@ -36,10 +36,6 @@ public class GenerateTestSourcesMojo ext
      */
     private File testSourceOutputDirectory;
 
-    protected File getSourceOutputDirectory() {
-        return testSourceOutputDirectory;
-    }
-
     /**
      * Flag indicating whether a default (empty) implementation should be 
generated.
      * 
@@ -55,11 +51,12 @@ public class GenerateTestSourcesMojo ext
     private boolean testCase;
     
     protected void configureEmitter(EmitterEx emitter) {
+        emitter.setOutputDir(testSourceOutputDirectory.getAbsolutePath());
         emitter.setGenerateImplementation(implementation);
         emitter.setTestCaseWanted(testCase);
     }
 
-    protected void addSourceRoot(MavenProject project, String path) {
-        project.addTestCompileSourceRoot(path);
+    protected void addSourceRoot(MavenProject project) {
+        
project.addTestCompileSourceRoot(testSourceOutputDirectory.getAbsolutePath());
     }
 }

Modified: 
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaBindingWriterEx.java
URL: 
http://svn.apache.org/viewvc/axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaBindingWriterEx.java?rev=1391833&r1=1391832&r2=1391833&view=diff
==============================================================================
--- 
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaBindingWriterEx.java
 (original)
+++ 
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaBindingWriterEx.java
 Sat Sep 29 16:26:51 2012
@@ -34,7 +34,7 @@ public class JavaBindingWriterEx extends
 
     protected Generator getJavaStubWriter(Emitter emitter, BindingEntry 
bEntry, SymbolTable st) {
         if (((EmitterEx)emitter).isClientSide()) {
-            return super.getJavaStubWriter(emitter, bEntry, st);
+            return new JavaStubWriterEx(emitter, bEntry, st);
         } else {
             return new NoopGenerator();
         }

Modified: 
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaGeneratorFactoryEx.java
URL: 
http://svn.apache.org/viewvc/axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaGeneratorFactoryEx.java?rev=1391833&r1=1391832&r2=1391833&view=diff
==============================================================================
--- 
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaGeneratorFactoryEx.java
 (original)
+++ 
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaGeneratorFactoryEx.java
 Sat Sep 29 16:26:51 2012
@@ -25,6 +25,7 @@ import javax.wsdl.Service;
 import org.apache.axis.wsdl.gen.Generator;
 import org.apache.axis.wsdl.gen.NoopGenerator;
 import org.apache.axis.wsdl.symbolTable.BindingEntry;
+import org.apache.axis.wsdl.symbolTable.ServiceEntry;
 import org.apache.axis.wsdl.symbolTable.SymbolTable;
 import org.apache.axis.wsdl.toJava.Emitter;
 import org.apache.axis.wsdl.toJava.JavaDefinitionWriter;
@@ -46,8 +47,11 @@ public class JavaGeneratorFactoryEx exte
     }
 
     public Generator getGenerator(Service service, SymbolTable symbolTable) {
-        if (((EmitterEx)emitter).isClientSide()) {
-            return super.getGenerator(service, symbolTable);
+        if (((EmitterEx)emitter).isClientSide() && 
include(service.getQName())) {
+            Generator writer = new JavaServiceWriterEx(emitter, service, 
symbolTable);
+            ServiceEntry sEntry = 
symbolTable.getServiceEntry(service.getQName());
+            serviceWriters.addStuff(writer, sEntry, symbolTable);
+            return serviceWriters;
         } else {
             return new NoopGenerator();
         }

Added: 
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaServiceIfaceWriterEx.java
URL: 
http://svn.apache.org/viewvc/axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaServiceIfaceWriterEx.java?rev=1391833&view=auto
==============================================================================
--- 
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaServiceIfaceWriterEx.java
 (added)
+++ 
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaServiceIfaceWriterEx.java
 Sat Sep 29 16:26:51 2012
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axis.tools.maven.wsdl2java;
+
+import java.io.File;
+
+import org.apache.axis.wsdl.symbolTable.ServiceEntry;
+import org.apache.axis.wsdl.symbolTable.SymbolTable;
+import org.apache.axis.wsdl.toJava.Emitter;
+import org.apache.axis.wsdl.toJava.JavaServiceIfaceWriter;
+
+public class JavaServiceIfaceWriterEx extends JavaServiceIfaceWriter {
+    public JavaServiceIfaceWriterEx(Emitter emitter, ServiceEntry sEntry, 
SymbolTable symbolTable) {
+        super(emitter, sEntry, symbolTable);
+    }
+
+    protected String getFileName() {
+        String clientOutputDirectory = 
((EmitterEx)emitter).getClientOutputDirectory();
+        if (clientOutputDirectory == null) {
+            return super.getFileName();
+        } else {
+            return clientOutputDirectory + File.separator + 
packageName.replaceAll("\\.", File.separator) + File.separator + className + 
".java";
+        }
+    }
+}

Propchange: 
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaServiceIfaceWriterEx.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaServiceImplWriterEx.java
URL: 
http://svn.apache.org/viewvc/axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaServiceImplWriterEx.java?rev=1391833&view=auto
==============================================================================
--- 
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaServiceImplWriterEx.java
 (added)
+++ 
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaServiceImplWriterEx.java
 Sat Sep 29 16:26:51 2012
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axis.tools.maven.wsdl2java;
+
+import java.io.File;
+
+import org.apache.axis.wsdl.symbolTable.ServiceEntry;
+import org.apache.axis.wsdl.symbolTable.SymbolTable;
+import org.apache.axis.wsdl.toJava.Emitter;
+import org.apache.axis.wsdl.toJava.JavaServiceImplWriter;
+
+public class JavaServiceImplWriterEx extends JavaServiceImplWriter {
+    public JavaServiceImplWriterEx(Emitter emitter, ServiceEntry sEntry, 
SymbolTable symbolTable) {
+        super(emitter, sEntry, symbolTable);
+    }
+
+    protected String getFileName() {
+        String clientOutputDirectory = 
((EmitterEx)emitter).getClientOutputDirectory();
+        if (clientOutputDirectory == null) {
+            return super.getFileName();
+        } else {
+            return clientOutputDirectory + File.separator + 
packageName.replaceAll("\\.", File.separator) + File.separator + className + 
".java";
+        }
+    }
+}

Propchange: 
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaServiceImplWriterEx.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaServiceWriterEx.java
URL: 
http://svn.apache.org/viewvc/axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaServiceWriterEx.java?rev=1391833&view=auto
==============================================================================
--- 
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaServiceWriterEx.java
 (added)
+++ 
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaServiceWriterEx.java
 Sat Sep 29 16:26:51 2012
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axis.tools.maven.wsdl2java;
+
+import javax.wsdl.Service;
+
+import org.apache.axis.wsdl.symbolTable.ServiceEntry;
+import org.apache.axis.wsdl.symbolTable.SymbolTable;
+import org.apache.axis.wsdl.toJava.Emitter;
+import org.apache.axis.wsdl.toJava.JavaServiceWriter;
+
+public class JavaServiceWriterEx extends JavaServiceWriter {
+    public JavaServiceWriterEx(Emitter emitter, Service service, SymbolTable 
symbolTable) {
+        super(emitter, service, symbolTable);
+    }
+
+    protected void setGenerators() {
+        ServiceEntry sEntry = symbolTable.getServiceEntry(service.getQName());
+        if (sEntry.isReferenced()) {
+            serviceIfaceWriter = new JavaServiceIfaceWriterEx(emitter, sEntry, 
symbolTable);
+            serviceImplWriter = new JavaServiceImplWriterEx(emitter, sEntry, 
symbolTable);
+            if (emitter.isTestCaseWanted()) {
+                testCaseWriter = new JavaTestCaseWriterEx(emitter, sEntry, 
symbolTable);
+            }
+        }
+    }
+}

Propchange: 
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaServiceWriterEx.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaStubWriterEx.java
URL: 
http://svn.apache.org/viewvc/axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaStubWriterEx.java?rev=1391833&view=auto
==============================================================================
--- 
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaStubWriterEx.java
 (added)
+++ 
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaStubWriterEx.java
 Sat Sep 29 16:26:51 2012
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axis.tools.maven.wsdl2java;
+
+import java.io.File;
+
+import org.apache.axis.wsdl.symbolTable.BindingEntry;
+import org.apache.axis.wsdl.symbolTable.SymbolTable;
+import org.apache.axis.wsdl.toJava.Emitter;
+import org.apache.axis.wsdl.toJava.JavaStubWriter;
+
+public class JavaStubWriterEx extends JavaStubWriter {
+    public JavaStubWriterEx(Emitter emitter, BindingEntry bEntry, SymbolTable 
symbolTable) {
+        super(emitter, bEntry, symbolTable);
+    }
+
+    protected String getFileName() {
+        String clientOutputDirectory = 
((EmitterEx)emitter).getClientOutputDirectory();
+        if (clientOutputDirectory == null) {
+            return super.getFileName();
+        } else {
+            return clientOutputDirectory + File.separator + 
packageName.replaceAll("\\.", File.separator) + File.separator + className + 
".java";
+        }
+    }
+}

Propchange: 
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaStubWriterEx.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaTestCaseWriterEx.java
URL: 
http://svn.apache.org/viewvc/axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaTestCaseWriterEx.java?rev=1391833&view=auto
==============================================================================
--- 
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaTestCaseWriterEx.java
 (added)
+++ 
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaTestCaseWriterEx.java
 Sat Sep 29 16:26:51 2012
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axis.tools.maven.wsdl2java;
+
+import org.apache.axis.wsdl.symbolTable.ServiceEntry;
+import org.apache.axis.wsdl.symbolTable.SymbolTable;
+import org.apache.axis.wsdl.toJava.Emitter;
+import org.apache.axis.wsdl.toJava.JavaTestCaseWriter;
+
+public class JavaTestCaseWriterEx extends JavaTestCaseWriter {
+    public JavaTestCaseWriterEx(Emitter emitter, ServiceEntry sEntry, 
SymbolTable symbolTable) {
+        super(emitter, sEntry, symbolTable);
+    }
+}

Propchange: 
axis/axis1/java/trunk/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaTestCaseWriterEx.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: axis/axis1/java/trunk/pom.xml
URL: 
http://svn.apache.org/viewvc/axis/axis1/java/trunk/pom.xml?rev=1391833&r1=1391832&r2=1391833&view=diff
==============================================================================
--- axis/axis1/java/trunk/pom.xml (original)
+++ axis/axis1/java/trunk/pom.xml Sat Sep 29 16:26:51 2012
@@ -168,6 +168,10 @@
                     <artifactId>build-helper-maven-plugin</artifactId>
                     <version>1.7</version>
                 </plugin>
+                <plugin>
+                    <artifactId>maven-invoker-plugin</artifactId>
+                    <version>1.7</version>
+                </plugin>
             </plugins>
         </pluginManagement>
     </build>


Reply via email to