[jbossws-commits] JBossWS SVN: r13000 - in projects/plugins/maven/jaxws-tools/trunk/src/test: resources/test-embedded/testEndorse and 1 other directory.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Wed Sep 22 02:40:27 EDT 2010


Author: alessio.soldano at jboss.com
Date: 2010-09-22 02:40:27 -0400 (Wed, 22 Sep 2010)
New Revision: 13000

Modified:
   projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/helpers/TestEndorseHelper.java
   projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testEndorse/pom-cxf.xml
   projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testEndorse/pom.xml
Log:
[JBWS-3130] Improving embedded test by adding executions in test phase too


Modified: projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/helpers/TestEndorseHelper.java
===================================================================
--- projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/helpers/TestEndorseHelper.java	2010-09-21 17:43:13 UTC (rev 12999)
+++ projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/helpers/TestEndorseHelper.java	2010-09-22 06:40:27 UTC (rev 13000)
@@ -36,6 +36,7 @@
 public class TestEndorseHelper implements VerifyScriptHelper, SetupScriptHelper
 {
    private Long lastModificationTime = null;
+   private Long lastModificationTime2 = null;
    private static final String JAXWS_22_ENDPOINT_SERVICE_CONSTRUCTOR = "public EndpointService(URL wsdlLocation, WebServiceFeature... features)";
    private static final String JAXWS_22_ENDPOINT_SERVICE_CONSTRUCTOR_CONTENTS = "super(wsdlLocation, serviceName, features);";
 
@@ -61,6 +62,25 @@
          return false;
       }
       
+      //second execution checks
+      File endpointServiceFile2 = new File(basedir.getAbsolutePath() + File.separator + "target" + File.separator + "wsconsume" + File.separator + "java" +
+            File.separator + "foo" + File.separator + "test" + File.separator + "bar" + File.separator + "EndpointService.java");
+      if (!endpointServiceFile2.exists())
+      {
+         System.out.println(endpointServiceFile2 + " not found!");
+         return false;
+      }
+      if (lastModificationTime2 != null && endpointServiceFile2.lastModified() == lastModificationTime2)
+      {
+         System.out.println(endpointServiceFile2 + " was not modified by the plugin!");
+         return false;
+      }
+      if (!readContents(endpointServiceFile2).contains(JAXWS_22_ENDPOINT_SERVICE_CONSTRUCTOR_CONTENTS))
+      {
+         System.out.println("Could not find JAXWS 2.2 constructor '" + JAXWS_22_ENDPOINT_SERVICE_CONSTRUCTOR + "' in " + endpointServiceFile2);
+         return false;
+      }
+      
       //classes checks
       File classesFoo = new File(basedir.getAbsolutePath() + File.separator + "target" + File.separator + "classes" + File.separator + "foo");
       if (!classesFoo.exists())
@@ -68,6 +88,18 @@
          System.out.println(classesFoo + " dir not found!");
          return false;
       }
+      File classesFooBar = new File(basedir.getAbsolutePath() + File.separator + "target" + File.separator + "classes" + File.separator + "foo" + File.separator + "bar");
+      if (!classesFooBar.exists())
+      {
+         System.out.println(classesFooBar + " dir not found!");
+         return false;
+      }
+      File classesFooTest = new File(basedir.getAbsolutePath() + File.separator + "target" + File.separator + "test-classes" + File.separator + "foo" + File.separator + "test");
+      if (!classesFooTest.exists())
+      {
+         System.out.println(classesFooTest + " dir not found!");
+         return false;
+      }
       
       return true;
    }
@@ -75,12 +107,21 @@
    @Override
    public void setup(File basedir, File localRepositoryPath, Map<?, ?> context) throws Exception
    {
+      //first execution
       File endpointServiceFile = new File(basedir.getAbsolutePath() + File.separator + "target" + File.separator + "wsconsume" + File.separator + "java" +
             File.separator + "foo" + File.separator + "bar" + File.separator + "EndpointService.java");
       if (endpointServiceFile.exists())
       {
          this.lastModificationTime = endpointServiceFile.lastModified();
       }
+      
+      //second execution
+      File endpointServiceFile2 = new File(basedir.getAbsolutePath() + File.separator + "target" + File.separator + "wsconsume" + File.separator + "java" +
+            File.separator + "foo" + File.separator + "test" + File.separator + "bar" + File.separator + "EndpointService.java");
+      if (endpointServiceFile2.exists())
+      {
+         this.lastModificationTime2 = endpointServiceFile2.lastModified();
+      }
    }
    
    private String readContents(File file) throws Exception

Modified: projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testEndorse/pom-cxf.xml
===================================================================
--- projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testEndorse/pom-cxf.xml	2010-09-21 17:43:13 UTC (rev 12999)
+++ projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testEndorse/pom-cxf.xml	2010-09-22 06:40:27 UTC (rev 13000)
@@ -34,9 +34,9 @@
           <artifactId>maven-jaxws-tools-plugin</artifactId>
           <version>@pom.version@</version>
           <configuration>
-            <target>2.2</target>
+            <target>2.2</target> <!-- This is actually ignored by the CXF tooling, the jaxws 2.2 version is being used because of the endorsing here -->
             <verbose>true</verbose>
-            <fork>true</fork>
+            <fork>true</fork> <!-- Required for endorsing -->
             <argLine>-Djava.endorsed.dirs=${basedir}/target/endorsed</argLine>
           </configuration>
           <executions>
@@ -52,6 +52,18 @@
                 <targetPackage>foo.bar</targetPackage>
               </configuration>
             </execution>
+            <execution>
+              <id>Second execution</id>
+              <goals>
+                <goal>wsconsume-test</goal>
+              </goals>
+              <configuration>
+                <wsdls>
+                  <wsdl>${basedir}/test.wsdl</wsdl>
+                </wsdls>
+                <targetPackage>foo.test.bar</targetPackage>
+              </configuration>
+            </execution>
           </executions>
         </plugin>
         <plugin>

Modified: projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testEndorse/pom.xml
===================================================================
--- projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testEndorse/pom.xml	2010-09-21 17:43:13 UTC (rev 12999)
+++ projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testEndorse/pom.xml	2010-09-22 06:40:27 UTC (rev 13000)
@@ -52,6 +52,18 @@
                 <targetPackage>foo.bar</targetPackage>
               </configuration>
             </execution>
+            <execution>
+              <id>Second execution</id>
+              <goals>
+                <goal>wsconsume-test</goal>
+              </goals>
+              <configuration>
+                <wsdls>
+                  <wsdl>${basedir}/test.wsdl</wsdl>
+                </wsdls>
+                <targetPackage>foo.test.bar</targetPackage>
+              </configuration>
+            </execution>
           </executions>
         </plugin>
         <plugin>



More information about the jbossws-commits mailing list