mirror of https://github.com/apache/maven.git
[MNG-4084] Unnecessary Warning for an activate profile in child project
git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@753090 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
954e32dc53
commit
d2b29ff7a5
|
@ -49,7 +49,7 @@ public class MavenITmng3641ProfileActivationWarningTest
|
||||||
// Delete this artifact. Just in case.
|
// Delete this artifact. Just in case.
|
||||||
verifier.deleteArtifact( "org.apache.maven.its.mng3641", "parent", "1.0", "pom" );
|
verifier.deleteArtifact( "org.apache.maven.its.mng3641", "parent", "1.0", "pom" );
|
||||||
|
|
||||||
// (1) First run: make sure the profile is found. Must not contain a warning.
|
// (1) make sure the profile is found. Must not contain a warning.
|
||||||
verifier.setCliOptions( Collections.singletonList( "-P mng-3641-it-provided-profile" ) );
|
verifier.setCliOptions( Collections.singletonList( "-P mng-3641-it-provided-profile" ) );
|
||||||
verifier.setLogFileName( "log-1.txt" );
|
verifier.setLogFileName( "log-1.txt" );
|
||||||
verifier.executeGoal( "validate" );
|
verifier.executeGoal( "validate" );
|
||||||
|
@ -59,7 +59,7 @@ public class MavenITmng3641ProfileActivationWarningTest
|
||||||
List logFile = verifier.loadFile( verifier.getBasedir(), verifier.getLogFileName(), false );
|
List logFile = verifier.loadFile( verifier.getBasedir(), verifier.getLogFileName(), false );
|
||||||
assertFalse( logFile.contains( "Profile with id: 'mng-3641-it-provided-profile' has not been activated." ) );
|
assertFalse( logFile.contains( "Profile with id: 'mng-3641-it-provided-profile' has not been activated." ) );
|
||||||
|
|
||||||
// (2) Second run: make sure the profile was not found and a warning was printed.
|
// (2) make sure the profile was not found and a warning was printed.
|
||||||
verifier = new Verifier( testDir.getAbsolutePath() );
|
verifier = new Verifier( testDir.getAbsolutePath() );
|
||||||
verifier.setCliOptions( Collections.singletonList( "-P mng-3641-TWlzdGVyIFQgd2FzIGhlcmUuICheX14p" ) );
|
verifier.setCliOptions( Collections.singletonList( "-P mng-3641-TWlzdGVyIFQgd2FzIGhlcmUuICheX14p" ) );
|
||||||
verifier.setLogFileName( "log-2.txt" );
|
verifier.setLogFileName( "log-2.txt" );
|
||||||
|
@ -70,7 +70,7 @@ public class MavenITmng3641ProfileActivationWarningTest
|
||||||
logFile = verifier.loadFile( verifier.getBasedir(), verifier.getLogFileName(), false );
|
logFile = verifier.loadFile( verifier.getBasedir(), verifier.getLogFileName(), false );
|
||||||
assertTrue( logFile.contains( "Profile with id: 'mng-3641-TWlzdGVyIFQgd2FzIGhlcmUuICheX14p' has not been activated." ) );
|
assertTrue( logFile.contains( "Profile with id: 'mng-3641-TWlzdGVyIFQgd2FzIGhlcmUuICheX14p' has not been activated." ) );
|
||||||
|
|
||||||
// (3) Third run: make sure the first profile is found while the other is not and a warning was printed
|
// (3) make sure the first profile is found while the other is not and a warning was printed
|
||||||
// accordingly.
|
// accordingly.
|
||||||
verifier = new Verifier( testDir.getAbsolutePath() );
|
verifier = new Verifier( testDir.getAbsolutePath() );
|
||||||
verifier.setCliOptions( Collections.singletonList( "-P mng-3641-it-provided-profile,mng-3641-TWlzdGVyIFQgd2FzIGhlcmUuICheX14p" ) );
|
verifier.setCliOptions( Collections.singletonList( "-P mng-3641-it-provided-profile,mng-3641-TWlzdGVyIFQgd2FzIGhlcmUuICheX14p" ) );
|
||||||
|
@ -83,7 +83,7 @@ public class MavenITmng3641ProfileActivationWarningTest
|
||||||
assertFalse( logFile.contains( "Profile with id: 'mng-3641-it-provided-profile' has not been activated." ) );
|
assertFalse( logFile.contains( "Profile with id: 'mng-3641-it-provided-profile' has not been activated." ) );
|
||||||
assertTrue( logFile.contains( "Profile with id: 'mng-3641-TWlzdGVyIFQgd2FzIGhlcmUuICheX14p' has not been activated." ) );
|
assertTrue( logFile.contains( "Profile with id: 'mng-3641-TWlzdGVyIFQgd2FzIGhlcmUuICheX14p' has not been activated." ) );
|
||||||
|
|
||||||
// (4) Fourth run: make sure the warning is only printed when the profile is missing in all projects
|
// (4) make sure the warning is only printed when the profile is missing in all projects
|
||||||
verifier = new Verifier( testDir.getAbsolutePath() );
|
verifier = new Verifier( testDir.getAbsolutePath() );
|
||||||
verifier.setCliOptions( Collections.singletonList( "-P mng-3641-it-provided-profile-child" ) );
|
verifier.setCliOptions( Collections.singletonList( "-P mng-3641-it-provided-profile-child" ) );
|
||||||
verifier.setLogFileName( "log-4.txt" );
|
verifier.setLogFileName( "log-4.txt" );
|
||||||
|
@ -93,5 +93,28 @@ public class MavenITmng3641ProfileActivationWarningTest
|
||||||
|
|
||||||
logFile = verifier.loadFile( verifier.getBasedir(), verifier.getLogFileName(), false );
|
logFile = verifier.loadFile( verifier.getBasedir(), verifier.getLogFileName(), false );
|
||||||
assertFalse( logFile.contains( "Profile with id: 'mng-3641-it-provided-profile-child' has not been activated." ) );
|
assertFalse( logFile.contains( "Profile with id: 'mng-3641-it-provided-profile-child' has not been activated." ) );
|
||||||
|
|
||||||
|
// (5) make sure the profile is found in subproject. Must not contain a warning.
|
||||||
|
verifier = new Verifier( new File( testDir, "child1" ).getAbsolutePath() );
|
||||||
|
verifier.setCliOptions( Collections.singletonList( "-P mng-3641-it-provided-profile-child" ) );
|
||||||
|
verifier.setLogFileName( "log-5.txt" );
|
||||||
|
verifier.executeGoal( "validate" );
|
||||||
|
verifier.verifyErrorFreeLog();
|
||||||
|
verifier.resetStreams();
|
||||||
|
|
||||||
|
logFile = verifier.loadFile( verifier.getBasedir(), verifier.getLogFileName(), false );
|
||||||
|
assertFalse( logFile.contains( "Profile with id: 'mng-3641-it-provided-profile-child' has not been activated." ) );
|
||||||
|
|
||||||
|
// (6) make sure the profile is found from parent in subproject. Must not contain a warning.
|
||||||
|
verifier = new Verifier( new File( testDir, "child1" ).getAbsolutePath() );
|
||||||
|
verifier.setCliOptions( Collections.singletonList( "-P mng-3641-it-provided-profile" ) );
|
||||||
|
verifier.setLogFileName( "log-6.txt" );
|
||||||
|
verifier.executeGoal( "validate" );
|
||||||
|
verifier.verifyErrorFreeLog();
|
||||||
|
verifier.resetStreams();
|
||||||
|
|
||||||
|
logFile = verifier.loadFile( verifier.getBasedir(), verifier.getLogFileName(), false );
|
||||||
|
assertFalse( logFile.contains( "Profile with id: 'mng-3641-it-provided-profile' has not been activated." ) );
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue