Replace the tapestry template test by a generic test for all templates.

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@348337 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
aheritier 2005-11-23 01:24:00 +00:00
parent 23a6561036
commit a65d7c9dc0
4 changed files with 59 additions and 41 deletions

View File

@ -1,34 +0,0 @@
<!--
/*
* Copyright 2005 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:ant="jelly:ant" xmlns:maven="jelly:maven" xmlns:assert="assert" default="testPlugin">
<goal name="testPlugin" prereqs="test-genapp">
<attainGoal name="clean"/>
</goal>
<goal name="test-genapp" prereqs="clean">
<attainGoal name="genapp"/>
<!-- checks if the project has been generated -->
<assert:assertFileExists file="${maven.genapp.basedir}"/>
<assert:assertFileExists file="${maven.genapp.basedir}/project.xml"/>
<assert:assertFileExists file="${maven.genapp.basedir}/project.properties"/>
<!-- builds the generated project -->
<maven:maven descriptor="${maven.genapp.basedir}/project.xml"/>
<assert:assertFileExists file="${maven.genapp.basedir}/target/myId.war"/>
</goal>
</project>

View File

@ -0,0 +1,46 @@
<!--
/*
* Copyright 2005 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:ant="jelly:ant" xmlns:maven="jelly:maven" xmlns:util="jelly:util" xmlns:assert="assert" default="testPlugin">
<goal name="testPlugin" prereqs="test-genapp">
<attainGoal name="clean"/>
</goal>
<goal name="test-genapp" prereqs="clean">
<util:tokenize var="templatesList" delim=",">${templates}</util:tokenize>
<j:forEach var="currentTemplate" items="${templatesList}">
<echo>### Testing the template : ${currentTemplate}</echo>
<j:set var="template" value="${currentTemplate}"/>
<!-- clean a previous test -->
<attainGoal name="clean"/>
<!-- generates the template -->
<attainGoal name="genapp"/>
<!-- checks if the project has been generated -->
<assert:assertFileExists file="${maven.genapp.basedir}"/>
<assert:assertFileExists file="${maven.genapp.basedir}/project.xml"/>
<assert:assertFileExists file="${maven.genapp.basedir}/project.properties"/>
<!-- builds the generated project -->
<maven:maven descriptor="${maven.genapp.basedir}/project.xml"/>
<j:set var="artifactProperty" value="template.${currentTemplate}.artifact"/>
<j:if test="${context.getVariable(artifactProperty) != null}">
<echo>=== Assert that the artifact is generated.</echo>
<j:set var="artifactPath" value="${context.getVariable(artifactProperty)}"/>
<assert:assertFileExists file="${artifactPath}"/>
<echo>=== ${artifactPath} is found.</echo>
</j:if>
</j:forEach>
</goal>
</project>

View File

@ -13,11 +13,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# -------------------------------------------------------------------
#templates to test
templates=complex,default,ejb,struts,struts-jstl,tapestry,web,web-jstl,web-velocity
#artifact genarated by a template
template.tapestry.artifact=${maven.genapp.basedir}/target/${maven.genapp.template.id}.war
# directory where it should be generated
maven.genapp.basedir=${maven.build.dir}/my_genapp
# properties necessary to skip the prompt
template=tapestry
maven.genapp.template.id=myId
maven.genapp.template.name="Genapp testcase"
maven.genapp.template.package=org.apache.genapp

View File

@ -19,11 +19,11 @@
<project xmlns="http://maven.apache.org/POM/3.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/3.0.0
http://maven.apache.org/maven-v3_0_0.xsd">
<pomVersion>3</pomVersion>
<name>Genapp Plugin - Tapestry Test</name>
<artifactId>test-maven-genapp-plugin-tapestryTest</artifactId>
<name>Genapp Plugin - Templates Test</name>
<artifactId>test-maven-genapp-plugin-templatesTest</artifactId>
<inceptionYear>2005</inceptionYear>
<shortDescription>Tests Tapestry template</shortDescription>
<description>Tests Tapestry template</description>
<shortDescription>Tests all templates</shortDescription>
<description>Tests all templates</description>
<url/>
<developers>
<developer>
@ -32,5 +32,10 @@ http://maven.apache.org/maven-v3_0_0.xsd">
<email>maven@felipeal.net</email>
<organization>Falcon Informatica</organization>
</developer>
<developer>
<name>Arnaud Heritier</name>
<id>aheritier</id>
<email>aheritier@apache.org</email>
</developer>
</developers>
</project>