Author: jeffyu
Date: Tue Jul 20 07:13:16 2010
New Revision: 965738

URL: http://svn.apache.org/viewvc?rev=965738&view=rev
Log:
* ODE-875, first commit for enabing axis2-war testing task.

Added:
    ode/trunk/axis2-war/itest_setup.groovy
Modified:
    ode/trunk/axis2-war/pom.xml
    
ode/trunk/axis2-war/src/test/java/org/apache/ode/axis2/correlation/CorrelationUnicityTest.java
    ode/trunk/bpel-test/pom.xml
    ode/trunk/pom.xml

Added: ode/trunk/axis2-war/itest_setup.groovy
URL: 
http://svn.apache.org/viewvc/ode/trunk/axis2-war/itest_setup.groovy?rev=965738&view=auto
==============================================================================
--- ode/trunk/axis2-war/itest_setup.groovy (added)
+++ ode/trunk/axis2-war/itest_setup.groovy Tue Jul 20 07:13:16 2010
@@ -0,0 +1,77 @@
+/*
+ * 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.
+ */
+
+import java.io.File
+
+def warname = project.build.directory+"/"+project.build.finalName+".war";
+def webapp = project.build.directory + "/webapp";
+def testresources = new File(project.basedir, 'src/test/webapp')
+
+log.info('-----Performing pre-integration test tasks-----');
+log.info('extracting the axis2 war');
+ant.unwar(src: warname , dest: webapp )
+log.info('copying over the test webapp resources');
+ant.copy(todir: webapp) {
+    fileset(dir: testresources) {
+        include(name: '**')
+    }
+}
+//This was in buildr, don't know if it is needed
+//copy target/test-classes/TestEndpointProperties/*_global_conf*.endpoint to 
webapp/WEB-INF/conf
+
+prepare_secure_services_tests (new 
File(project.build.testOutputDirectory,'TestRampartBasic/secured-services'),~/sample\d+\.axis2/);
+prepare_secure_services_tests (new 
File(project.build.testOutputDirectory,'TestRampartPolicy/secured-services'),~/sample\d+\-policy\.xml/);
+prepare_secure_processes_tests (new 
File(project.build.testOutputDirectory,'TestRampartBasic/secured-processes'));
+prepare_secure_processes_tests (new 
File(project.build.testOutputDirectory,'TestRampartPolicy/secured-processes'));
+
+def prepare_secure_processes_tests(test_dir) {
+    log.info('preparing the secure process tests in ' + test_dir);
+    def p = ~/sample\d+\-service\.xml/;
+    test_dir.eachFileMatch(p) { service_file ->
+        def sample_name = service_file.getName().split('-')[0];
+        def proc_dir = test_dir.getAbsolutePath() +'/process-' + sample_name;
+        ant.copy(todir: proc_dir) {
+            fileset(dir: test_dir.getAbsolutePath()+'/process-template') {
+                include(name: '**')
+            }
+        }
+        ant.copy(file: service_file, tofile:  proc_dir + 
'/HelloService.axis2');
+    }
+}
+
+def prepare_secure_services_tests(test_dir, file_pattern){
+    log.info('preparing the secure services tests with pattern 
'+file_pattern+' in ' + test_dir);
+    test_dir.eachFileMatch(file_pattern) { config_file ->
+        def  sample_name =  config_file.getName().split("\\.")[0];
+        def proc_dir = test_dir.getAbsolutePath() +'/process-' + sample_name;
+        ant.filterset(id: sample_name+'_filter', begintoken: '{', endtoken: 
'}'){
+            filter(token: 'sample.namespace', value: 'http://'+ 
sample_name.replaceAll('-','.')+'.samples.rampart.apache.org');
+            filter(token: 'sample.service.name', value: sample_name);
+            }
+            ant.copy(todir: proc_dir) {
+                fileset(dir: test_dir.getAbsolutePath()+'/process-template') {
+                    include(name: '**')
+                }
+                filterset(refid: sample_name+'_filter');
+            }
+            ant.copy(todir: proc_dir, file: config_file){
+                filterset(refid: sample_name+'_filter');
+            }
+        }
+    }
\ No newline at end of file

Modified: ode/trunk/axis2-war/pom.xml
URL: 
http://svn.apache.org/viewvc/ode/trunk/axis2-war/pom.xml?rev=965738&r1=965737&r2=965738&view=diff
==============================================================================
--- ode/trunk/axis2-war/pom.xml (original)
+++ ode/trunk/axis2-war/pom.xml Tue Jul 20 07:13:16 2010
@@ -300,69 +300,68 @@
           </execution>
         </executions>
       </plugin>
-      <!--plugin>
-        <groupId>org.mortbay.jetty</groupId>
-        <artifactId>maven-jetty-plugin</artifactId>
-        <version>6.1.10</version>
-        <configuration>
-                <scanIntervalSeconds>10</scanIntervalSeconds>
-                <stopKey>foo</stopKey>
-                <stopPort>9999</stopPort>
-                
<webApp>${basedir}/target/ode-axis2-war-${project.version}.war</webApp>
-        </configuration>
-        <executions>
-                <execution>
-                        <id>start-jetty</id>
+           <plugin>
+               <groupId>org.apache.maven.plugins</groupId>
+               <artifactId>maven-compiler-plugin</artifactId>
+               <executions>
+                   <execution>
+                       <id>compiler-it</id>
+                       <phase>pre-integration-test</phase>
+                       <goals>
+                           <goal>testCompile</goal>
+                       </goals>
+                   </execution>
+               </executions>
+           </plugin>
+            <plugin>
+                <artifactId>maven-resources-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>resources-it</id>
                         <phase>pre-integration-test</phase>
                         <goals>
-                                <goal>run-war</goal>
+                            <goal>testResources</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <!--doclet does not support not-found="ignore" -->
+                <groupId>org.codehaus.groovy.maven</groupId>
+                <artifactId>gmaven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>prepare-itests</id>
+                        <phase>pre-integration-test</phase>
+                        <goals>
+                            <goal>execute</goal>
                         </goals>
                         <configuration>
-                                <scanIntervalSeconds>0</scanIntervalSeconds>
-                                <daemon>true</daemon>
+                            <source>${pom.basedir}/itest_setup.groovy</source>
                         </configuration>
-                </execution>
-                <execution>
-                        <id>stop-jetty</id>
-                        <phase>post-integration-test</phase>
+                    </execution>
+                </executions>
+            </plugin>
+
+            <plugin>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>test-axis2-web</id>
+                        <phase>integration-test</phase>
                         <goals>
-                                <goal>stop</goal>
+                            <goal>test</goal>
                         </goals>
-                </execution>
-        </executions>
-      </plugin>
-        <plugin>
-            <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-compiler-plugin</artifactId>
-            <executions>
-                <execution>
-                    <id>compiler-it</id>
-                    <phase>pre-integration-test</phase>
-                    <goals>
-                        <goal>testCompile</goal>
-                    </goals>
-                </execution>
-            </executions>
-        </plugin-->
-        <!-- FIXME: temporary commented out -->
-        <plugin>
-            <artifactId>maven-surefire-plugin</artifactId>
-            <configuration>
-                <includes>
-                    <include>**/*TestCase.java</include>
-                    <include>**/Test.java</include>
-                </includes>
-            </configuration>
-            <executions>
-                <execution>
-                    <id>test-axis2-web</id>
-                    <phase>integration-test</phase>
-                    <goals>
-                        <goal>test</goal>
-                    </goals>
-                </execution>
-            </executions>
-        </plugin>
+                        <configuration>
+                            <forkMode>always</forkMode>
+                            
<redirectTestOutputToFile>true</redirectTestOutputToFile>
+                            <additionalClasspathElements>
+                                
<additionalClasspathElement>${project.build.directory}</additionalClasspathElement>
+                            </additionalClasspathElements>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
      </plugins>
    </build>
 

Modified: 
ode/trunk/axis2-war/src/test/java/org/apache/ode/axis2/correlation/CorrelationUnicityTest.java
URL: 
http://svn.apache.org/viewvc/ode/trunk/axis2-war/src/test/java/org/apache/ode/axis2/correlation/CorrelationUnicityTest.java?rev=965738&r1=965737&r2=965738&view=diff
==============================================================================
--- 
ode/trunk/axis2-war/src/test/java/org/apache/ode/axis2/correlation/CorrelationUnicityTest.java
 (original)
+++ 
ode/trunk/axis2-war/src/test/java/org/apache/ode/axis2/correlation/CorrelationUnicityTest.java
 Tue Jul 20 07:13:16 2010
@@ -17,8 +17,10 @@
  * under the License.
  */
 
-package org.apache.ode.axis2;
+package org.apache.ode.axis2.correlation;
 
+import org.apache.ode.axis2.Axis2TestBase;
+import org.apache.ode.axis2.ODEConfigDirAware;
 import org.testng.annotations.Test;
 import static org.testng.AssertJUnit.assertTrue;
 

Modified: ode/trunk/bpel-test/pom.xml
URL: 
http://svn.apache.org/viewvc/ode/trunk/bpel-test/pom.xml?rev=965738&r1=965737&r2=965738&view=diff
==============================================================================
--- ode/trunk/bpel-test/pom.xml (original)
+++ ode/trunk/bpel-test/pom.xml Tue Jul 20 07:13:16 2010
@@ -161,13 +161,7 @@
        <plugin>
     <artifactId>maven-surefire-plugin</artifactId>
     <configuration>
-           <!-- FIXME: temporary skip it, 3 failed test cases (2 in JDK6, 3 in 
JDK5): testIMA, testRetireOld, testIsolated**-->
       <excludes>
-          <!--
-        <exclude>**/MessageRouting20Test.java</exclude>
-        <exclude>**/VersionedRedeployTest.java</exclude>
-        <exclude>**/StructuredActivities20Test.java</exclude>
-        -->
       </excludes>
     </configuration>
        </plugin>

Modified: ode/trunk/pom.xml
URL: 
http://svn.apache.org/viewvc/ode/trunk/pom.xml?rev=965738&r1=965737&r2=965738&view=diff
==============================================================================
--- ode/trunk/pom.xml (original)
+++ ode/trunk/pom.xml Tue Jul 20 07:13:16 2010
@@ -158,7 +158,7 @@
         <module>jbi-bundle</module>
         <module>jbi-karaf</module>
         <module>distro/src/examples-jbi/maven2/ping-pong-osgi</module>
-        <module>axis2-war</module>
+        <!--module>axis2-war</module-->
         <module>bpel-itest</module>
     </modules>
 


Reply via email to