Added maven.eclipse.buildcommands and maven.eclipse.projectnatures

Added tests for them

PR: MPECLIPSE-25
Obtained from: Miguel Griffa
Submitted by:	Miguel Griffa
Reviewed by:	dIon Gillard


git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@115194 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
dion committed 2004-05-06 05:43:13 +00:00
1 parent 89fde49f23
commit fdd0eebc51
5 files changed
+134 -35

No files matched your search

+66 -6
View File
@@ -17,18 +17,78 @@
-->
<project xmlns:j="jelly:core"
xmlns:assert="assert"
xmlns:u="jelly:util">
xmlns:u="jelly:util"
xmlns:x="jelly:xml">
<goal name="testPlugin" prereqs="test-eclipse">
<goal name="testPlugin" prereqs="test-init,test-eclipse,test-natures,test-builders,test-natures-and-builders">
</goal>
<goal name="test-init">
<j:set var="dotProject" value="${basedir}/.project"/>
<j:set var="dotClasspath" value="${basedir}/.classpath"/>
</goal>
<goal name="test-eclipse">
<delete file="${basedir}/.project" failonerror="false"/>
<delete file="${basedir}/.classpath" failonerror="false"/>
<delete file="${dotProject}" failonerror="false"/>
<delete file="${dotClasspath}" failonerror="false"/>
<attainGoal name="eclipse"/>
<assert:assertFileExists file="${basedir}/.project" />
<assert:assertFileExists file="${basedir}/.classpath" />
<assert:assertFileExists file="${dotProject}" />
<assert:assertFileExists file="${dotClasspath}" />
</goal>
<goal name="test-natures">
<delete file="${dotProject}" failonerror="false"/>
<j:set var="maven.eclipse.projectnatures" value="n1,a.b.c.n2"/>
<attainGoal name="eclipse:generate-project"/>
<assert:assertFileExists file="${dotProject}" />
<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="n1" value="${natures[1].text}" msg="n1 is not the second nature"/>
<assert:assertEquals expected="a.b.c.n2" value="${natures[2].text}" msg="a.b.c.n2 is not the third nature"/>
</goal>
<goal name="test-builders">
<j:set var="maven.eclipse.buildcommands" value="c1,c2,c3"/>
<delete file="${dotProject}" failonerror="false"/>
<attainGoal name="eclipse:generate-project"/>
<assert:assertFileExists file="${dotProject}" />
<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="c1" value="${builders[1].text}" msg="c1 is not the second build command name"/>
<assert:assertEquals expected="c2" value="${builders[2].text}" msg="c2 is not the third build command name"/>
<assert:assertEquals expected="c3" value="${builders[3].text}" msg="c3 is not the fourth build command name"/>
</goal>
<goal name="test-natures-and-builders">
<delete file="${dotProject}" failonerror="false"/>
<j:set var="maven.eclipse.projectnatures" value="n7,n9,n11"/>
<j:set var="maven.eclipse.buildcommands" value="c11,c21,c31"/>
<attainGoal name="eclipse:generate-project"/>
<assert:assertFileExists file="${dotProject}" />
<u:file var="projectFile" name="${dotProject}"/>
<x:parse var="projectDoc" xml="${projectFile.toURL()}" />
<x:set var="natures" select="$projectDoc/projectDescription/natures/nature"/>
<x:set var="builders" select="$projectDoc/projectDescription/buildSpec/buildCommand/name"/>
<!-- check natures -->
<assert:assertEquals expected="n7" value="${natures[1].text}" msg="n7 is not the second nature"/>
<assert:assertEquals expected="n9" value="${natures[2].text}" msg="n9 is not the second nature"/>
<assert:assertEquals expected="n11" value="${natures[3].text}" msg="n11 is not the second nature"/>
<!-- check builders -->
<assert:assertEquals expected="c11" value="${builders[1].text}" msg="c11 is not the second build command name"/>
<assert:assertEquals expected="c21" value="${builders[2].text}" msg="c21 is not the second build command name"/>
<assert:assertEquals expected="c31" value="${builders[3].text}" msg="c31 is not the second build command name"/>
</goal>
</project>
+7
View File
@@ -53,5 +53,12 @@
</developers>
<build>
<dependencies>
<dependency>
<groupId>commons-jelly</groupId>
<artifactId>commons-jelly-tags-xml</artifactId>
<version>20030211.142705</version>
</dependency>
</dependencies>
</build>
</project>