Files
maven-plugins/eclipse/src/plugin-test/justresourcestest/maven.xml
T
fgiust 888d258c82 committing MPECLIPSE-101 - aggregate patch for the following MPECLIPSE issues:
MPECLIPSE-96 classpathentry contains trailing pipe character that confuses Eclipse 3.1
MPECLIPSE-80 Generate .wtpmodules files
MPECLIPSE-78 avoid duplicated builders/natures
MPECLIPSE-63 don't want the hardcoded org.eclipse.jdt.core.javabuilder
MPECLIPSE-92 Setting relative path value to "maven.eclipse.output.dir" generates wrong absolute classpath entry
MPECLIPSE-72 Failing use cases for projects with just resources
MPECLIPSE-57 Make sourcepath more flexible



git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@310226 13f79535-47bb-0310-9956-ffa450edef68
2005-10-09 16:50:48 +00:00

86 lines
3.6 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:ant="jelly:ant"
xmlns:u="jelly:util"
xmlns:maven="jelly:maven"
xmlns:x="jelly:xml">
<goal name="testPlugin" prereqs="test-default, test-classpath, test-project">
</goal>
<goal name="test-init">
<j:set var="dotProject" value="${basedir}/.project"/>
<j:set var="dotClasspath" value="${basedir}/.classpath"/>
<attainGoal name="eclipse:clean"/>
</goal>
<goal name="test-default">
<attainGoal name="test-init"/>
<j:set var="maven.eclipse.resources.addtoclasspath" value="true"/>
<attainGoal name="eclipse"/>
<assert:assertFileExists file="${dotClasspath}" />
<assert:assertFileExists file="${dotProject}" />
</goal>
<goal name="test-classpath">
<attainGoal name="test-init"/>
<j:set var="maven.eclipse.resources.addtoclasspath" value="true"/>
<attainGoal name="eclipse:generate-classpath"/>
<assert:assertFileExists file="${dotClasspath}" />
<u:file var="classpathFile" name="${dotClasspath}"/>
<x:parse var="classpathDoc" xml="${classpathFile.toURL()}" />
<x:set var="countResources" select="count($classpathDoc/classpath/classpathentry[contains(@path,'src/main/resources')])"/>
<assert:assertEquals expected="1" value="${countResources.intValue().toString()}" msg="resources entry not found"/>
<x:set var="countNoresources" select="count($classpathDoc/classpath/classpathentry[contains(@path,'src/main/noresources')])"/>
<assert:assertEquals expected="0" value="${countNoresources.intValue().toString()}" msg="noresources entry found"/>
<x:set var="countSources" select="count($classpathDoc/classpath/classpathentry[contains(@path,'src/main/java')])"/>
<assert:assertEquals expected="0" value="${countSources.intValue().toString()}" msg="sources entry found"/>
</goal>
<goal name="test-project">
<attainGoal name="test-init"/>
<j:set var="maven.eclipse.resources.addtoclasspath" value="true"/>
<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="countNatures" select="count($natures)"/>
<assert:assertEquals expected="1" value="${countNatures.intValue().toString()}" msg="expected 1 nature"/>
<assert:assertEquals expected="org.eclipse.jdt.core.javanature" value="${natures[0].text}" msg="expected the nature to be the java one"/>
<x:set var="builders" select="$projectDoc/projectDescription/buildSpec/buildCommand/name"/>
<x:set var="countBuilders" select="count($builders)"/>
<assert:assertEquals expected="1" value="${countBuilders.intValue().toString()}" msg="expected 1 builder"/>
<assert:assertEquals expected="org.eclipse.jdt.core.javabuilder" value="${builders[0].text}" msg="expected the builder to be the java one"/>
</goal>
</project>