Author: alessio.soldano(a)jboss.com
Date: 2010-02-26 10:23:31 -0500 (Fri, 26 Feb 2010)
New Revision: 11695
Added:
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsProvide/src/test/
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsProvide/src/test/java/
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsProvide/src/test/java/org/
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsProvide/src/test/java/org/jboss/
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsProvide/src/test/java/org/jboss/test/
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsProvide/src/test/java/org/jboss/test/ws/
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsProvide/src/test/java/org/jboss/test/ws/plugins/
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsProvide/src/test/java/org/jboss/test/ws/plugins/tools/
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsProvide/src/test/java/org/jboss/test/ws/plugins/tools/wsprovide/
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsProvide/src/test/java/org/jboss/test/ws/plugins/tools/wsprovide/TestEndpoint2.java
Modified:
projects/plugins/maven/jaxws-tools/trunk/pom.xml
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/TestWsConsumeMojo.java
projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/helpers/TestWsConsumeHelper.java
projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/helpers/TestWsProvideHelper.java
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsConsume/pom-cxf.xml
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsConsume/pom-metro.xml
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsConsume/pom.xml
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsProvide/pom-cxf.xml
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsProvide/pom-metro.xml
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsProvide/pom.xml
Log:
[JBWS-2650] Adding tests for test mojos
Modified: projects/plugins/maven/jaxws-tools/trunk/pom.xml
===================================================================
--- projects/plugins/maven/jaxws-tools/trunk/pom.xml 2010-02-26 14:59:58 UTC (rev 11694)
+++ projects/plugins/maven/jaxws-tools/trunk/pom.xml 2010-02-26 15:23:31 UTC (rev 11695)
@@ -29,6 +29,13 @@
<maven.project.version>2.0.4</maven.project.version>
<maven.plugin.api.version>2.0.4</maven.plugin.api.version>
<maven.invoker.plugin.version>1.5</maven.invoker.plugin.version>
+ <!-- For test -->
+ <junit.version>4.7</junit.version>
+
<maven.plugin.testing.harness.version>1.1</maven.plugin.testing.harness.version>
+ <jbossws.cxf.client.version>3.3.0.Beta1</jbossws.cxf.client.version>
+ <jbossws.metro.client.version>3.3.0.Beta1</jbossws.metro.client.version>
+
<jbossws.native.client.version>3.3.0.Beta4</jbossws.native.client.version>
+ <jbossxb.version>2.0.1.GA</jbossxb.version>
</properties>
<!-- Dependencies -->
@@ -53,14 +60,14 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <version>4.7</version>
+ <version>${junit.version}</version>
<type>jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-plugin-testing-harness</artifactId>
- <version>1.1</version>
+ <version>${maven.plugin.testing.harness.version}</version>
<scope>test</scope>
</dependency>
@@ -68,25 +75,25 @@
<dependency>
<groupId>org.jboss.ws.native</groupId>
<artifactId>jbossws-native-client</artifactId>
- <version>3.3.0.Beta4</version>
+ <version>${jbossws.native.client.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.ws.cxf</groupId>
<artifactId>jbossws-cxf-client</artifactId>
- <version>3.3.0.Beta1</version>
+ <version>${jbossws.cxf.client.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.ws.metro</groupId>
<artifactId>jbossws-metro-client</artifactId>
- <version>3.3.0.Beta1</version>
+ <version>${jbossws.metro.client.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss</groupId>
<artifactId>jbossxb</artifactId>
- <version>2.0.1.GA</version>
+ <version>${jbossxb.version}</version>
<optional>true</optional>
<!-- <scope>test</scope> --> <!-- TODO Move this to test scope
instead of making it optional; currently messes up classloader in wsprovide test with
Native stack -->
</dependency>
Modified:
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/TestWsConsumeMojo.java
===================================================================
---
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/TestWsConsumeMojo.java 2010-02-26
14:59:58 UTC (rev 11694)
+++
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/TestWsConsumeMojo.java 2010-02-26
15:23:31 UTC (rev 11695)
@@ -27,10 +27,15 @@
/**
* Run wsconsume tool (for tests)
*
+ * @goal wsconsume-test
+ * @phase generate-test-sources
+ * @requiresDependencyResolution
+ * @description JBossWS WSConsume (Test) Maven Plugin.
+ *
* @author alessio.soldano(a)jboss.com
* @since 24-Feb-2010
*/
-public class TestWsConsumeMojo extends WsConsumeMojo
+public class TestWsConsumeMojo extends AbstractWsConsumeMojo
{
/**
* Sets the main output directory. If the directory does not exist, it will be
created.
Modified:
projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/helpers/TestWsConsumeHelper.java
===================================================================
---
projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/helpers/TestWsConsumeHelper.java 2010-02-26
14:59:58 UTC (rev 11694)
+++
projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/helpers/TestWsConsumeHelper.java 2010-02-26
15:23:31 UTC (rev 11695)
@@ -74,6 +74,12 @@
{
return false;
}
+ File testClassesOrg = new File(basedir.getAbsolutePath() + File.separator +
"target" + File.separator + "test-classes" + File.separator +
"org");
+ File testClassesFoo = new File(basedir.getAbsolutePath() + File.separator +
"target" + File.separator + "test-classes" + File.separator +
"foo");
+ if (!testClassesFoo.exists() || !testClassesOrg.exists())
+ {
+ return false;
+ }
return true;
}
Modified:
projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/helpers/TestWsProvideHelper.java
===================================================================
---
projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/helpers/TestWsProvideHelper.java 2010-02-26
14:59:58 UTC (rev 11694)
+++
projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/helpers/TestWsProvideHelper.java 2010-02-26
15:23:31 UTC (rev 11695)
@@ -34,6 +34,7 @@
public class TestWsProvideHelper implements VerifyScriptHelper, SetupScriptHelper
{
private Long wsdlLastModificationTime = null;
+ private Long wsdlLastModificationTime2 = null;
private Long wrapperClassLastModificationTime = null;
@Override
@@ -42,30 +43,29 @@
File wrapper = new File(basedir.getAbsolutePath() + File.separator +
"target" + File.separator + "wsprovide" + File.separator +
"java" +
File.separator + "org" + File.separator + "jboss" +
File.separator + "test" + File.separator + "ws" + File.separator +
"plugins" +
File.separator + "tools" + File.separator + "wsprovide" +
File.separator + "jaxws" + File.separator + "Test.java");
- if (!wrapper.exists())
- {
- System.out.println(wrapper + " not found!");
- return false;
- }
- if (wrapperClassLastModificationTime != null && wrapper.lastModified() ==
wrapperClassLastModificationTime)
- {
- System.out.println(wrapper + " was not modified by the plugin!");
- return false;
- }
-
File wsdl = new File(basedir.getAbsolutePath() + File.separator +
"target" + File.separator + "wsprovide" + File.separator +
"resources" +
File.separator + "TestEndpointService.wsdl");
- if (!wsdl.exists())
+ File wsdl2 = new File(basedir.getAbsolutePath() + File.separator +
"target" + File.separator + "wsprovide" + File.separator +
"resources" +
+ File.separator + "TestEndpoint2Service.wsdl");
+
+ final boolean firstCheck = internalVerify(wrapper,
wrapperClassLastModificationTime);
+ final boolean secondCheck = internalVerify(wsdl, wsdlLastModificationTime);
+ final boolean thirdCheck = internalVerify(wsdl2, wsdlLastModificationTime2);
+ return firstCheck && secondCheck && thirdCheck;
+ }
+
+ private static boolean internalVerify(File file, Long modificationTime)
+ {
+ if (!file.exists())
{
- System.out.println(wsdl + " not found!");
+ System.out.println(file + " not found!");
return false;
}
- if (wsdlLastModificationTime != null && wsdl.lastModified() ==
wsdlLastModificationTime)
+ if (modificationTime != null && file.lastModified() == modificationTime)
{
- System.out.println(wsdl + " was not modified by the plugin!");
+ System.out.println(file + " was not modified by the plugin!");
return false;
}
-
return true;
}
@@ -86,6 +86,13 @@
{
this.wsdlLastModificationTime = wsdl.lastModified();
}
+
+ File wsdl2 = new File(basedir.getAbsolutePath() + File.separator +
"target" + File.separator + "wsprovide" + File.separator +
"resources" +
+ File.separator + "TestEndpointService2.wsdl");
+ if (wsdl2.exists())
+ {
+ this.wsdlLastModificationTime2 = wsdl2.lastModified();
+ }
}
}
Modified:
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsConsume/pom-cxf.xml
===================================================================
---
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsConsume/pom-cxf.xml 2010-02-26
14:59:58 UTC (rev 11694)
+++
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsConsume/pom-cxf.xml 2010-02-26
15:23:31 UTC (rev 11695)
@@ -72,6 +72,18 @@
</wsdls>
</configuration>
</execution>
+ <execution>
+ <id>Forth execution</id>
+ <goals>
+ <goal>wsconsume-test</goal>
+ </goals>
+ <configuration>
+ <wsdls>
+ <wsdl>${basedir}/test.wsdl</wsdl>
+ <wsdl>${basedir}/test2.wsdl</wsdl>
+ </wsdls>
+ </configuration>
+ </execution>
</executions>
</plugin>
</plugins>
Modified:
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsConsume/pom-metro.xml
===================================================================
---
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsConsume/pom-metro.xml 2010-02-26
14:59:58 UTC (rev 11694)
+++
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsConsume/pom-metro.xml 2010-02-26
15:23:31 UTC (rev 11695)
@@ -72,6 +72,18 @@
</wsdls>
</configuration>
</execution>
+ <execution>
+ <id>Forth execution</id>
+ <goals>
+ <goal>wsconsume-test</goal>
+ </goals>
+ <configuration>
+ <wsdls>
+ <wsdl>${basedir}/test.wsdl</wsdl>
+ <wsdl>${basedir}/test2.wsdl</wsdl>
+ </wsdls>
+ </configuration>
+ </execution>
</executions>
</plugin>
</plugins>
Modified:
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsConsume/pom.xml
===================================================================
---
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsConsume/pom.xml 2010-02-26
14:59:58 UTC (rev 11694)
+++
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsConsume/pom.xml 2010-02-26
15:23:31 UTC (rev 11695)
@@ -72,6 +72,18 @@
</wsdls>
</configuration>
</execution>
+ <execution>
+ <id>Forth execution</id>
+ <goals>
+ <goal>wsconsume-test</goal>
+ </goals>
+ <configuration>
+ <wsdls>
+ <wsdl>${basedir}/test.wsdl</wsdl>
+ <wsdl>${basedir}/test2.wsdl</wsdl>
+ </wsdls>
+ </configuration>
+ </execution>
</executions>
</plugin>
</plugins>
Modified:
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsProvide/pom-cxf.xml
===================================================================
---
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsProvide/pom-cxf.xml 2010-02-26
14:59:58 UTC (rev 11694)
+++
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsProvide/pom-cxf.xml 2010-02-26
15:23:31 UTC (rev 11695)
@@ -44,6 +44,16 @@
<generateWsdl>true</generateWsdl>
</configuration>
</execution>
+ <execution>
+ <id>Second execution</id>
+ <goals>
+ <goal>wsprovide-test</goal>
+ </goals>
+ <configuration>
+
<endpointClass>org.jboss.test.ws.plugins.tools.wsprovide.TestEndpoint2</endpointClass>
+ <generateWsdl>true</generateWsdl>
+ </configuration>
+ </execution>
</executions>
</plugin>
</plugins>
Modified:
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsProvide/pom-metro.xml
===================================================================
---
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsProvide/pom-metro.xml 2010-02-26
14:59:58 UTC (rev 11694)
+++
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsProvide/pom-metro.xml 2010-02-26
15:23:31 UTC (rev 11695)
@@ -44,6 +44,16 @@
<generateWsdl>true</generateWsdl>
</configuration>
</execution>
+ <execution>
+ <id>Second execution</id>
+ <goals>
+ <goal>wsprovide-test</goal>
+ </goals>
+ <configuration>
+
<endpointClass>org.jboss.test.ws.plugins.tools.wsprovide.TestEndpoint2</endpointClass>
+ <generateWsdl>true</generateWsdl>
+ </configuration>
+ </execution>
</executions>
</plugin>
</plugins>
Modified:
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsProvide/pom.xml
===================================================================
---
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsProvide/pom.xml 2010-02-26
14:59:58 UTC (rev 11694)
+++
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsProvide/pom.xml 2010-02-26
15:23:31 UTC (rev 11695)
@@ -44,6 +44,16 @@
<generateWsdl>true</generateWsdl>
</configuration>
</execution>
+ <execution>
+ <id>Second execution</id>
+ <goals>
+ <goal>wsprovide-test</goal>
+ </goals>
+ <configuration>
+
<endpointClass>org.jboss.test.ws.plugins.tools.wsprovide.TestEndpoint2</endpointClass>
+ <generateWsdl>true</generateWsdl>
+ </configuration>
+ </execution>
</executions>
</plugin>
</plugins>
Added:
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsProvide/src/test/java/org/jboss/test/ws/plugins/tools/wsprovide/TestEndpoint2.java
===================================================================
---
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsProvide/src/test/java/org/jboss/test/ws/plugins/tools/wsprovide/TestEndpoint2.java
(rev 0)
+++
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsProvide/src/test/java/org/jboss/test/ws/plugins/tools/wsprovide/TestEndpoint2.java 2010-02-26
15:23:31 UTC (rev 11695)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.ws.plugins.tools.wsprovide;
+
+import javax.jws.WebService;
+
+/**
+ * A simple test endpoint service implementation
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 26-Feb-2010
+ *
+ */
+@WebService
+public class TestEndpoint2
+{
+ public String test(String s)
+ {
+ return s;
+ }
+}
\ No newline at end of file
Property changes on:
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsProvide/src/test/java/org/jboss/test/ws/plugins/tools/wsprovide/TestEndpoint2.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF