Files
maven-plugins/ant/src/plugin-test/maven.xml
T

64 lines
2.5 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:util="jelly:util"
xmlns:j="jelly:core"
xmlns:ant="jelly:ant"
xmlns:maven="jelly:maven"
xmlns:u="jelly:util"
xmlns:assert="assert"
xmlns:x="jelly:xml">
<goal name="testPlugin" prereqs="test-ant">
<attainGoal name="clean"/>
</goal>
<goal name="test-ant">
<attainGoal name="ant"/>
<assert:assertFileExists file="${basedir}/build.xml"/>
<ant:property name="noget" value="noget" />
<ant:ant/>
<!-- load build.xml file and check that 'target' property is relative -->
<u:file name="${basedir}/build.xml" var="buildFile"/>
<x:parse var="buildXml" xml="${buildFile.toURL()}" />
<x:set var="properties" select="$buildXml/project/property"/>
<j:set var="defaulttargetdirName" value="${properties[0].attribute('name').value}"/>
<j:set var="defaulttargetdirValue" value="${properties[0].attribute('value').value}"/>
<assert:assertEquals expected="defaulttargetdir" value="${defaulttargetdirName}"
msg="first target is not defaulttargetdir"/>
<assert:assertEquals expected="target" value="${defaulttargetdirValue}"
msg="defaulttargetdir property is not relative"/>
<!-- check test filesets -->
<x:set var="testFilesetDirs" select="$buildXml/project/target[@name = 'compile-tests']/copy/fileset/@dir"/>
<assert:assertEquals expected="src/test" value="${testFilesetDirs[0].value}"
msg="test fileset dirs are not relative"/>
<assert:assertFileExists file="${maven.build.dest}/directory-1/file1.properties"/>
<assert:assertFileExists file="${maven.build.dest}/file2.properties"/>
<!-- there are no unit test sources present, so the resources wont be copied either
<assert:assertFileExists file="${maven.test.dest}/directory-1/file1.properties"/>
<assert:assertFileExists file="${maven.test.dest}/file2.properties"/-->
<delete file="${basedir}/build.xml"/>
</goal>
</project>