Files
maven-plugins/ear/src/plugin-test/appXmlBundledTest/maven.xml
T

57 lines
2.0 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">
<echo>SRC: ${maven.ear.src}</echo>
<!-- makes sure application.xml existed before -->
<assert:assertFileExists file="${maven.ear.src}/META-INF/application.xml"/>
<attainGoal name="ear"/>
<!-- makes sure application.xml existed after -->
<assert:assertFileExists file="${maven.ear.src}/META-INF/application.xml"/>
<!-- tests that the ear is generated -->
<j:set var="earFile" value="${maven.build.dir}/${maven.ear.final.name}"/>
<assert:assertFileExists file="${earFile}"/>
<!-- extracts the EAR -->
<j:set var="tmpEarDir" value="${maven.build.dir}/extractedEar"/>
<ant:unzip src="${earFile}" dest="${tmpEarDir}"/>
<!-- asserts the application.xml is there -->
<assert:assertFileExists file="${tmpEarDir}/META-INF/application.xml"/>
<!-- asserts the application.xml content is the same as before -->
<util:loadText var="newAppXml" file="${tmpEarDir}/META-INF/application.xml"/>
<util:loadText var="oldAppXml" file="${maven.ear.src}/META-INF/application.xml"/>
<assert:assertEquals expected="${oldAppXml}" value="${newAppXml}"/>
</goal>
</project>