change test layout to allow multiple test-cases (one per sub-directory)
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@116156 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
897ca6ad4a
commit
b78f4ba691
@ -15,55 +15,8 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
-->
|
-->
|
||||||
<project xmlns:j="jelly:core"
|
<project xmlns:util="jelly:util" xmlns:maven="jelly:maven" xmlns:j="jelly:core" xmlns:assert="assert" xmlns:ant="jelly:ant">
|
||||||
xmlns:u="jelly:util"
|
<goal name="testPlugin">
|
||||||
xmlns:x="jelly:xml"
|
<maven:reactor basedir="${basedir}" includes="test*/project.xml" goals="testPlugin" banner="Test" ignoreFailures="false"/>
|
||||||
xmlns:assert="assert"
|
|
||||||
xmlns:j2ee="j2ee">
|
|
||||||
|
|
||||||
<goal name="testPlugin" prereqs="test-ear">
|
|
||||||
<attainGoal name="clean"/>
|
|
||||||
</goal>
|
|
||||||
|
|
||||||
<goal name="test-ear">
|
|
||||||
<attainGoal name="ear"/>
|
|
||||||
|
|
||||||
<!-- tests that the ear is generated -->
|
|
||||||
<assert:assertFileExists file="${maven.build.dir}/test-maven-ear-plugin-1.0-SNAPSHOT.ear"/>
|
|
||||||
|
|
||||||
<!-- unzip the ear and look for the jars -->
|
|
||||||
<j:set var="earFile"
|
|
||||||
value="${maven.build.dir}/test-maven-ear-plugin-1.0-SNAPSHOT.ear"/>
|
|
||||||
<j:set var="unzipDir" value= "${maven.build.dir}/eartest"/>
|
|
||||||
<mkdir dir="${unzipDir}"/>
|
|
||||||
<unzip src="${earFile}" dest="${unzipDir}"/>
|
|
||||||
|
|
||||||
<!-- check for commons-logging -->
|
|
||||||
<assert:assertFileExists file="${unzipDir}/commons-logging-1.0.3.jar"
|
|
||||||
msg="commons logging was not bundled"/>
|
|
||||||
|
|
||||||
<!-- check for commons-collections -->
|
|
||||||
<assert:assertFileExists file="${unzipDir}/commons-collections-2.1.jar"
|
|
||||||
msg="commons collections was not bundled"/>
|
|
||||||
|
|
||||||
<!-- check application.xml got a java module in it -->
|
|
||||||
<u:file var="appXml" name="${unzipDir}/META-INF/application.xml"/>
|
|
||||||
<j:new var="saxReader" className="org.dom4j.io.SAXReader" />
|
|
||||||
<j2ee:resolver var="resolver" />
|
|
||||||
${saxReader.setEntityResolver(resolver)}
|
|
||||||
<x:parse var="applicationDoc" xml="${appXml.toURL()}" SAXReader="${saxReader}" />
|
|
||||||
<x:set var="firstJavaModule" select="string($applicationDoc/application/module/java)"/>
|
|
||||||
|
|
||||||
<assert:assertEquals
|
|
||||||
expected="commons-collections-2.1.jar"
|
|
||||||
value="${firstJavaModule}"
|
|
||||||
msg="commons collections was not the first java module"/>
|
|
||||||
|
|
||||||
<!-- check for resources -->
|
|
||||||
<assert:assertFileExists file="${unzipDir}/resource.txt"/>
|
|
||||||
|
|
||||||
<!-- check for the LICENSE -->
|
|
||||||
<assert:assertFileExists file="${unzipDir}/META-INF/LICENSE.txt"/>
|
|
||||||
|
|
||||||
</goal>
|
</goal>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@ -21,79 +21,22 @@
|
|||||||
<project>
|
<project>
|
||||||
<pomVersion>3</pomVersion>
|
<pomVersion>3</pomVersion>
|
||||||
<name>Test project for Maven Ear Plugin</name>
|
<name>Test project for Maven Ear Plugin</name>
|
||||||
<id>test-maven-ear-plugin</id>
|
<groupId>maven</groupId>
|
||||||
<currentVersion>1.0-SNAPSHOT</currentVersion>
|
<currentVersion>1.0</currentVersion>
|
||||||
<organization>
|
<organization>
|
||||||
<name>Nettec</name>
|
<name>Apache Software Foundation</name>
|
||||||
<url>http://www.nettec.net</url>
|
<url>http://www.apache.org/</url>
|
||||||
|
<logo>http://maven.apache.org/images/apache-maven-project.png</logo>
|
||||||
</organization>
|
</organization>
|
||||||
<inceptionYear>2002</inceptionYear>
|
<inceptionYear>2001</inceptionYear>
|
||||||
<package>net.nettec.marsh.begin</package>
|
<package>org.apache.maven</package>
|
||||||
<shortDescription>Marsh Begin TTS Maven</shortDescription>
|
<logo>http://maven.apache.org/images/maven.gif</logo>
|
||||||
<description>TTS Begin</description>
|
<description>Test for Maven Ear plugin</description>
|
||||||
<url/>
|
<shortDescription>Test for Maven Ear plugin</shortDescription>
|
||||||
<issueTrackingUrl>http://bugzilla</issueTrackingUrl>
|
<url>http://maven.apache.org/reference/plugins/ear/</url>
|
||||||
<siteAddress>www.nettec.net</siteAddress>
|
<siteDirectory>/www/maven.apache.org/reference/plugins/ear/</siteDirectory>
|
||||||
<siteDirectory/>
|
|
||||||
<distributionDirectory/>
|
|
||||||
<repository>
|
<repository>
|
||||||
<connection>scm:cvs:pserver:anoncvs@cvs.apache.org:/home/cvspublic:maven</connection>
|
<connection>scm:cvs:pserver:anoncvs@cvs.apache.org:/home/cvspublic:maven-plugins/ear/</connection>
|
||||||
<url>http://cvs.apache.org/viewcvs/maven/</url>
|
<url>http://cvs.apache.org/viewcvs/maven-plugins/ear/</url>
|
||||||
</repository>
|
</repository>
|
||||||
<versions/>
|
</project>
|
||||||
<mailingLists/>
|
|
||||||
<developers>
|
|
||||||
<developer>
|
|
||||||
<name>Nathan Coast</name>
|
|
||||||
<id>nathanc</id>
|
|
||||||
<email>nathan.coast@blueyonder.co.uk</email>
|
|
||||||
<organization>Shadow Solutions</organization>
|
|
||||||
<role>Java Developer</role>
|
|
||||||
</developer>
|
|
||||||
</developers>
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>commons-logging</groupId>
|
|
||||||
<artifactId>commons-logging</artifactId>
|
|
||||||
<version>1.0.3</version>
|
|
||||||
<url>http://jakarta.apache.org/commons/logging.html</url>
|
|
||||||
<properties>
|
|
||||||
<ear.bundle>true</ear.bundle>
|
|
||||||
</properties>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>commons-collections</groupId>
|
|
||||||
<artifactId>commons-collections</artifactId>
|
|
||||||
<version>2.1</version>
|
|
||||||
<url>http://jakarta.apache.org/commons/collections/</url>
|
|
||||||
<properties>
|
|
||||||
<ear.module>true</ear.module>
|
|
||||||
</properties>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>commons-jelly</groupId>
|
|
||||||
<artifactId>commons-jelly-tags-xml</artifactId>
|
|
||||||
<version>20030211.142705</version>
|
|
||||||
</dependency>
|
|
||||||
<!-- Needed for the entity resolver -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>maven</groupId>
|
|
||||||
<artifactId>maven-j2ee-plugin</artifactId>
|
|
||||||
<version>1.4</version>
|
|
||||||
<type>plugin</type>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
<build>
|
|
||||||
<nagEmailAddress>nathan.coast@nettec.net</nagEmailAddress>
|
|
||||||
<sourceDirectory>src</sourceDirectory>
|
|
||||||
<unitTestSourceDirectory>src/test</unitTestSourceDirectory>
|
|
||||||
<!-- Resources that are packaged up inside the JAR file -->
|
|
||||||
<resources>
|
|
||||||
<resource>
|
|
||||||
<directory>src/resources</directory>
|
|
||||||
<targetPath></targetPath>
|
|
||||||
<includes><include>*.txt</include></includes>
|
|
||||||
</resource>
|
|
||||||
</resources>
|
|
||||||
</build>
|
|
||||||
</project>
|
|
||||||
69
ear/src/plugin-test/test01/maven.xml
Normal file
69
ear/src/plugin-test/test01/maven.xml
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
<!--
|
||||||
|
/*
|
||||||
|
* Copyright 2001-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 xmlns:j="jelly:core"
|
||||||
|
xmlns:u="jelly:util"
|
||||||
|
xmlns:x="jelly:xml"
|
||||||
|
xmlns:assert="assert"
|
||||||
|
xmlns:j2ee="j2ee">
|
||||||
|
|
||||||
|
<goal name="testPlugin" prereqs="test-ear">
|
||||||
|
<attainGoal name="clean"/>
|
||||||
|
</goal>
|
||||||
|
|
||||||
|
<goal name="test-ear">
|
||||||
|
<attainGoal name="ear"/>
|
||||||
|
|
||||||
|
<!-- tests that the ear is generated -->
|
||||||
|
<assert:assertFileExists file="${maven.build.dir}/${maven.final.name}.ear"/>
|
||||||
|
|
||||||
|
<!-- unzip the ear and look for the jars -->
|
||||||
|
<j:set var="earFile"
|
||||||
|
value="${maven.build.dir}/${maven.final.name}.ear"/>
|
||||||
|
<j:set var="unzipDir" value= "${maven.build.dir}/eartest"/>
|
||||||
|
<mkdir dir="${unzipDir}"/>
|
||||||
|
<unzip src="${earFile}" dest="${unzipDir}"/>
|
||||||
|
|
||||||
|
<!-- check for commons-logging -->
|
||||||
|
<assert:assertFileExists file="${unzipDir}/commons-logging-1.0.3.jar"
|
||||||
|
msg="commons logging was not bundled"/>
|
||||||
|
|
||||||
|
<!-- check for commons-collections -->
|
||||||
|
<assert:assertFileExists file="${unzipDir}/commons-collections-2.1.jar"
|
||||||
|
msg="commons collections was not bundled"/>
|
||||||
|
|
||||||
|
<!-- check application.xml got a java module in it -->
|
||||||
|
<u:file var="appXml" name="${unzipDir}/META-INF/application.xml"/>
|
||||||
|
<j:new var="saxReader" className="org.dom4j.io.SAXReader" />
|
||||||
|
<j2ee:resolver var="resolver" />
|
||||||
|
${saxReader.setEntityResolver(resolver)}
|
||||||
|
<x:parse var="applicationDoc" xml="${appXml.toURL()}" SAXReader="${saxReader}" />
|
||||||
|
<x:set var="firstJavaModule" select="string($applicationDoc/application/module/java)"/>
|
||||||
|
|
||||||
|
<assert:assertEquals
|
||||||
|
expected="commons-collections-2.1.jar"
|
||||||
|
value="${firstJavaModule}"
|
||||||
|
msg="commons collections was not the first java module"/>
|
||||||
|
|
||||||
|
<!-- check for resources -->
|
||||||
|
<assert:assertFileExists file="${unzipDir}/resource.txt"/>
|
||||||
|
|
||||||
|
<!-- check for the LICENSE -->
|
||||||
|
<assert:assertFileExists file="${unzipDir}/META-INF/LICENSE.txt"/>
|
||||||
|
|
||||||
|
</goal>
|
||||||
|
</project>
|
||||||
22
ear/src/plugin-test/test01/project.properties
Normal file
22
ear/src/plugin-test/test01/project.properties
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
# -------------------------------------------------------------------
|
||||||
|
# Copyright 2001-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.deployable.component=${maven.final.name}.ear
|
||||||
|
maven.j2ee.ear.appxml=${maven.conf.dir}/application.xml
|
||||||
|
maven.ear.appxml.generate=true
|
||||||
|
# note the override below is needed, as the ear plugin redefines the licenseFile in
|
||||||
|
# it's own project.properties, and running plugin:test would otherwise fail
|
||||||
|
maven.license.licenseFile=${basedir}/LICENSE.txt
|
||||||
87
ear/src/plugin-test/test01/project.xml
Normal file
87
ear/src/plugin-test/test01/project.xml
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!--
|
||||||
|
/*
|
||||||
|
* Copyright 2001-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>
|
||||||
|
<pomVersion>3</pomVersion>
|
||||||
|
<name>Test project for Maven Ear Plugin 01</name>
|
||||||
|
<artifactId>test-maven-ear-plugin-01</artifactId>
|
||||||
|
<organization>
|
||||||
|
<name>Nettec</name>
|
||||||
|
<url>http://www.nettec.net</url>
|
||||||
|
</organization>
|
||||||
|
<inceptionYear>2002</inceptionYear>
|
||||||
|
<package>net.nettec.marsh.begin</package>
|
||||||
|
<shortDescription>Marsh Begin TTS Maven</shortDescription>
|
||||||
|
<description>TTS Begin</description>
|
||||||
|
<url/>
|
||||||
|
<developers>
|
||||||
|
<developer>
|
||||||
|
<name>Nathan Coast</name>
|
||||||
|
<id>nathanc</id>
|
||||||
|
<email>nathan.coast@blueyonder.co.uk</email>
|
||||||
|
<organization>Shadow Solutions</organization>
|
||||||
|
<role>Java Developer</role>
|
||||||
|
</developer>
|
||||||
|
</developers>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-logging</groupId>
|
||||||
|
<artifactId>commons-logging</artifactId>
|
||||||
|
<version>1.0.3</version>
|
||||||
|
<url>http://jakarta.apache.org/commons/logging.html</url>
|
||||||
|
<properties>
|
||||||
|
<ear.bundle>true</ear.bundle>
|
||||||
|
</properties>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-collections</groupId>
|
||||||
|
<artifactId>commons-collections</artifactId>
|
||||||
|
<version>2.1</version>
|
||||||
|
<url>http://jakarta.apache.org/commons/collections/</url>
|
||||||
|
<properties>
|
||||||
|
<ear.module>true</ear.module>
|
||||||
|
</properties>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-jelly</groupId>
|
||||||
|
<artifactId>commons-jelly-tags-xml</artifactId>
|
||||||
|
<version>20030211.142705</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- Needed for the entity resolver -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>maven</groupId>
|
||||||
|
<artifactId>maven-j2ee-plugin</artifactId>
|
||||||
|
<version>1.4</version>
|
||||||
|
<type>plugin</type>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
<build>
|
||||||
|
<sourceDirectory>src</sourceDirectory>
|
||||||
|
<unitTestSourceDirectory>src/test</unitTestSourceDirectory>
|
||||||
|
<!-- Resources that are packaged up inside the JAR file -->
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<directory>src/resources</directory>
|
||||||
|
<targetPath></targetPath>
|
||||||
|
<includes><include>*.txt</include></includes>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
</build>
|
||||||
|
</project>
|
||||||
Loading…
x
Reference in New Issue
Block a user