mirror of https://github.com/apache/maven.git
o Fixed IT to properly work on Windows
git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@742925 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
5db5fab024
commit
0e7d667b66
|
@ -56,8 +56,9 @@ public class MavenITmng3023ReactorDependencyResolutionTest
|
||||||
|
|
||||||
// First pass. Make sure the dependency cannot be resolved.
|
// First pass. Make sure the dependency cannot be resolved.
|
||||||
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
|
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
|
||||||
|
verifier.setLogFileName( "log-a.txt" );
|
||||||
|
|
||||||
verifier.deleteArtifact( "org.apache.maven.its.mng3023", "dependency", "1", "jar" );
|
verifier.deleteArtifacts( "org.apache.maven.its.mng3023" );
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -77,7 +78,7 @@ public class MavenITmng3023ReactorDependencyResolutionTest
|
||||||
/**
|
/**
|
||||||
* Test that reactor projects are included in dependency resolution.
|
* Test that reactor projects are included in dependency resolution.
|
||||||
*
|
*
|
||||||
* I this pass, the dependency artifact should have the file $(basedir)/dependency/target/classes
|
* I this pass, the dependency artifact should have the file $(basedir)/dependency/dependency-classes
|
||||||
* (a directory) associated with it, since the 'compile' phase has run. This location should be
|
* (a directory) associated with it, since the 'compile' phase has run. This location should be
|
||||||
* present in the compile classpath output from the maven-it-plugin-dependency-resolution:compile
|
* present in the compile classpath output from the maven-it-plugin-dependency-resolution:compile
|
||||||
* mojo execution.
|
* mojo execution.
|
||||||
|
@ -88,16 +89,17 @@ public class MavenITmng3023ReactorDependencyResolutionTest
|
||||||
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3023" );
|
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3023" );
|
||||||
|
|
||||||
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
|
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
|
||||||
|
verifier.setLogFileName( "log-b.txt" );
|
||||||
|
|
||||||
verifier.deleteArtifact( "org.apache.maven.its.mng3023", "dependency", "1", "jar" );
|
verifier.deleteArtifacts( "org.apache.maven.its.mng3023" );
|
||||||
|
|
||||||
verifier.executeGoal( "compile" );
|
verifier.executeGoal( "compile" );
|
||||||
verifier.verifyErrorFreeLog();
|
verifier.verifyErrorFreeLog();
|
||||||
verifier.resetStreams();
|
verifier.resetStreams();
|
||||||
|
|
||||||
List compileClassPath = verifier.loadLines( "consumer/target/compile.classpath", "UTF-8" );
|
List compileClassPath = verifier.loadLines( "consumer/target/compile.classpath", "UTF-8" );
|
||||||
assertTrue( find( "dependency/target/classes", compileClassPath ) );
|
assertTrue( compileClassPath.toString(), compileClassPath.contains( "dependency-classes" ) );
|
||||||
assertFalse( find( "dependency-1.jar", compileClassPath ) );
|
assertFalse( compileClassPath.toString(), compileClassPath.contains( "dependency-1.jar" ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -119,37 +121,25 @@ public class MavenITmng3023ReactorDependencyResolutionTest
|
||||||
|
|
||||||
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
|
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
|
||||||
|
|
||||||
verifier.deleteArtifact( "org.apache.maven.its.mng3023", "dependency", "1", "jar" );
|
verifier.deleteArtifacts( "org.apache.maven.its.mng3023" );
|
||||||
|
|
||||||
|
verifier.setLogFileName( "log-c-1.txt" );
|
||||||
verifier.executeGoal( "install" );
|
verifier.executeGoal( "install" );
|
||||||
verifier.verifyErrorFreeLog();
|
verifier.verifyErrorFreeLog();
|
||||||
verifier.resetStreams();
|
verifier.resetStreams();
|
||||||
|
|
||||||
List compileClassPath = verifier.loadLines( "consumer/target/compile.classpath", "UTF-8" );
|
List compileClassPath = verifier.loadLines( "consumer/target/compile.classpath", "UTF-8" );
|
||||||
assertTrue( find( "dependency-1.jar", compileClassPath ) );
|
assertTrue( compileClassPath.toString(), compileClassPath.contains( "dependency-1.jar" ) );
|
||||||
assertFalse( find( "dependency/target/classes", compileClassPath ) );
|
assertFalse( compileClassPath.toString(), compileClassPath.contains( "dependency-classes" ) );
|
||||||
|
|
||||||
|
verifier.setLogFileName( "log-c-2.txt" );
|
||||||
verifier.executeGoal( "initialize" );
|
verifier.executeGoal( "initialize" );
|
||||||
verifier.verifyErrorFreeLog();
|
verifier.verifyErrorFreeLog();
|
||||||
verifier.resetStreams();
|
verifier.resetStreams();
|
||||||
|
|
||||||
compileClassPath = verifier.loadLines( "consumer/target/compile.classpath", "UTF-8" );
|
compileClassPath = verifier.loadLines( "consumer/target/compile.classpath", "UTF-8" );
|
||||||
assertTrue( find( "dependency-1.jar", compileClassPath ) );
|
assertTrue( compileClassPath.toString(), compileClassPath.contains( "dependency-1.jar" ) );
|
||||||
assertFalse( find( "dependency/target/classes", compileClassPath ) );
|
assertFalse( compileClassPath.toString(), compileClassPath.contains( "dependency-classes" ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean find( String pathSubstr, List classPath )
|
|
||||||
{
|
|
||||||
for ( Iterator it = classPath.iterator(); it.hasNext(); )
|
|
||||||
{
|
|
||||||
String path = (String) it.next();
|
|
||||||
|
|
||||||
if ( path.indexOf( pathSubstr ) > -1 )
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
<project>
|
<project>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.apache.maven.its.mng3023</groupId>
|
<groupId>org.apache.maven.its.mng3023</groupId>
|
||||||
<artifactId>parent</artifactId>
|
<artifactId>parent</artifactId>
|
||||||
<version>1</version>
|
<version>1</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>consumer</artifactId>
|
<artifactId>consumer</artifactId>
|
||||||
|
@ -31,6 +31,7 @@
|
||||||
</goals>
|
</goals>
|
||||||
<configuration>
|
<configuration>
|
||||||
<compileClassPath>${project.build.directory}/compile.classpath</compileClassPath>
|
<compileClassPath>${project.build.directory}/compile.classpath</compileClassPath>
|
||||||
|
<significantPathLevels>1</significantPathLevels>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
|
|
|
@ -1,10 +1,14 @@
|
||||||
<project>
|
<project>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.apache.maven.its.mng3023</groupId>
|
<groupId>org.apache.maven.its.mng3023</groupId>
|
||||||
<artifactId>parent</artifactId>
|
<artifactId>parent</artifactId>
|
||||||
<version>1</version>
|
<version>1</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>dependency</artifactId>
|
<artifactId>dependency</artifactId>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<outputDirectory>dependency-classes</outputDirectory>
|
||||||
|
</build>
|
||||||
</project>
|
</project>
|
||||||
|
|
Loading…
Reference in New Issue