From: Eric P. <de...@us...> - 2004-11-19 13:39:15
|
dep4b 04/11/19 05:39:08 Modified: webtest/xdocs how-to.xml changes.xml properties.xml webtest plugin.jelly project.xml Log: Add interactive parameters. Revision Changes Path 1.8 +9 -0 maven-plugins/webtest/xdocs/how-to.xml Index: how-to.xml =================================================================== RCS file: /cvsroot/maven-plugins/maven-plugins/webtest/xdocs/how-to.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- how-to.xml 28 Oct 2004 08:52:18 -0000 1.7 +++ how-to.xml 19 Nov 2004 13:38:56 -0000 1.8 @@ -69,6 +69,15 @@ in the ${plugin.dir}/plugin-resources/classes </p> </subsection> + + <subsection name="How to pass in parameters?"> + <p> + Any parameters you specifiy in maven.webtest.sysproperties will result in an + interactive prompt if they are empty before the tests are run. You can use this + to pass in a username from externally. Just define maven.webtest.sysproperties=webtestUsername, + and then in your test scripts refer to ${webtestUsername}. + </p> + </subsection> </section> 1.9 +5 -0 maven-plugins/webtest/xdocs/changes.xml Index: changes.xml =================================================================== RCS file: /cvsroot/maven-plugins/maven-plugins/webtest/xdocs/changes.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- changes.xml 19 Nov 2004 11:01:51 -0000 1.8 +++ changes.xml 19 Nov 2004 13:39:07 -0000 1.9 @@ -8,6 +8,11 @@ <releases> <release version="0.9.2" date=""> + <action dev="epugh" type="add"> + Add the ability to supply a list of extra systemproperties (maven.webtest.sysproperties) that + are passed into the Ant task. Any empty system properties will cause a prompt first to supply + the data. + </action> <action dev="epugh" type="fix"> Fix link to generated report when running maven site. </action> 1.5 +19 -0 maven-plugins/webtest/xdocs/properties.xml Index: properties.xml =================================================================== RCS file: /cvsroot/maven-plugins/maven-plugins/webtest/xdocs/properties.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- properties.xml 28 Oct 2004 08:52:18 -0000 1.4 +++ properties.xml 19 Nov 2004 13:39:07 -0000 1.5 @@ -48,6 +48,25 @@ are struggling than you could use "-debug" </td> </tr> + <tr> + <td>maven.webtest.sysproperties</td> + <td>Yes</td> + <td></td> + <td> + Use this property elements to specify properties to be passed to + WebTest scripts. + You can specify system properties separate by space. + Each properties is describe in sub properties. + Sample : + <source><![CDATA[ +maven.webtest.sysproperties=webtestUsername webtestPassword +webtestUsername=testuser + ]]> + </source> + In this example, you will be prompted if you don't pass a webtestPassword + value in to supply one. + </td> + </tr> </table> </section> 1.11 +18 -0 maven-plugins/webtest/plugin.jelly Index: plugin.jelly =================================================================== RCS file: /cvsroot/maven-plugins/maven-plugins/webtest/plugin.jelly,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- plugin.jelly 19 Nov 2004 11:01:51 -0000 1.10 +++ plugin.jelly 19 Nov 2004 13:39:07 -0000 1.11 @@ -3,6 +3,8 @@ <project xmlns:j="jelly:core" xmlns:util="jelly:util" + xmlns:i="jelly:interaction" + xmlns:maven="jelly:maven" xmlns:doc="doc" xmlns:x="jelly:xml"> @@ -92,6 +94,18 @@ <goal name="webtest:test" description="Runs the Canoo webtest scripts"> + <!-- populate any missing system properties --> + <util:tokenize var="listOfProperties" delim=" ">${maven.webtest.sysproperties}</util:tokenize> + <j:forEach var="someProperty" items="${listOfProperties}"> + <j:set var="somePropertyValue" value="${context.getVariable(someProperty)}"/> + + <j:if test="${empty(somePropertyValue)}"> + <i:ask question="What is the ${someProperty} to be used? (-D${someProperty}={value} to skip check)" + answer="${someProperty}"/> + </j:if> + <maven:param-check value="${context.getVariable(someProperty)}" fail="true" message="'${someProperty}' must be specified"/> + </j:forEach> + <!-- Create the result path --> <mkdir dir="${maven.webtest.config.resultpath}"/> @@ -140,6 +154,10 @@ <sysproperty key="showhtmlparseroutput" value="${maven.webtest.config.showhtmlparseroutput}"/> <sysproperty key="autorefresh" value="${maven.webtest.config.autorefresh}"/> <sysproperty key="webtest.home" value="${maven.webtest.home}"/> + <util:tokenize var="listOfProperties" delim=" ">${maven.webtest.sysproperties}</util:tokenize> + <j:forEach var="someProperty" items="${listOfProperties}"> + <sysproperty key="${someProperty}" value="${context.getVariable(someProperty)}"/> + </j:forEach> <arg value="${maven.webtest.ant.options}"/> <arg value="-f"/> <arg value="${testScriptFile}"/> 1.17 +7 -1 maven-plugins/webtest/project.xml Index: project.xml =================================================================== RCS file: /cvsroot/maven-plugins/maven-plugins/webtest/project.xml,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- project.xml 19 Nov 2004 11:01:40 -0000 1.16 +++ project.xml 19 Nov 2004 13:39:08 -0000 1.17 @@ -76,7 +76,12 @@ </developers> <dependencies> - + <dependency> + <groupId>commons-jelly</groupId> + <artifactId>commons-jelly-tags-interaction</artifactId> + <version>1.0</version> + </dependency> + <dependency> <groupId>ant</groupId> <artifactId>ant</artifactId> @@ -125,6 +130,7 @@ <url></url> </dependency> + <dependency> <groupId>jtidy</groupId> <artifactId>jtidy</artifactId> |