From: Siegfried G. <wd...@us...> - 2004-10-12 13:29:00
|
wdsgoe 04/10/12 06:27:32 Modified: webtest project.xml plugin.jelly Log: Preparing release 0.9.1 Revision Changes Path 1.13 +38 -37 maven-plugins/webtest/project.xml Index: project.xml =================================================================== RCS file: /cvsroot/maven-plugins/maven-plugins/webtest/project.xml,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- project.xml 12 Apr 2004 10:56:58 -0000 1.12 +++ project.xml 12 Oct 2004 13:27:32 -0000 1.13 @@ -6,12 +6,12 @@ <id>maven-webtest-plugin</id> <name>Canoo WebTest Plug-in</name> <!-- groupId is in parent --> - <currentVersion>0.8</currentVersion> + <currentVersion>0.9.1</currentVersion> <!-- organization is in parent --> <inceptionYear>2002</inceptionYear> <!-- package, logo are in parent. no gumpRepositoryId --> <description>Maven Plugin for Canoo WebTest</description> - <shortDescription>Maven B10 Plugin for Canoo WebTest</shortDescription> + <shortDescription>Maven 1.0 Plugin for Canoo WebTest</shortDescription> <!-- issue tracking url, siteAddress are in parent --> <siteDirectory>/home/groups/m/ma/maven-plugins/htdocs/webtest/</siteDirectory> <distributionDirectory>/home/groups/m/ma/maven-plugins/htdocs/webtest/distributions/</distributionDirectory> @@ -68,31 +68,34 @@ </developers> <dependencies> - <dependency> - <groupId>webtest</groupId> - <artifactId>webtest</artifactId> - <version>277</version> - <url>http://webtest.canoo.com</url> - </dependency> - - <dependency> - <id>oro</id> - <version>2.0.6</version> - </dependency> - + <dependency> <groupId>ant</groupId> <artifactId>ant</artifactId> - <version>1.5.1</version> - <url>http://jakarta.apache.org/ant</url> + <version>1.5.2</version> + <url>http://jakarata.apache.org/ant</url> </dependency> + <dependency> <groupId>ant</groupId> <artifactId>ant-optional</artifactId> - <version>1.5.1</version> - <url>http://jakarta.apache.org/ant</url> + <version>1.5.2</version> + <url>http://jakarata.apache.org/ant</url> </dependency> - + + <dependency> + <groupId>dom4j</groupId> + <artifactId>dom4j</artifactId> + <version>1.4</version> + <url>http://www.dom4j.org</url> + </dependency> + + <dependency> + <groupId>jtidy</groupId> + <artifactId>jtidy</artifactId> + <version>4aug2000r7-dev</version> + </dependency> + <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> @@ -101,34 +104,33 @@ </dependency> <dependency> - <groupId>dom4j</groupId> - <artifactId>dom4j</artifactId> - <version>1.3</version> - <url>http://www.dom4j.org</url> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + <version>1.2.8</version> </dependency> - - <!-- Note: NekoHTML and Xerces are needed by HttpUnit --> <dependency> - <groupId>httpunit</groupId> - <artifactId>httpunit</artifactId> - <version>1.5.3</version> - <url>http://www.httpunit.org</url> + <groupId>oro</groupId> + <artifactId>oro</artifactId> + <version>2.0.6</version> </dependency> + <dependency> - <groupId>nekohtml</groupId> - <artifactId>nekohtml</artifactId> - <version>0.7.4</version> + <groupId>xalan</groupId> + <artifactId>xalan</artifactId> + <version>2.5.1</version> </dependency> + <dependency> <groupId>xerces</groupId> <artifactId>xercesImpl</artifactId> - <version>2.3.0</version> + <version>2.4.0</version> </dependency> + <dependency> - <groupId>xerces</groupId> - <artifactId>xmlParserAPIs</artifactId> - <version>2.2.1</version> + <groupId>xml-apis</groupId> + <artifactId>xml-apis</artifactId> + <version>1.0.b2</version> </dependency> </dependencies> @@ -171,7 +173,6 @@ <report>maven-developer-activity-plugin</report> <report>maven-file-activity-plugin</report> <report>maven-license-plugin</report> - <!-- report>maven-webtest-plugin</report --> </reports> </project> 1.8 +157 -151 maven-plugins/webtest/plugin.jelly Index: plugin.jelly =================================================================== RCS file: /cvsroot/maven-plugins/maven-plugins/webtest/plugin.jelly,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- plugin.jelly 10 Aug 2003 13:59:33 -0000 1.7 +++ plugin.jelly 12 Oct 2004 13:27:32 -0000 1.8 @@ -1,9 +1,9 @@ <?xml version="1.0"?> -<project - xmlns:j="jelly:core" - xmlns:util="jelly:util" - xmlns:doc="doc" +<project + xmlns:j="jelly:core" + xmlns:util="jelly:util" + xmlns:doc="doc" xmlns:x="jelly:xml"> <!-- ================================================================== --> @@ -11,9 +11,9 @@ <!-- ================================================================== --> <goal name="maven-webtest-plugin:register"> <util:available file="${maven.webtest.src}"> - <doc:registerReport name="Canoo WebTest Report" - pluginName="webtest" - description="Canoo WebTest Report." + <doc:registerReport name="Canoo WebTest Report" + pluginName="webtest" + description="Canoo WebTest Report." link="webtest-report"/> </util:available> </goal> @@ -30,53 +30,75 @@ <!-- ================================================================== --> <!-- W E B T E S T T A R G E T --> <!-- ================================================================== --> - + + <!-- ================================================================== --> + <!-- webtest:report --> + <!-- ================================================================== --> + <goal name="webtest:report" description="Run Canoo WebTest"> <attainGoal name="webtest"/> </goal> - + + <!-- ================================================================== --> + <!-- webtest --> + <!-- ================================================================== --> + <goal name="webtest" description="Run Canoo WebTest"> <j:set var="testCaseName" value="${maven.webtest.file}"/> <!-- if no webtest script is defined skip the processing --> - <j:if test="${!testCaseName.equals('noop')}"> - <attainGoal name="webtest:clean"/> + <j:if test="${!testCaseName.equals('noop')}"> + <attainGoal name="webtest:clean"/> <attainGoal name="webtest:info"/> <attainGoal name="webtest:test"/> <attainGoal name="webtest:generate-test-report"/> - <attainGoal name="webtest:generate-summary-report"/> </j:if> </goal> - - <goal name="webtest:info" description="Prints the configuration"> + + <!-- ================================================================== --> + <!-- webtest:info --> + <!-- ================================================================== --> + + <goal name="webtest:info" description="Prints the configuration"> <echo> + Plugin Settings + =============================================================================== + maven.webtest.src = ${maven.webtest.src} + maven.webtest.file = ${maven.webtest.file} + maven.webtest.target = ${maven.webtest.target} maven.webtest.src = ${maven.webtest.src} - maven.webtest.file = ${maven.webtest.file} - maven.webtest.target = ${maven.webtest.target} - maven.webtest.src = ${maven.webtest.src} + maven.webtest.ant.options = ${maven.webtest.ant.options} + maven.webtest.home = ${maven.webtest.home} + + Canoo WebTest Configuration + =============================================================================== maven.webtest.config.host = ${maven.webtest.config.host} maven.webtest.config.port = ${maven.webtest.config.port} - maven.webtest.config.protocol = ${maven.webtest.config.protocol} + maven.webtest.config.protocol = ${maven.webtest.config.protocol} maven.webtest.config.basepath = ${maven.webtest.config.basepath} maven.webtest.config.summary = ${maven.webtest.config.summary} - maven.webtest.config.verbose = ${maven.webtest.config.verbose} maven.webtest.config.saveresponse = ${maven.webtest.config.saveresponse} - maven.webtest.config.resultpath = ${maven.webtest.config.resultpath} + maven.webtest.config.resultpath = ${maven.webtest.config.resultpath} maven.webtest.config.resultfile = ${maven.webtest.config.resultfile} - maven.webtest.config.showhtmlparseroutput = ${maven.webtest.config.showhtmlparseroutput} + maven.webtest.config.showhtmlparseroutput = ${maven.webtest.config.showhtmlparseroutput} maven.webtest.config.haltonfailure = ${maven.webtest.config.haltonfailure} maven.webtest.config.haltonerror = ${maven.webtest.config.haltonerror} - maven.webtest.ant.options = ${maven.webtest.ant.options} + maven.webtest.config.verbose = ${maven.webtest.config.verbose} + maven.webtest.config.autorefresh = ${maven.webtest.config.autorefresh} </echo> </goal> - <goal name="webtest:test" description="Runs the Canoo webtest scripts"> + <!-- ================================================================== --> + <!-- webtest:test --> + <!-- ================================================================== --> + + <goal name="webtest:test" description="Runs the Canoo webtest scripts"> + + <j:set var="mavenRepoLocal" value='${context.getVariable("maven.repo.local")}'/> - <j:set var="mavenRepoLocal" value='${context.getVariable("maven.repo.local")}'/> - <!-- Create the result path --> <mkdir dir="${maven.webtest.config.resultpath}"/> - - <!-- Create an iterator over all webtest scripts to be executed --> + + <!-- Create an iterator over all webtest scripts to be executed --> <fileScanner var="testScripts"> <fileset dir="${maven.webtest.src}"> <patternset> @@ -88,173 +110,157 @@ <echo>Starting Canoo Webtest ...</echo> <path id="webtest.classpath"> - <pathelement location="${maven.build.dest}"/> - <pathelement path="${pom.getDependencyClasspath()}"/> <pathelement path="${plugin.getDependencyClasspath()}"/> + <pathelement location="${plugin.dir}/plugin-resources/classes"/> </path> - <!-- - On UNIX we seem to have a problem with empty command + <!-- + On UNIX we seem to have a problem with empty command line parameters. Therefore we explicitely check for them and start ANT accordingly --> - + <j:set var="hasAntTarget" value="${maven.webtest.target}X"/> - - <j:forEach var="testScriptFile" items="${testScripts.iterator()}"> - <!-- echo>Processing ${testScriptFile.getName()}</echo --> - <!-- Start an ANT process for each webtest script --> + + <j:forEach var="testScriptFile" items="${testScripts.iterator()}"> + <!-- echo>Processing ${testScriptFile.getName()}</echo --> + <!-- Start an ANT process for each webtest script --> <j:if test="${hasAntTarget != 'X'}"> - <echo>We have an Ant target!!!</echo> - <java classname="org.apache.tools.ant.Main" fork="yes" dir="${basedir}" failonerror="false"> + <java classname="org.apache.tools.ant.Main" fork="yes" dir="${basedir}" failonerror="true"> <classpath> <path refid="webtest.classpath"/> </classpath> - <sysproperty key="host" value="${maven.webtest.config.host}"/> - <sysproperty key="port" value="${maven.webtest.config.port}"/> - <sysproperty key="protocol" value="${maven.webtest.config.protocol}"/> - <sysproperty key="basepath" value="${maven.webtest.config.basepath}"/> - <sysproperty key="summary" value="${maven.webtest.config.summary}"/> - <sysproperty key="verbose" value="${maven.webtest.config.verbose}"/> - <sysproperty key="saveresponse" value="${maven.webtest.config.saveresponse}"/> - <sysproperty key="resultpath" file="${maven.webtest.config.resultpath}"/> - <sysproperty key="resultfile" file="${maven.webtest.config.resultfile}"/> - <sysproperty key="haltonfailure" value="${maven.webtest.config.haltonfailure}"/> - <sysproperty key="haltonerror" value="${maven.webtest.config.haltonerror}"/> - <sysproperty key="showhtmlparseroutput" value="${maven.webtest.config.showhtmlparseroutput}"/> - <arg value="${maven.webtest.ant.options}"/> - <arg value="-f"/> + <jvmarg value="-Xmx200m"/> + <sysproperty key="host" value="${maven.webtest.config.host}"/> + <sysproperty key="port" value="${maven.webtest.config.port}"/> + <sysproperty key="protocol" value="${maven.webtest.config.protocol}"/> + <sysproperty key="basepath" value="${maven.webtest.config.basepath}"/> + <sysproperty key="summary" value="${maven.webtest.config.summary}"/> + <sysproperty key="saveresponse" value="${maven.webtest.config.saveresponse}"/> + <sysproperty key="resultpath" value="${maven.webtest.config.resultpath}"/> + <sysproperty key="resultfile" value="${maven.webtest.config.resultfile}"/> + <sysproperty key="haltonfailure" value="${maven.webtest.config.haltonfailure}"/> + <sysproperty key="haltonerror" value="${maven.webtest.config.haltonerror}"/> + <sysproperty key="showhtmlparseroutput" value="${maven.webtest.config.showhtmlparseroutput}"/> + <sysproperty key="verbose" value="${maven.webtest.config.verbose}"/> + <sysproperty key="autorefresh" value="${maven.webtest.config.autorefresh}"/> + <sysproperty key="webtest.home" value="${maven.webtest.home}"/> + <arg value="${maven.webtest.ant.options}"/> + <arg value="-f"/> <arg value="${testScriptFile}"/> <arg value="${maven.webtest.target}"/> </java> </j:if> <j:if test="${hasAntTarget == 'X'}"> - <echo>We have NO Ant target!!</echo> - <java classname="org.apache.tools.ant.Main" fork="yes" dir="${basedir}" failonerror="false"> + <java classname="org.apache.tools.ant.Main" fork="yes" dir="${basedir}" failonerror="true"> <classpath> <path refid="webtest.classpath"/> </classpath> - <sysproperty key="host" value="${maven.webtest.config.host}"/> - <sysproperty key="port" value="${maven.webtest.config.port}"/> - <sysproperty key="protocol" value="${maven.webtest.config.protocol}"/> - <sysproperty key="basepath" value="${maven.webtest.config.basepath}"/> - <sysproperty key="summary" value="${maven.webtest.config.summary}"/> - <sysproperty key="verbose" value="${maven.webtest.config.verbose}"/> - <sysproperty key="saveresponse" value="${maven.webtest.config.saveresponse}"/> - <sysproperty key="resultpath" file="${maven.webtest.config.resultpath}"/> - <sysproperty key="resultfile" file="${maven.webtest.config.resultfile}"/> - <sysproperty key="haltonfailure" value="${maven.webtest.config.haltonfailure}"/> - <sysproperty key="haltonerror" value="${maven.webtest.config.haltonerror}"/> - <sysproperty key="showhtmlparseroutput" value="${maven.webtest.config.showhtmlparseroutput}"/> - <arg value="${maven.webtest.ant.options}"/> - <arg value="-f"/> + <jvmarg value="-Xmx200m"/> + <sysproperty key="host" value="${maven.webtest.config.host}"/> + <sysproperty key="port" value="${maven.webtest.config.port}"/> + <sysproperty key="protocol" value="${maven.webtest.config.protocol}"/> + <sysproperty key="basepath" value="${maven.webtest.config.basepath}"/> + <sysproperty key="summary" value="${maven.webtest.config.summary}"/> + <sysproperty key="saveresponse" value="${maven.webtest.config.saveresponse}"/> + <sysproperty key="resultpath" value="${maven.webtest.config.resultpath}"/> + <sysproperty key="resultfile" value="${maven.webtest.config.resultfile}"/> + <sysproperty key="haltonfailure" value="${maven.webtest.config.haltonfailure}"/> + <sysproperty key="haltonerror" value="${maven.webtest.config.haltonerror}"/> + <sysproperty key="showhtmlparseroutput" value="${maven.webtest.config.showhtmlparseroutput}"/> + <sysproperty key="verbose" value="${maven.webtest.config.verbose}"/> + <sysproperty key="autorefresh" value="${maven.webtest.config.autorefresh}"/> + <sysproperty key="webtest.home" value="${maven.webtest.home}"/> + <arg value="${maven.webtest.ant.options}"/> + <arg value="-f"/> <arg value="${testScriptFile}"/> </java> - </j:if> - </j:forEach> - - <echo>Finished running Canoo Webtest Plugin</echo> - + </j:if> + </j:forEach> + + <echo>Finished running Canoo Webtest Plugin 0.9.1</echo> + </goal> + <!-- ================================================================== --> + <!-- webtest:generate-test-report --> + <!-- ================================================================== --> <goal name="webtest:generate-test-report" description="Transforms the Canoo Webtest results into HTML"> - <!-- Create the result path --> - <j:set var="webtest.docs.dest" - value="${pom.getPluginContext('maven-xdoc-plugin').getVariable('maven.docs.dest')}/webtest"/> - <j:set var="webtest.gen.docs" - value="${pom.getPluginContext('maven-xdoc-plugin').getVariable('maven.gen.docs')}/webtest"/> - <mkdir dir="${webtest.docs.dest}"/> - <mkdir dir="${webtest.gen.docs}"/> + <!-- Determine the result directory --> + <j:set var="webtest.docs.dest" value="${pom.getPluginContext('maven-xdoc-plugin').getVariable('maven.docs.dest')}"/> + <j:set var="webtest.resource.dest" value="${webtest.docs.dest}/webtest"/> - <!-- Copy all responses --> - <copy todir="${webtest.docs.dest}/response"> + <!-- Create the result directory --> + <mkdir dir="${webtest.docs.dest}"/> + <mkdir dir="${webtest.docs.dest}/webtest"/> + + <!-- Copy all of the HTML responses --> + <copy todir="${webtest.resource.dest}/response"> <fileset dir="${maven.webtest.config.resultpath}" includes="*.html"/> </copy> - - <!-- Create an iterator over all test summary reports , i.e. all XML files --> - <fileScanner var="testSummaries"> - <fileset dir="${maven.webtest.config.resultpath}"> - <include name="*.xml"/> - </fileset> - </fileScanner> - <j:forEach var="testSummaryFile" items="${testSummaries.iterator()}"> - <echo>Transforming ${testSummaryFile.getName()} into XDOC ...</echo> - <doc:jsl input="${testSummaryFile}" output="webtest/${testSummaryFile.getName()}" - stylesheet="${plugin.resources}/report.jsl" omitXmlDeclaration="true" - outputMode="xml" prettyPrint="true"/> - </j:forEach> - </goal> - - <goal name="webtest:generate-summary-report" - description="Creates a XDOC summary report of the Canoo Webtest results"> + <!-- Copy the images --> + <copy todir="${webtest.resource.dest}/images"> + <fileset dir="${maven.webtest.home}/images" includes="*.*"/> + </copy> - <echo>Summary</echo> + <!-- Copy the CSS --> + <copy todir="${webtest.resource.dest}/css"> + <fileset dir="${maven.webtest.home}/css" includes="*.*"/> + </copy> - <!-- Create the result path --> - <j:set var="webtest.docs.dest" - value="${pom.getPluginContext('maven-xdoc-plugin').getVariable('maven.docs.dest')}/webtest"/> - <j:set var="webtest.gen.docs" - value="${pom.getPluginContext('maven-xdoc-plugin').getVariable('maven.gen.docs')}/webtest"/> - <mkdir dir="${webtest.docs.dest}"/> - <mkdir dir="${webtest.gen.docs}"/> + <!-- Invoke XALAN to to the transformation --> + <java classname="org.apache.xalan.xslt.Process" fork="yes" failonerror="true"> + <classpath> + <pathelement path="${plugin.getDependencyPath('xalan')}"/> + <pathelement path="${plugin.getDependencyPath('xerces')}"/> + <pathelement path="${plugin.getDependencyPath('xml-apis')}"/> + </classpath> + <arg value="-in"/> + <arg value="${maven.webtest.config.resultpath}/webtest-raw-report.xml"/> + <arg value="-out"/> + <arg value="${webtest.docs.dest}/maven-webtest-report.html"/> + <arg value="-xsl"/> + <arg value="file:${plugin.dir}/plugin-resources/maven-webtest-report.xsl"/> + <arg value="-xsl"/> + <arg value="file:${plugin.dir}/plugin-resources/maven-webtest-report.xsl"/> + </java> - <!-- Create an iterator over all webtest summaries to be evaluated --> - <fileScanner var="testSummaries"> - <fileset dir="${maven.webtest.config.resultpath}"> - <patternset> - <include name="*.xml"/> - </patternset> - </fileset> - </fileScanner> - - <!-- Create an webtest summary reports as XML file --> - <j:file name="${maven.build.dir}/webtest-raw-report.xml" - outputMode="XML" encoding="ISO-8859-1" prettyPrint="true"> - <x:element name="summary"> - <j:forEach var="testSummaryFile" items="${testSummaries.iterator()}"> - <x:parse var="xmlTestReport" xml="${testSummaryFile}"/> - <x:set var="success" select="string($xmlTestReport/summary/testresult/@successful}"/> - <x:set var="starttime" select="string($xmlTestReport/summary/testresult/@starttime}"/> - <x:set var="endtime" select="string($xmlTestReport/summary/testresult/@endtime}"/> - <j:set var="duration"><x:expr select="sum($xmlTestReport/summary/testresult/results/step/result/completed/@duration)"/></j:set> - <x:element name="test"> - <x:element name="file">${testSummaryFile.getName()}</x:element> - <x:element name="success">${success}</x:element> - <x:element name="starttime">${starttime}</x:element> - <x:element name="endtime">${endtime}</x:element> - <x:element name="duration">${duration}</x:element> - </x:element> - </j:forEach> - </x:element> - </j:file> - - <!-- Transform the XML file into XDOC --> - <doc:jsl input="${maven.build.dir}/webtest-raw-report.xml" - output="webtest-report.xml" stylesheet="${plugin.resources}/summary.jsl" - omitXmlDeclaration="true" outputMode="xml" prettyPrint="true"/> - - </goal> - + </goal> + + <!-- ================================================================== --> + <!-- webtest:clean --> + <!-- ================================================================== --> + <goal name="webtest:clean" description="Removes temporary webtest files"> - <!-- Delete all of the previous left-overs --> + <!-- Delete all of the previous left-overs --> <delete failonerror="false"> <fileset dir="${maven.webtest.config.resultpath}" includes="lastResponse*.html"/> - <fileset dir="${maven.webtest.config.resultpath}" includes="*.xml"/> + <fileset dir="${maven.webtest.config.resultpath}" includes="*.xml"/> </delete> - <!-- Delete all of the previous HTML reports --> + <!-- Delete all of the previous HTML reports --> <delete failonerror="false"> <fileset dir="${webtest.dest}" includes="*.html"/> </delete> - + <delete file="${maven.build.dir}/webtest-raw-report.xml"/> <delete file="${webtest.dest}/webtest-report.html"/> - - </goal> - + + </goal> + + <!-- ================================================================== --> + <!-- webtest:loop --> + <!-- ================================================================== --> + + <goal name="webtest:loop" description="Executes the webtest until it fails"> + <j:while test="true"> + <attainGoal name="webtest:clean"/> + <attainGoal name="webtest:test"/> + </j:while> + </goal> </project> |