Author: veithen
Date: Thu Nov 15 13:13:12 2012
New Revision: 1409766

URL: http://svn.apache.org/viewvc?rev=1409766&view=rev
Log:
AXIS2-5417: Moved the integration tests to the axis2-json module. That makes it 
easier to determine the test coverage and to analyze the code under test. Also 
fixed an issue with the original patch which was that it wrote generated code 
into the source directories (instead of the "target" directory), which is a 
very bad practice.

Added:
    axis/axis2/java/core/trunk/modules/json/test-conf/
      - copied from r1409729, 
axis/axis2/java/core/trunk/modules/integration/test-resources/json/conf/
    axis/axis2/java/core/trunk/modules/json/test-wsdl/
    axis/axis2/java/core/trunk/modules/json/test-wsdl/LibraryService.wsdl
      - copied unchanged from r1409729, 
axis/axis2/java/core/trunk/modules/integration/test-resources/json/wsdl/LibraryService.wsdl
    axis/axis2/java/core/trunk/modules/json/test/org/apache/axis2/json/adb/
      - copied from r1409729, 
axis/axis2/java/core/trunk/modules/integration/test/org/apache/axis2/json/adb/
    
axis/axis2/java/core/trunk/modules/json/test/org/apache/axis2/json/gson/JSONXMLStreamAPITest.java
      - copied, changed from r1409729, 
axis/axis2/java/core/trunk/modules/integration/test/org/apache/axis2/json/JSONXMLStreamAPITest.java
Removed:
    axis/axis2/java/core/trunk/modules/integration/test-resources/json/
    axis/axis2/java/core/trunk/modules/integration/test/org/apache/axis2/json/
Modified:
    axis/axis2/java/core/trunk/modules/integration/pom.xml
    axis/axis2/java/core/trunk/modules/json/pom.xml

Modified: axis/axis2/java/core/trunk/modules/integration/pom.xml
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/integration/pom.xml?rev=1409766&r1=1409765&r2=1409766&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/integration/pom.xml (original)
+++ axis/axis2/java/core/trunk/modules/integration/pom.xml Thu Nov 15 13:13:12 
2012
@@ -73,11 +73,6 @@
         </dependency>
         <dependency>
             <groupId>org.apache.axis2</groupId>
-            <artifactId>axis2-json</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.axis2</groupId>
             <artifactId>axis2-java2wsdl</artifactId>
             <version>${project.version}</version>
         </dependency>
@@ -589,62 +584,6 @@
                             <goal>run</goal>
                         </goals>
                     </execution>
-                    <execution>
-                        <id>json_adb</id>
-                        <phase>generate-test-sources</phase>
-                        <goals>
-                            <goal>run</goal>
-                        </goals>
-                        <configuration>
-                            <tasks unless="maven.test.skip">
-
-                                <property name="generated.dir" 
value="target/gen"/>
-                                <property name="repository" 
value="target/json_repo"/>
-                                <property name="generated.src.dir" 
value="${generated.dir}/src"/>
-                                <property name="generated.build.dir" 
value="${generated.dir}/target"/>
-                                <property name="service.dir" 
value="${repository}/services"/>
-                                <property name="meta-inf.dir" 
value="${generated.build.dir}/META-INF"/>
-                                <property name="wsdl.dir" 
value="test-resources/json/wsdl"/>
-                                <property name="conf.dir" 
value="test-resources/json/conf"/>
-                                <property name="package.struct" 
value="org/apache/axis2/json/adb"/>
-
-
-                                <mkdir dir="${generated.dir}"/>
-                                <mkdir dir="${generated.src.dir}"/>
-                                <mkdir dir="${generated.build.dir}"/>
-                                <mkdir dir="${repository}"/>
-                                <mkdir dir="${service.dir}"/>
-                                <mkdir dir="${meta-inf.dir}"/>
-
-
-                                <java 
classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
-                                    <classpath refid="maven.test.classpath"/>
-                                    <arg line="-ss -sd -u -or -o 
${generated.dir} -uri test-resources/json/wsdl/LibraryService.wsdl"/>
-                                </java>
-
-                                <copy todir="test">
-                                    <fileset dir="${generated.src.dir}"
-                                             
excludes="${package.struct}/LibraryServiceSkeleton.java"/>
-                                </copy>
-
-                                <copy todir="${meta-inf.dir}">
-                                    <fileset dir="${generated.dir}/resources"/>
-                                </copy>
-                                <javac srcdir="test" 
destdir="${generated.build.dir}" fork="true"
-                                       includes="${package.struct}/**">
-                                    <classpath refid="maven.test.classpath"/>
-                                </javac>
-
-                                <delete 
dir="${service.dir}/json_adb_test.aar"/>
-
-                                <jar basedir="${generated.build.dir}" 
destfile="${service.dir}/json_adb_test.aar"
-                                     excludes="**/*Test.class"/>
-
-                                <delete dir="${generated.dir}"/>
-
-                            </tasks>
-                        </configuration>
-                    </execution>
                 </executions>
             </plugin>
             <plugin>

