Author: heiko.braun(a)jboss.com
Date: 2007-08-03 06:56:37 -0400 (Fri, 03 Aug 2007)
New Revision: 4153
Added:
spi/trunk/src/test/java/org/jboss/test/wsf/spi/tools/AntProvideTestCase.java
spi/trunk/src/test/resources/smoke/tools/provide-test.xml
Modified:
spi/trunk/ant-import/build-testsuite.xml
spi/trunk/spi.iml
spi/trunk/src/main/java/org/jboss/wsf/spi/tools/ant/WSProvideTask.java
spi/trunk/src/test/java/org/jboss/test/wsf/spi/tools/AntConsumeTestCase.java
spi/trunk/src/test/java/org/jboss/test/wsf/spi/tools/CmdProvideTracker.java
spi/trunk/src/test/resources/smoke/tools/consume-test.xml
Log:
Fix [JBWS-1732]: WSProvideTask throws IllegalArgumentException
Modified: spi/trunk/ant-import/build-testsuite.xml
===================================================================
--- spi/trunk/ant-import/build-testsuite.xml 2007-08-03 10:41:27 UTC (rev 4152)
+++ spi/trunk/ant-import/build-testsuite.xml 2007-08-03 10:56:37 UTC (rev 4153)
@@ -62,6 +62,9 @@
<fileset dir="${spi.test.resources.dir}">
<include name="**/*.xml"/>
</fileset>
+ <filterset>
+ <filter token="SPI_DIR" value="${basedir}"/>
+ </filterset>
</copy>
</target>
Modified: spi/trunk/spi.iml
===================================================================
--- spi/trunk/spi.iml 2007-08-03 10:41:27 UTC (rev 4152)
+++ spi/trunk/spi.iml 2007-08-03 10:56:37 UTC (rev 4153)
@@ -195,7 +195,7 @@
<orderEntry type="module-library">
<library>
<CLASSES>
- <root url="jar://$MODULE_DIR$/thirdparty/ant-nodeps.jar!/" />
+ <root url="jar://$MODULE_DIR$/thirdparty/ant-launcher.jar!/"
/>
</CLASSES>
<JAVADOC />
<SOURCES />
Modified: spi/trunk/src/main/java/org/jboss/wsf/spi/tools/ant/WSProvideTask.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/tools/ant/WSProvideTask.java 2007-08-03
10:41:27 UTC (rev 4152)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/tools/ant/WSProvideTask.java 2007-08-03
10:56:37 UTC (rev 4153)
@@ -178,7 +178,11 @@
{
try
{
- urls.add(new URL(tok.nextToken()));
+ String path = tok.nextToken();
+ if(!path.startsWith("file://"))
+ path = "file://"+path;
+
+ urls.add(new URL(path));
}
catch (MalformedURLException e)
{
Modified: spi/trunk/src/test/java/org/jboss/test/wsf/spi/tools/AntConsumeTestCase.java
===================================================================
---
spi/trunk/src/test/java/org/jboss/test/wsf/spi/tools/AntConsumeTestCase.java 2007-08-03
10:41:27 UTC (rev 4152)
+++
spi/trunk/src/test/java/org/jboss/test/wsf/spi/tools/AntConsumeTestCase.java 2007-08-03
10:56:37 UTC (rev 4153)
@@ -21,8 +21,6 @@
*/
package org.jboss.test.wsf.spi.tools;
-import org.jboss.wsf.spi.tools.ant.WSConsumeTask;
-
/**
* Test the WSConsumeTask.
* This test needs to be executed in 'SPI_HOME/output/tests',
@@ -32,9 +30,7 @@
* @version $Revision$
*/
public class AntConsumeTestCase extends BuildFileTest
-{
- WSConsumeTask task;
-
+{
protected void setUp() throws Exception
{
super.setUp();
@@ -48,10 +44,6 @@
"org.jboss.test.wsf.spi.tools.CmdConsumeTrackerFactory"
);
- // the build files used by this test case needs to build a classpath
- // in this case we assum test execution in 'SPI_HOME/output/tests'
- System.setProperty("SPI_HOME", "../../");
-
configureProject("resources/smoke/tools/consume-test.xml");
}
Added: spi/trunk/src/test/java/org/jboss/test/wsf/spi/tools/AntProvideTestCase.java
===================================================================
--- spi/trunk/src/test/java/org/jboss/test/wsf/spi/tools/AntProvideTestCase.java
(rev 0)
+++
spi/trunk/src/test/java/org/jboss/test/wsf/spi/tools/AntProvideTestCase.java 2007-08-03
10:56:37 UTC (rev 4153)
@@ -0,0 +1,64 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.wsf.spi.tools;
+
+/**
+ * @author Heiko.Braun(a)jboss.com
+ * @version $Revision$
+ */
+public class AntProvideTestCase extends BuildFileTest
+{
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+
+ // cleanup events
+ CmdProvideTracker.LAST_EVENT = "";
+
+ // enforce loading of the tracker implemenation
+ System.setProperty(
+ "org.jboss.wsf.spi.tools.ProviderFactoryImpl",
+ "org.jboss.test.wsf.spi.tools.CmdProvideTrackerFactory"
+ );
+
+ configureProject("resources/smoke/tools/provide-test.xml");
+ }
+
+ public void testPlainInvocation()
+ {
+ executeTarget("plainInvocation");
+ assertTrue("provide() not invoked",
CmdProvideTracker.LAST_EVENT.indexOf("provide")!=-1);
+ }
+
+ public void testIncludeWSDL()
+ {
+ executeTarget("includeWSDL");
+ assertTrue("setGenerateWsdl() not invoked",
CmdProvideTracker.LAST_EVENT.indexOf("setGenerateWsdl")!=-1);
+ }
+
+ public void testExtraClasspath()
+ {
+ executeTarget("extraClasspath");
+
+ }
+
+}
Property changes on:
spi/trunk/src/test/java/org/jboss/test/wsf/spi/tools/AntProvideTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: spi/trunk/src/test/java/org/jboss/test/wsf/spi/tools/CmdProvideTracker.java
===================================================================
--- spi/trunk/src/test/java/org/jboss/test/wsf/spi/tools/CmdProvideTracker.java 2007-08-03
10:41:27 UTC (rev 4152)
+++ spi/trunk/src/test/java/org/jboss/test/wsf/spi/tools/CmdProvideTracker.java 2007-08-03
10:56:37 UTC (rev 4153)
@@ -67,12 +67,12 @@
public void provide(String endpointClass)
{
-
+ LAST_EVENT += "provide";
}
public void provide(Class<?> endpointClass)
{
-
+ LAST_EVENT += "provide";
}
public void setMessageStream(PrintStream messageStream)
Modified: spi/trunk/src/test/resources/smoke/tools/consume-test.xml
===================================================================
--- spi/trunk/src/test/resources/smoke/tools/consume-test.xml 2007-08-03 10:41:27 UTC (rev
4152)
+++ spi/trunk/src/test/resources/smoke/tools/consume-test.xml 2007-08-03 10:56:37 UTC (rev
4153)
@@ -6,12 +6,12 @@
<project name="consume-test" basedir=".">
- <property environment="env"/>
+ <property name="spi.dir" value="@SPI_DIR@"/>
<!-- Define the JAX-WS wsconsume task -->
<taskdef name="wsconsume"
classname="org.jboss.wsf.spi.tools.ant.WSConsumeTask">
<classpath>
- <pathelement
location="${env.SPI_HOME}/output/lib/jbossws-spi.jar"/>
+ <pathelement location="${spi.dir}/output/lib/jbossws-spi.jar"/>
</classpath>
</taskdef>
Added: spi/trunk/src/test/resources/smoke/tools/provide-test.xml
===================================================================
--- spi/trunk/src/test/resources/smoke/tools/provide-test.xml (rev
0)
+++ spi/trunk/src/test/resources/smoke/tools/provide-test.xml 2007-08-03 10:56:37 UTC (rev
4153)
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ An example build file that used to test the WSConsume Task
+-->
+
+<project name="provide-test" basedir=".">
+
+ <property name="spi.dir" value="@SPI_DIR@"/>
+
+ <!-- Define the JAX-WS wsconsume task -->
+ <taskdef name="wsprovide"
classname="org.jboss.wsf.spi.tools.ant.WSProvideTask">
+ <classpath>
+ <pathelement location="${spi.dir}/output/lib/jbossws-spi.jar"/>
+ </classpath>
+ </taskdef>
+
+ <target name="plainInvocation">
+ <wsprovide genwsdl="false"
sei="org.jboss.test.wsf.spi.smoke.tools.CalculatorBean"/>
+ </target>
+
+ <target name="includeWSDL">
+ <wsprovide genwsdl="true"
sei="org.jboss.test.wsf.spi.smoke.tools.CalculatorBean"/>
+ </target>
+
+ <target name="extraClasspath">
+ <wsprovide genwsdl="false"
sei="org.jboss.test.wsf.spi.smoke.tools.CalculatorBean">
+ <classpath>
+ <pathelement location="${spi.dir}/output/test/classes"/>
+ </classpath>
+ </wsprovide>
+ </target>
+</project>
\ No newline at end of file
Property changes on: spi/trunk/src/test/resources/smoke/tools/provide-test.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF