From 25f51f098e3ba9b46901c7192d516dc2853c2238 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Wed, 4 Jan 2012 20:25:19 +0000 Subject: [PATCH] fix it for maven3 as profile activation is different from maven2 git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@1227305 13f79535-47bb-0310-9956-ffa450edef68 --- .../it/MavenITmng5224InjectedSettings.java | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5224InjectedSettings.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5224InjectedSettings.java index e0fff00621..256736f378 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5224InjectedSettings.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5224InjectedSettings.java @@ -141,7 +141,18 @@ public class MavenITmng5224InjectedSettings */ Xpp3Dom activeProfilesNode = dom.getChild( "activeProfiles" ); - assertEquals( 2, activeProfilesNode.getChildCount() ); + + // with maven3 profile activation (activeByDefault) is done later during project building phase + // so we have only a "dump" of the settings + + if ( matchesVersionRange( "[2.0.3,3.0-alpha-1)" ) ) + { + assertEquals( 2, activeProfilesNode.getChildCount() ); + } + else + { + assertEquals( 1, activeProfilesNode.getChildCount() ); + } List activeProfiles = new ArrayList( 2 ); @@ -150,7 +161,10 @@ public class MavenITmng5224InjectedSettings activeProfiles.add( node.getValue() ); } - assertTrue( activeProfiles.contains( "apache" ) ); + if ( matchesVersionRange( "[2.0.3,3.0-alpha-1)" ) ) + { + assertTrue( activeProfiles.contains( "apache" ) ); + } assertTrue( activeProfiles.contains( "it-defaults" ) ); }