Files
maven-plugins/eclipse/src/plugin-test/duplicatebuilderstest/maven.xml
T

66 lines
2.8 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:j="jelly:core"
xmlns:assert="assert"
xmlns:u="jelly:util"
xmlns:maven="jelly:maven"
xmlns:x="jelly:xml">
<goal name="testPlugin" prereqs="test-duplicatednatures,test-duplicatedbuilders">
</goal>
<goal name="test-init" prereqs="clean">
<j:set var="dotProject" value="${basedir}/.project"/>
<j:set var="dotClasspath" value="${basedir}/.classpath"/>
<attainGoal name="eclipse:clean"/>
<attainGoal name="eclipse"/>
<assert:assertFileExists file="${dotProject}" />
<assert:assertFileExists file="${dotClasspath}" />
</goal>
<goal name="test-duplicatednatures" prereqs="test-init">
<u:file var="projectFile" name="${dotProject}"/>
<x:parse var="projectDoc" xml="${projectFile.toURL()}" />
<x:set var="natures" select="$projectDoc/projectDescription/natures/nature"/>
<assert:assertEquals expected="${3}" value="${size(natures)}" msg="Wrong number of natures generated"/>
<assert:assertEquals expected="org.eclipse.jst.j2ee.web.WebNature" value="${natures[0].text}" msg="Nature 0 is not what expected"/>
<assert:assertEquals expected="org.eclipse.jdt.core.javanature" value="${natures[1].text}" msg="Nature 1 is not what expected"/>
<assert:assertEquals expected="org.eclipse.wst.common.modulecore.ModuleCoreNature" value="${natures[2].text}" msg="Nature 2 is not what expected"/>
</goal>
<goal name="test-duplicatedbuilders" prereqs="test-init">
<u:file var="projectFile" name="${dotProject}"/>
<x:parse var="projectDoc" xml="${projectFile.toURL()}" />
<x:set var="builders" select="$projectDoc/projectDescription/buildSpec/buildCommand/name"/>
<assert:assertEquals expected="${3}" value="${size(builders)}" msg="Wrong number of builders generated"/>
<assert:assertEquals expected="org.eclipse.wst.common.modulecore.ComponentStructuralBuilder" value="${builders[0].text}" msg="Builder 0 is not what expected"/>
<assert:assertEquals expected="org.eclipse.jdt.core.javabuilder" value="${builders[1].text}" msg="Builder 0 is not what expected"/>
<assert:assertEquals expected="org.eclipse.jst.j2ee.web.LibDirBuilder" value="${builders[2].text}" msg="Builder 0 is not what expected"/>
</goal>
</project>