preserve logfiles from different rounds of maven invocation, and move the project-info-reports-plugin version definition out into the general build section, to make it more concrete and less prone to breakage.

git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@675354 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
John Dennis Casey 2008-07-09 21:46:51 +00:00
parent 05f8e32c88
commit 1eef3f347e
2 changed files with 17 additions and 6 deletions

View File

@ -7,6 +7,7 @@ import org.apache.maven.it.util.ResourceExtractor;
import java.io.File; import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.List; import java.util.List;
/** /**
@ -29,6 +30,8 @@ public class MavenITmng3473PluginReportCrash
Verifier verifier = new Verifier( testDir.getAbsolutePath() ); Verifier verifier = new Verifier( testDir.getAbsolutePath() );
File logFile = new File( testDir, "log.txt" );
// force the use of the 2.4.1 plugin version via a profile here... // force the use of the 2.4.1 plugin version via a profile here...
List cliOptions = new ArrayList(); List cliOptions = new ArrayList();
cliOptions.add( "-Pplugin-2.4.1" ); cliOptions.add( "-Pplugin-2.4.1" );
@ -38,13 +41,17 @@ public class MavenITmng3473PluginReportCrash
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
verifier.resetStreams(); verifier.resetStreams();
logFile.renameTo( new File( testDir, "log-2.4.1-preinstall.txt" ) );
//should succeed with 2.4.1 //should succeed with 2.4.1
verifier.executeGoal( "site" ); verifier.executeGoals( Arrays.asList( new String[]{ "org.apache.maven.plugins:maven-help-plugin:2.0.2:effective-pom", "site" } ) );
// NOTE: Velocity prints an [ERROR] line pertaining to an incorrect macro usage when run in 2.1, so this doesn't work. // NOTE: Velocity prints an [ERROR] line pertaining to an incorrect macro usage when run in 2.1, so this doesn't work.
// verifier.verifyErrorFreeLog(); // verifier.verifyErrorFreeLog();
verifier.resetStreams(); verifier.resetStreams();
logFile.renameTo( new File( testDir, "log-2.4.1.txt" ) );
//should fail with 2.4 //should fail with 2.4
cliOptions.clear(); cliOptions.clear();
cliOptions.add( "-Pplugin-2.4" ); cliOptions.add( "-Pplugin-2.4" );
@ -60,5 +67,7 @@ public class MavenITmng3473PluginReportCrash
} }
verifier.verifyTextInLog( "org/apache/maven/doxia/module/site/manager/SiteModuleNotFoundException" ); verifier.verifyTextInLog( "org/apache/maven/doxia/module/site/manager/SiteModuleNotFoundException" );
verifier.resetStreams(); verifier.resetStreams();
logFile.renameTo( new File( testDir, "log-2.4.txt" ) );
} }
} }

View File

@ -46,11 +46,6 @@
<reporting> <reporting>
<plugins> <plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>2.0.1</version>
</plugin>
<plugin> <plugin>
<artifactId>maven-plugin-plugin</artifactId> <artifactId>maven-plugin-plugin</artifactId>
<!--only fails with 2.4, not 2.3 or 2.4.1--> <!--only fails with 2.4, not 2.3 or 2.4.1-->
@ -73,5 +68,12 @@
</build> </build>
<reporting> <reporting>
<outputDirectory>target/site</outputDirectory> <outputDirectory>target/site</outputDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>2.0.1</version>
</plugin>
</plugins>
</reporting> </reporting>
</project> </project>