mirror of https://github.com/apache/maven.git
adding testcase for MNG-1329 duplicate project references (already working)
renaming project.xml->pom.xml in test projects according to m2 standard git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@329655 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
96de59c076
commit
4c89459ed5
|
@ -78,6 +78,19 @@ public class EclipsePluginTest
|
|||
testProject( "project-6", null );
|
||||
}
|
||||
|
||||
public void testProject7()
|
||||
throws Exception
|
||||
{
|
||||
testProject( "project-7", null );
|
||||
}
|
||||
|
||||
// @todo testcase for MNG-1324 "System" dependencies path non correctly added to eclipse buildpath
|
||||
// public void testProject8()
|
||||
// throws Exception
|
||||
// {
|
||||
// testProject( "project-8", null );
|
||||
// }
|
||||
|
||||
private void testProject( String projectName, File outputDir )
|
||||
throws Exception
|
||||
{
|
||||
|
@ -90,13 +103,14 @@ public class EclipsePluginTest
|
|||
File repo = getTestFile( "src/test/repository" );
|
||||
|
||||
ArtifactRepositoryLayout localRepositoryLayout = (ArtifactRepositoryLayout) lookup(
|
||||
ArtifactRepositoryLayout.ROLE, "legacy" );
|
||||
ArtifactRepositoryLayout.ROLE,
|
||||
"legacy" );
|
||||
|
||||
ArtifactRepository localRepository = new DefaultArtifactRepository( "local", "file://" + repo.getAbsolutePath(),
|
||||
ArtifactRepository localRepository = new DefaultArtifactRepository( "local",
|
||||
"file://" + repo.getAbsolutePath(),
|
||||
localRepositoryLayout );
|
||||
|
||||
MavenProject project = builder
|
||||
.buildWithDependencies( new File( basedir, "project.xml" ), localRepository, null );
|
||||
MavenProject project = builder.buildWithDependencies( new File( basedir, "pom.xml" ), localRepository, null );
|
||||
|
||||
File projectOutputDir = basedir;
|
||||
|
||||
|
@ -150,14 +164,14 @@ public class EclipsePluginTest
|
|||
|
||||
plugin.execute();
|
||||
|
||||
assertFileEquals( localRepository.getBasedir(), new File( basedir, "project" ),
|
||||
new File( projectOutputDir, ".project" ) );
|
||||
assertFileEquals( localRepository.getBasedir(), new File( basedir, "project" ), new File( projectOutputDir,
|
||||
".project" ) );
|
||||
|
||||
assertFileEquals( localRepository.getBasedir(), new File( basedir, "classpath" ),
|
||||
new File( projectOutputDir, ".classpath" ) );
|
||||
assertFileEquals( localRepository.getBasedir(), new File( basedir, "classpath" ), new File( projectOutputDir,
|
||||
".classpath" ) );
|
||||
|
||||
assertFileEquals( localRepository.getBasedir(), new File( basedir, "wtpmodules" ),
|
||||
new File( projectOutputDir, ".wtpmodules" ) );
|
||||
assertFileEquals( localRepository.getBasedir(), new File( basedir, "wtpmodules" ), new File( projectOutputDir,
|
||||
".wtpmodules" ) );
|
||||
|
||||
if ( new File( basedir, "settings" ).exists() )
|
||||
{
|
||||
|
@ -184,8 +198,8 @@ public class EclipsePluginTest
|
|||
|
||||
if ( actualLines.size() <= i )
|
||||
{
|
||||
fail( "Too few lines in the actual file. Was " + actualLines.size() + ", expected: " +
|
||||
expectedLines.size() );
|
||||
fail( "Too few lines in the actual file. Was " + actualLines.size() + ", expected: "
|
||||
+ expectedLines.size() );
|
||||
}
|
||||
|
||||
String actual = actualLines.get( i ).toString();
|
||||
|
@ -213,8 +227,7 @@ public class EclipsePluginTest
|
|||
|
||||
while ( ( line = reader.readLine() ) != null )
|
||||
{
|
||||
lines.add(
|
||||
line );//StringUtils.replace( line, "#ArtifactRepositoryPath#", mavenRepo.replace( '\\', '/' ) ) );
|
||||
lines.add( line );//StringUtils.replace( line, "#ArtifactRepositoryPath#", mavenRepo.replace( '\\', '/' ) ) );
|
||||
}
|
||||
|
||||
return lines;
|
||||
|
|
|
@ -13,9 +13,9 @@
|
|||
</natures>
|
||||
<linkedResources>
|
||||
<link>
|
||||
<name>project.xml</name>
|
||||
<name>pom.xml</name>
|
||||
<type>1</type>
|
||||
<location>${basedir}/src/test/projects/project-4/project.xml</location>
|
||||
<location>${basedir}/src/test/projects/project-4/pom.xml</location>
|
||||
</link>
|
||||
<link>
|
||||
<name>src-main-java</name>
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
<classpath>
|
||||
<classpathentry kind="output" path="target/classes"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="var" path="M2_REPO/maven/jars/maven-core-98.0-tests.jar" sourcepath="M2_REPO/maven/java-sources/maven-core-98.0-sources.jar"/>
|
||||
<classpathentry kind="var" path="M2_REPO/maven/jars/maven-core-98.0.jar" sourcepath="M2_REPO/maven/java-sources/maven-core-98.0-sources.jar"/>
|
||||
</classpath>
|
|
@ -0,0 +1,23 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<packaging>war</packaging>
|
||||
<groupId>eclipse</groupId>
|
||||
<artifactId>maven-eclipse-plugin-test-project-7</artifactId>
|
||||
<version>99.0</version>
|
||||
<name>Maven</name>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>maven</groupId>
|
||||
<artifactId>maven-core</artifactId>
|
||||
<version>98.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>maven</groupId>
|
||||
<artifactId>maven-core</artifactId>
|
||||
<classifier>tests</classifier>
|
||||
<version>98.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -0,0 +1,14 @@
|
|||
<projectDescription>
|
||||
<name>maven-eclipse-plugin-test-project-7</name>
|
||||
<comment/>
|
||||
<projects/>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments/>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
|
@ -0,0 +1,15 @@
|
|||
<project-modules id="moduleCoreId">
|
||||
<wb-module deploy-name="maven-eclipse-plugin-test-project-7">
|
||||
<module-type module-type-id="jst.web">
|
||||
<version>2.4</version>
|
||||
<property name="context-root" value="maven-eclipse-plugin-test-project-7"/>
|
||||
</module-type>
|
||||
<wb-resource deploy-path="/" source-path="/src/main/webapp"/>
|
||||
<dependent-module deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/maven/jars/maven-core-98.0-tests.jar">
|
||||
<dependency-type>uses</dependency-type>
|
||||
</dependent-module>
|
||||
<dependent-module deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/maven/jars/maven-core-98.0.jar">
|
||||
<dependency-type>uses</dependency-type>
|
||||
</dependent-module>
|
||||
</wb-module>
|
||||
</project-modules>
|
Loading…
Reference in New Issue