Files
maven-plugins/ear/src/plugin-test/test03/maven.xml
2004-11-16 05:04:56 +00:00

54 lines
1.9 KiB
XML

<!--
/*
* 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:assert="assert"
xmlns:util="jelly:util"
xmlns:j="jelly:core"
xmlns:ant="jelly:ant"
default="testPlugin">
<goal name="testPlugin" prereqs="test-ear">
<attainGoal name="clean"/>
</goal>
<goal name="test-ear" prereqs="ear:init">
<!-- makes sure application.xml didn't exist before -->
<util:available file="${maven.ear.src}/META-INF/application.xml">
<ant:fail>Testcase should not have file ${maven.ear.src}/META-INF/application.xml. Please remove it first.</ant:fail>
</util:available>
<attainGoal name="ear"/>
<!-- makes sure application.xml wasn't added -->
<util:available file="${maven.ear.src}/META-INF/application.xml">
<ant:fail>Plugin should not have created file ${maven.ear.src}/META-INF/application.xml.</ant:fail>
</util:available>
<!-- tests that the ear is generated -->
<assert:assertFileExists file="${maven.build.dir}/${maven.final.name}.ear"/>
<!-- extracts the EAR -->
<j:set var="tmpEarDir" value="${maven.build.dir}/extractedEar"/>
<ant:unzip src="${maven.build.dir}/${maven.final.name}.ear" dest="${tmpEarDir}"/>
<!-- asserts the application.xml is there -->
<assert:assertFileExists file="${tmpEarDir}/META-INF/application.xml"/>
</goal>
</project>