You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by vm...@apache.org on 2004/06/12 16:09:36 UTC
cvs commit: maven-plugins/abbot plugin.jelly .cvsignore project.properties project.xml plugin.properties
vmassol 2004/06/12 07:09:36
Added: abbot plugin.jelly .cvsignore project.properties
project.xml plugin.properties
Log:
Moving abbot plugin from plugins sandbox to plugins proper
Revision Changes Path
1.1 maven-plugins/abbot/plugin.jelly
Index: plugin.jelly
===================================================================
<?xml version="1.0"?>
<!--
/* ====================================================================
* Copyright 2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ====================================================================
*/
-->
<!--
========================================================================
Abbot plugin. Abbot is a GUI testing framework for AWT/Swing
applications.
========================================================================
-->
<project
xmlns:j="jelly:core"
xmlns:m="jelly:maven"
xmlns:x="jelly:xml"
xmlns:u="jelly:util"
xmlns:ant="jelly:ant"
xmlns:doc="doc"
xmlns:define="jelly:define"
xmlns:jsl="jelly:jsl">
<!--
========================================================================
Default goal. Execute the Abbot tests.
========================================================================
-->
<goal name="abbot" prereqs="abbot:test" description="Run the abbot tests"/>
<!--
========================================================================
Execute the Abbot tests by running the application locally.
========================================================================
-->
<goal name="abbot:test"
prereqs="abbot:check-env,abbot:prepare-filesystem,abbot:prepare-resources,java:compile,java:jar-resources"
description="Run the abbot tests">
<!-- Needed to define junit task -->
<taskdef name="junit"
classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask">
<classpath>
<pathelement location="${plugin.getDependencyPath('junit:junit')}"/>
</classpath>
</taskdef>
<!-- Just let JUnit execute the tests -->
<!-- IMPORTANT: We must fork the JUnit tests. Otherwise there are classpath
problems (the version of xerces in the Maven root CL seems to be the
cause). -->
<junit printSummary="${maven.abbot.printSummary}"
failureProperty="maven.test.failure" fork="true">
<!-- Sys properties -->
<setProperty name="dir" value="${maven.abbot.dir}" />
<sysproperty key="maven.abbot.src.dir" value="${maven.abbot.src.dir}"/>
<sysproperty key="basedir" value="${basedir}"/>
<u:tokenize var="listOfProperties" delim=" ">${maven.abbot.sysproperties}</u:tokenize>
<j:forEach var="someProperty" items="${listOfProperties}">
<sysproperty key="${someProperty}" value="${context.getVariable(someProperty)}"/>
</j:forEach>
<!-- JVM args -->
<u:tokenize var="listOfJvmArgs" delim=" ">${maven.abbot.jvmargs}</u:tokenize>
<j:forEach var="somejvmarg" items="${listOfJvmArgs}">
<jvmarg value="${somejvmarg}"/>
</j:forEach>
<!-- File format of test reports are defined here -->
<formatter type="xml"/>
<formatter type="${maven.abbot.format}" usefile="${maven.abbot.usefile}"/>
<!-- Classpath -->
<classpath>
<pathelement location="${plugin.dir}"/>
<pathelement location="${maven.build.dest}"/>
<pathelement location="${maven.test.dest}"/>
<j:forEach var="dep" items="${plugin.getDependencies()}">
<j:if test="${dep.getProperty('abbot.webstart')}">
<pathelement path="${plugin.getDependencyPath(dep.Id)}"/>
</j:if>
</j:forEach>
<j:forEach var="lib" items="${pom.dependencies}">
<j:set var="libFullName" value="${lib.getId()}" />
<j:set var="jarPath" value="${maven.repo.local}/${lib.artifactDirectory}/${lib.getType()}s/${lib.getArtifact()}" />
<pathelement path="${jarPath}"/>
</j:forEach>
</classpath>
<test name="${maven.abbot.include}" todir="${maven.abbot.reports.dir}"/>
</junit>
<!-- Junit exit status is stored in maven.test.failure. Whenever it is true
(and ignore flag is not) we must stop the build process -->
<j:if test="${maven.test.failure}">
<j:if test="${context.getVariable('maven.test.failure.ignore') != null}">
<fail message="There were test failures"/>
</j:if>
</j:if>
</goal>
<!--
========================================================================
Launch tests on a webstart application
========================================================================
-->
<goal name="abbot:test-webstart" prereqs="abbot:check-webstart-env,abbot:prepare-filesystem"
description="Launch tests on a webstart application">
<!-- First we get the remote jnlp -->
<get src="${maven.abbot.remotejnlp}"
dest="${maven.abbot.dest.dir}/${maven.abbot.webstart.jnlp.original}"/>
<!-- We make a jar with compiled main class -->
<!-- TODO: create this as part of the plugin creation and not as part of
its execution -->
<jar destfile="${maven.abbot.dest.dir}/${maven.abbot.webstart.main.jar}"
basedir="${plugin.dir}" includes="**/*.class"/>
<!-- Iterating through dependencies, and signing them if they're not up-to-date -->
<j:if test="${context.getVariable('maven.abbot.sign')}">
<j:forEach var="dep" items="${plugin.getDependencies()}">
<j:if test="${dep.getProperty('abbot.webstart')}">
<j:set var="filename" value="${dep.GroupId}-${dep.ArtifactId}"/>
<j:set var="varname" value="abbot.signing.notrequired.${dep.id}"/>
<!-- Checking whether or not the dependency has to be signed -->
<uptodate property="${varname}"
srcfile="${plugin.getDependencyPath(dep.Id)}"
targetfile="${maven.abbot.dest.dir}/${filename}.jar"/>
<!-- Keeping this debug trace a while to ensure that the up-to-date feature is working properly -->
<echo level="debug">${dep.id} is uptodate ? ${context.getVariable(varname) == true}</echo>
<!-- Signing the dependancy only if it is not up-to-date or forced-->
<j:if test="${(context.getVariable(varname) != true)}">
<!-- Unsigning -->
<zip destfile="${maven.abbot.dest.dir}/${filename}.jar">
<zipfileset src="${plugin.getDependencyPath(dep.id)}"
excludes="**/*.SF **/*.RSA **/*.DSA"/>
</zip>
<!-- Signing -->
<signjar jar="${maven.abbot.dest.dir}/${filename}.jar"
keystore="${maven.abbot.sign.keystore}"
alias="${maven.abbot.sign.alias}"
storepass="${maven.abbot.sign.storepass}"/>
</j:if>
</j:if>
</j:forEach>
<!-- Jar containing abbot main class is signed -->
<signjar jar="${maven.abbot.dest.dir}/${maven.abbot.webstart.main.jar}"
keystore="${maven.abbot.sign.keystore}"
alias="${maven.abbot.sign.alias}"
storepass="${maven.abbot.sign.storepass}"/>
</j:if>
<!-- Jnlp is modified so that local abbot libraries are referenced -->
<doc:jsl
input="${maven.abbot.dest.dir}/${maven.abbot.webstart.jnlp.original}"
output="${maven.abbot.webstart.jnlp.modified}"
outputDirectory="${maven.abbot.dest.dir}"
stylesheet="${plugin.resources}/jnlp.jsl"
outputMode="xml"
prettyPrint="true"/>
<!-- Java webstart is launched on local modified jnlp -->
<java classname="com.sun.javaws.Main" fork="true" failonerror="true">
<classpath>
<pathelement location="${env.JAVAWS_HOME}/javaws-l10n.jar"/>
<pathelement location="${env.JAVAWS_HOME}/javaws.jar"/>
</classpath>
<jvmarg value="-Djnlpx.home=${env.JAVAWS_HOME}"/>
<jvmarg value="-Djnlpx.heapsize=NULL,NULL"/>
<jvmarg value="-Djnlpx.jvm=${env.JAVA_HOME}/bin/javaw.exe"/>
<jvmarg value="-Djnlpx.deployment.system.home=${maven.abbot.javaws.systemhome}"/>
<jvmarg value="-Djnlpx.deployment.user.home=${maven.abbot.javaws.userhome}"/>
<jvmarg value="-Djava.security.policy=${env.JAVAWS_HOME}/javaws.policy"/>
<jvmarg value="-DtrustProxy=true"/>
<arg value="${maven.abbot.dest.dir}/${maven.abbot.webstart.jnlp.modified}"/>
</java>
</goal>
<!--
========================================================================
Launch Abbot costello editor
========================================================================
-->
<goal name="abbot:editor" prereqs="abbot:check-env,abbot:prepare-filesystem"
description="Launch Abbot costello editor">
<!-- Launching abbot editor with abbot and jnlp dependencies as classpath -->
<java classname="abbot.editor.ScriptEditor" fork="true">
<classpath>
<!-- Abbot editor dependencies -->
<j:forEach var="dep" items="${plugin.getDependencies()}">
<j:if test="${dep.getProperty('abbot.editor')}">
<pathelement path="${plugin.getDependencyPath(dep.Id)}"/>
</j:if>
</j:forEach>
<path refid="maven.dependency.classpath"/>
</classpath>
</java>
</goal>
<!--
========================================================================
Launch Abbot costello editor on a webstart application
========================================================================
-->
<goal name="abbot:editor-webstart"
prereqs="abbot:check-webstart-env,abbot:prepare-filesystem"
description="Launch Abbot costello editor on a webstart application">
<!-- First we get the remote jnlp -->
<get src="${maven.abbot.remotejnlp}"
dest="${maven.abbot.dest.dir}/${maven.abbot.webstart.jnlp.original}"/>
<!-- Parsing jnlp file in order to copy all dependencies into local directory -->
<u:file var="inputFile" name="${maven.abbot.dest.dir}/${maven.abbot.webstart.jnlp.original}"/>
<x:parse var="parsedfile" xml="${inputFile}"/>
<x:set var="codebasename" select="string($parsedfile/jnlp/@codebase)"/>
<x:forEach var="jar" select="$parsedfile/jnlp/resources/jar">
<x:set var="jarname" select="string($jar/@href)"/>
<get src="${codebasename}/${jarname}" usetimestamp="true"
dest="${maven.abbot.dest.dir}/${jarname}"/>
</x:forEach>
<!-- Launching abbot editor with abbot and jnlp dependencies as classpath -->
<java classname="abbot.editor.ScriptEditor" fork="true">
<classpath>
<!-- Abbot editor dependencies -->
<j:forEach var="dep" items="${plugin.getDependencies()}">
<j:if test="${dep.getProperty('abbot.editor')}">
<pathelement path="${plugin.getDependencyPath(dep.Id)}"/>
</j:if>
</j:forEach>
<!-- Remote application dependencies -->
<x:forEach var="jar" select="$parsedfile/jnlp/resources/jar">
<x:set var="jarname" select="string($jar/@href)"/>
<pathelement path="${maven.abbot.dest.dir}/${jarname}"/>
</x:forEach>
</classpath>
</java>
</goal>
<!--
========================================================================
Copy test resources to test directory (internal goal)
========================================================================
-->
<goal name="abbot:prepare-resources" prereqs="abbot:prepare-filesystem">
<j:if test="${pom.build.unitTest != null}">
<j:if test="${!pom.build.unitTest.resources.isEmpty()}">
<m:copy-resources
resources="${pom.build.unitTest.resources}"
todir="${maven.test.dest}"/>
</j:if>
</j:if>
</goal>
<!--
========================================================================
Create needed directories (internal goal)
========================================================================
-->
<goal name="abbot:prepare-filesystem">
<mkdir dir="${maven.test.dest}"/>
<mkdir dir="${maven.abbot.reports.dir}"/>
<mkdir dir="${maven.abbot.dest.dir}"/>
</goal>
<!--
========================================================================
Checking environment (internal goal)
========================================================================
-->
<goal name="abbot:check-env">
<j:if test="${context.getVariable('java.awt.headless') == true}">
<fail message="Abbot plugin cannot be used in awt headless environment"/>
</j:if>
</goal>
<!--
========================================================================
Checking webstart environment (internal goal)
========================================================================
-->
<goal name="abbot:check-webstart-env" prereqs="abbot:check-env">
<property environment="env"/>
<j:if test="${context.getVariable('env.JAVAWS_HOME') == null}">
<fail>Mandatory environment variable JAVAWS_HOME must be set</fail>
</j:if>
<j:if test="${context.getVariable('maven.abbot.sign') == false}">
<fail>In the current version the Abbot plugin only works when signing jars</fail>
</j:if>
<j:if test="${context.getVariable('maven.abbot.remotejnlp') == null}">
<fail>Mandatory variable maven.abbot.remotejnlp is missing."</fail>
</j:if>
<j:if test="${context.getVariable('maven.abbot.javaws.systemhome') == null}">
<fail>Mandatory variable maven.abbot.javaws.systemhome is missing"</fail>
</j:if>
<j:if test="${context.getVariable('maven.abbot.javaws.userhome') == null}">
<fail>Mandatory variable maven.abbot.javaws.userhome is missing</fail>
</j:if>
</goal>
<!--
========================================================================
Dependency handle so that other plugins can load this plugin and its
properties. This is especially useful if another plugin needs to
modify one property of the Abbot plugin.
========================================================================
-->
<define:taglib uri="abbot">
<define:tag name="dependency-handle">
<!-- Use this tag to allow this plugin to be loaded into another -->
</define:tag>
</define:taglib>
</project>
1.1 maven-plugins/abbot/.cvsignore
Index: .cvsignore
===================================================================
target
build.properties
.classpath
.project
1.1 maven-plugins/abbot/project.properties
Index: project.properties
===================================================================
# -------------------------------------------------------------------
# Copyright 2004 The Apache Software Foundation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# -------------------------------------------------------------------
maven.xdoc.date=left
maven.xdoc.version=${pom.currentVersion}
maven.license.licenseFile=${basedir}/../LICENSE.txt
maven.checkstyle.header.file = ${basedir}/../LICENSE.txt
maven.abbot.reports.dir = ${maven.build.dir}
# Have the abbot test reports appear in ${maven.abbot.reports.dir}
maven.junit.sysproperties = maven.abbot.reports.dir
# Fork so that the plugin unit tests are run with the correct classpath
maven.junit.fork = true
1.1 maven-plugins/abbot/project.xml
Index: project.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<!--
/*
* Copyright 2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-->
<project>
<extend>../project.xml</extend>
<pomVersion>3</pomVersion>
<id>maven-abbot-plugin</id>
<name>Maven Abbot plugin</name>
<currentVersion>1.0-SNAPSHOT</currentVersion>
<description>Run Abbot tests</description>
<shortDescription>Abbot Tests</shortDescription>
<url>http://maven.apache.org/reference/plugins/abbot/</url>
<issueTrackingUrl>http://jira.codehaus.org/secure/BrowseProject.jspa?id=10550</issueTrackingUrl>
<siteDirectory>/www/maven.apache.org/reference/plugins/abbot/</siteDirectory>
<repository>
<connection>scm:cvs:pserver:anoncvs@cvs.apache.org:/home/cvspublic:maven-plugins/abbot/</connection>
<url>http://cvs.apache.org/viewcvs/maven-plugins/abbot/</url>
</repository>
<versions>
<version>
<id>1.0</id>
<name>1.0</name>
<tag>HEAD</tag>
</version>
</versions>
<developers>
<developer>
<name>Christian Blavier</name>
<id>cblavier</id>
<email>christian.blavier@bnpparibas.fr</email>
<organization>BNP Paribas</organization>
<roles>
<role>Creator</role>
<role>Java Developer</role>
</roles>
</developer>
<developer>
<name>Vincent Massol</name>
<id>vmassol</id>
<email>vmassol@pivolis.com</email>
<organization>Pivolis</organization>
<roles>
<role>Creator</role>
<role>Java Developer</role>
<role>Release Manager</role>
</roles>
</developer>
</developers>
<contributors/>
<dependencies>
<dependency>
<groupId>abbot</groupId>
<artifactId>abbot</artifactId>
<version>0.12.3</version>
<properties>
<abbot.editor>true</abbot.editor>
<abbot.webstart>true</abbot.webstart>
</properties>
</dependency>
<dependency>
<groupId>jdom</groupId>
<artifactId>jdom</artifactId>
<version>1.0b8</version>
<properties>
<abbot.editor>true</abbot.editor>
<abbot.webstart>true</abbot.webstart>
</properties>
</dependency>
<!-- Required for the Costello editor -->
<dependency>
<groupId>mrj</groupId>
<artifactId>MRJToolkitStubs</artifactId>
<version>unknown</version>
<properties>
<abbot.editor>true</abbot.editor>
</properties>
</dependency>
<dependency>
<groupId>gnu-regexp</groupId>
<artifactId>gnu-regexp</artifactId>
<version>1.1.4</version>
<properties>
<abbot.editor>true</abbot.editor>
</properties>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<properties>
<abbot.editor>true</abbot.editor>
<abbot.webstart>true</abbot.webstart>
</properties>
</dependency>
<dependency>
<groupId>xerces</groupId>
<artifactId>xerces</artifactId>
<version>2.4.0</version>
<properties>
<abbot.editor>true</abbot.editor>
<abbot.webstart>true</abbot.webstart>
</properties>
</dependency>
<dependency>
<groupId>xerces</groupId>
<artifactId>xmlParserAPIs</artifactId>
<version>2.2.1</version>
<properties>
<abbot.editor>true</abbot.editor>
<abbot.webstart>true</abbot.webstart>
</properties>
</dependency>
<dependency>
<groupId>ant</groupId>
<artifactId>ant</artifactId>
<version>1.5.3-1</version>
<properties>
<abbot.webstart>true</abbot.webstart>
</properties>
</dependency>
<dependency>
<groupId>ant</groupId>
<artifactId>ant-optional</artifactId>
<version>1.5.3-1</version>
<properties>
<abbot.webstart>true</abbot.webstart>
</properties>
</dependency>
</dependencies>
<reports>
<report>maven-changes-plugin</report>
<report>maven-changelog-plugin</report>
<report>maven-file-activity-plugin</report>
<report>maven-developer-activity-plugin</report>
<report>maven-file-activity-plugin</report>
<report>maven-license-plugin</report>
<report>maven-linkcheck-plugin</report>
</reports>
</project>
1.1 maven-plugins/abbot/plugin.properties
Index: plugin.properties
===================================================================
# -------------------------------------------------------------------
# Copyright 2004 The Apache Software Foundation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# -------------------------------------------------------------------
# -------------------------------------------------------------------
# Properties required for all the abbot plugin goals
# -------------------------------------------------------------------
# Location of abbot source scripts
maven.abbot.src.dir = ${maven.src.dir}/abbot
# (optional) Explicit comma-separated list of Abbot source scripts
# to execute. If not defined, the plugin will execute all .xml files
# located in maven.abbot.src.dir
# maven.abbot.src.files =
# Decide whether or not to recurse in maven.abbot.src.dir to find
# Abbot .xml source scripts.
maven.abbot.recurse = true
# Location where the abbot plugin puts build files related to abbot
maven.abbot.dest.dir = ${maven.build.dir}/abbot
# Location where abbot junit test results will be located
maven.abbot.reports.dir = ${maven.build.dir}/abbot-reports
maven.abbot.printSummary = ${maven.junit.printSummary}
maven.abbot.dir = ${maven.junit.dir}
maven.abbot.sysproperties = ${maven.junit.sysproperties}
maven.abbot.jvmargs = ${maven.junit.jvmargs}
maven.abbot.format = ${maven.junit.format}
maven.abbot.usefile = ${maven.junit.usefile}
# (optional) Name of the test suite beeing executed. This name will be used
# to name the generated JUnit test report. If not specified the report name
# will be TEST-org.apache.maven.abbot.AbbotTestAll. This is useful when
# you're calling the Abbot plugin several times in a row as otherwise the
# reports will overwrite each other.
#maven.abbot.suite.name = MyTestSuite
# Decide whether to turn on webstart debugging.
maven.abbot.debug = false
# -------------------------------------------------------------------
# Properties required only for the abbot:test goal
# -------------------------------------------------------------------
# Name of the JUnit test to execute that will trigger the execution
# of the Abbot scripts. This name should not be changed unless you
# want to provide your own Abbot script wrapper.
maven.abbot.include = org.apache.maven.abbot.AbbotTestAll
# -------------------------------------------------------------------
# Properties required only for the abbot:test-webstart goal
# -------------------------------------------------------------------
# The following properties are mandatories. They depend on your
# execution environment and must be set in your build.properties file
# or equivalent:
#
# - JAVAWS_HOME: You MUST define this environment variable and have it
# point to where Java Webstart is installed on your machine.
# For example: c:\apps\j2sdk1.4.2_01\jre\javaws
# - maven.abbot.remotejnlp: This property points to the JNLP file of
# the application you're testing.
# - maven.abbot.javaws.systemhome: Java webstart system cache location
# - maven.abbot.javaws.userhome: Java webstart user cache location
maven.abbot.webstart.jnlp.original = original.jnlp
maven.abbot.webstart.jnlp.modified = modified.jnlp
maven.abbot.webstart.main.jar = abbot-main.jar
maven.abbot.webstart.main.class = org.apache.maven.abbot.AbbotWebstartTestRunner
# Note: For now we only support signing jars. The reason is that we need
# to add the Abbot jars to the JNLP file and as we're taking these jars
# from the local file system we need to have the permissions and thus we
# need signed jars to get these permissions.
maven.abbot.sign = true
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org