Modified: axis/axis2/java/core/trunk/modules/json/pom.xml
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/json/pom.xml?rev=1409766&r1=1409765&r2=1409766&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/json/pom.xml (original)
+++ axis/axis2/java/core/trunk/modules/json/pom.xml Thu Nov 15 13:13:12 2012
@@ -70,6 +70,12 @@
             <groupId>com.google.code.gson</groupId>
             <artifactId>gson</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.apache.axis2</groupId>
+            <artifactId>axis2-adb-codegen</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
     <url>http://axis.apache.org/axis2/java/core/</url>
     <scm>
@@ -101,6 +107,69 @@
                     </execution>
                 </executions>
             </plugin>
+            <plugin>
+                <artifactId>maven-antrun-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>wsdl2java</id>
+                        <phase>generate-test-sources</phase>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                        <configuration>
+                            <tasks unless="maven.test.skip">
+                                <java 
classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
+                                    <classpath refid="maven.test.classpath"/>
+                                    <arg line="-ss -sd -u -or -o 
${project.build.directory}/gen -uri test-wsdl/LibraryService.wsdl"/>
+                                </java>
+                                <delete 
file="${project.build.directory}/gen/src/org/apache/axis2/json/adb/LibraryServiceSkeleton.java"/>
+                            </tasks>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>build-helper-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>add-test-source</id>
+                        <phase>process-test-resources</phase>
+                        <goals>
+                            <goal>add-test-source</goal>
+                        </goals>
+                        <configuration>
+                            <sources>
+                                
<source>${project.build.directory}/gen/src</source>
+                            </sources>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <artifactId>maven-resources-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>repo</id>
+                        <phase>generate-test-resources</phase>
+                        <goals>
+                            <goal>copy-resources</goal>
+                        </goals>
+                        <configuration>
+                            
<outputDirectory>${project.build.directory}/repo</outputDirectory>
+                            <resources>
+                                <resource>
+                                    <directory>src/test/repo</directory>
+                                </resource>
+                                <resource>
+                                    
<directory>${project.build.directory}/gen/resources</directory>
+                                    
<targetPath>services/json_adb_test.aar/META-INF</targetPath>
+                                </resource>
+                            </resources>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
         </plugins>
     </build>
 </project>

Copied: 
axis/axis2/java/core/trunk/modules/json/test/org/apache/axis2/json/gson/JSONXMLStreamAPITest.java
 (from r1409729, 
axis/axis2/java/core/trunk/modules/integration/test/org/apache/axis2/json/JSONXMLStreamAPITest.java)
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/json/test/org/apache/axis2/json/gson/JSONXMLStreamAPITest.java?p2=axis/axis2/java/core/trunk/modules/json/test/org/apache/axis2/json/gson/JSONXMLStreamAPITest.java&p1=axis/axis2/java/core/trunk/modules/integration/test/org/apache/axis2/json/JSONXMLStreamAPITest.java&r1=1409729&r2=1409766&rev=1409766&view=diff
==============================================================================
--- 
axis/axis2/java/core/trunk/modules/integration/test/org/apache/axis2/json/JSONXMLStreamAPITest.java
 (original)
+++ 
axis/axis2/java/core/trunk/modules/json/test/org/apache/axis2/json/gson/JSONXMLStreamAPITest.java
 Thu Nov 15 13:13:12 2012
@@ -17,13 +17,9 @@
  * under the License.
  */
 
-package org.apache.axis2.json;
+package org.apache.axis2.json.gson;
 
-import org.apache.axis2.Constants;
-import org.apache.axis2.description.AxisService;
-import org.apache.axis2.engine.AxisConfiguration;
-import org.apache.axis2.integration.UtilServer;
-import org.apache.axis2.json.adb.LibraryServiceSkeleton;
+import org.apache.axis2.testutils.UtilServer;
 import org.apache.commons.httpclient.HttpClient;
 import org.apache.commons.httpclient.methods.PostMethod;
 import org.apache.commons.httpclient.methods.RequestEntity;
@@ -42,7 +38,7 @@ public class JSONXMLStreamAPITest {
     public void setUp()throws Exception {
         String baseDir = System.getProperty("basedir" , ".").toString();
 //        UtilServer.start((baseDir + "target/repo"), (baseDir + 
"test-resources/json/conf/axis2_json.xml"));
-        
UtilServer.start(("target/json_repo"),("test-resources/json/conf/axis2_json.xml"));
+        UtilServer.start("target/repo", "test-conf/axis2_json.xml");
 
     }
 


Reply via email to