You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by si...@apache.org on 2009/03/31 01:07:33 UTC
svn commit: r760229 -
/maven/components/trunk/maven-core/src/test/java/org/apache/maven/settings/PomConstructionWithSettingsTest.java
Author: sisbell
Date: Mon Mar 30 23:07:33 2009
New Revision: 760229
URL: http://svn.apache.org/viewvc?rev=760229&view=rev
Log:
Test for setting profile properties.
Modified:
maven/components/trunk/maven-core/src/test/java/org/apache/maven/settings/PomConstructionWithSettingsTest.java
Modified: maven/components/trunk/maven-core/src/test/java/org/apache/maven/settings/PomConstructionWithSettingsTest.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-core/src/test/java/org/apache/maven/settings/PomConstructionWithSettingsTest.java?rev=760229&r1=760228&r2=760229&view=diff
==============================================================================
--- maven/components/trunk/maven-core/src/test/java/org/apache/maven/settings/PomConstructionWithSettingsTest.java (original)
+++ maven/components/trunk/maven-core/src/test/java/org/apache/maven/settings/PomConstructionWithSettingsTest.java Mon Mar 30 23:07:33 2009
@@ -3,6 +3,7 @@
import java.io.File;
import java.io.IOException;
import java.io.Reader;
+import java.util.List;
import org.apache.maven.artifact.repository.DefaultArtifactRepository;
import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout;
@@ -39,10 +40,10 @@
mavenProjectBuilder = (DefaultMavenProjectBuilder) lookup( MavenProjectBuilder.class );
}
- public void testA() throws Exception
+ public void testSettingsNoPom() throws Exception
{
PomTestWrapper pom = buildPom( "settings-no-pom" );
- System.out.println(pom.getDomainModel().asString());
+ assertEquals( "local-profile-prop-value", pom.getValue( "properties/local-profile-prop" ) );
}
private PomTestWrapper buildPom( String pomPath )
@@ -62,6 +63,16 @@
profileManager.addProfile( profile );
}
+
+ List<String> settingsActiveProfileIds = settings.getActiveProfiles();
+
+ if ( settingsActiveProfileIds != null )
+ {
+ for ( String profileId : settingsActiveProfileIds )
+ {
+ profileManager.getProfileActivationContext().setActive( profileId );
+ }
+ }
ProjectBuilderConfiguration config = new DefaultProjectBuilderConfiguration();
config.setLocalRepository(new DefaultArtifactRepository("default", "", new DefaultRepositoryLayout()));