Author: brett
Date: Fri Mar 13 02:25:46 2009
New Revision: 753090

URL: http://svn.apache.org/viewvc?rev=753090&view=rev
Log:
[MNG-4084] Unnecessary Warning for an activate profile in child project

Modified:
    
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3641ProfileActivationWarningTest.java

Modified: 
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3641ProfileActivationWarningTest.java
URL: 
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3641ProfileActivationWarningTest.java?rev=753090&r1=753089&r2=753090&view=diff
==============================================================================
--- 
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3641ProfileActivationWarningTest.java
 (original)
+++ 
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3641ProfileActivationWarningTest.java
 Fri Mar 13 02:25:46 2009
@@ -49,7 +49,7 @@
         // Delete this artifact. Just in case.
         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.setLogFileName( "log-1.txt" );
         verifier.executeGoal( "validate" );
@@ -59,7 +59,7 @@
         List logFile = verifier.loadFile( verifier.getBasedir(), 
verifier.getLogFileName(), false );
         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.setCliOptions( Collections.singletonList( "-P 
mng-3641-TWlzdGVyIFQgd2FzIGhlcmUuICheX14p" ) );
         verifier.setLogFileName( "log-2.txt" );
@@ -70,7 +70,7 @@
         logFile = verifier.loadFile( verifier.getBasedir(), 
verifier.getLogFileName(), false );
         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.
         verifier = new Verifier( testDir.getAbsolutePath() );
         verifier.setCliOptions( Collections.singletonList( "-P 
mng-3641-it-provided-profile,mng-3641-TWlzdGVyIFQgd2FzIGhlcmUuICheX14p" ) );
@@ -83,7 +83,7 @@
         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." ) );
 
-        // (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.setCliOptions( Collections.singletonList( "-P 
mng-3641-it-provided-profile-child" ) );
         verifier.setLogFileName( "log-4.txt" );
@@ -93,5 +93,28 @@
 
         logFile = verifier.loadFile( verifier.getBasedir(), 
verifier.getLogFileName(), false );
         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." ) );
+
     }
 }


Reply via email to