Author: bentmann Date: Sun Dec 28 14:10:51 2008 New Revision: 729788 URL: http://svn.apache.org/viewvc?rev=729788&view=rev Log: [MNG-3933] Profiles.xml does not pickup OS family
o Added IT Added: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3933OsTriggeredExternalProfileTest.java (with props) maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3933/ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3933/pom.xml (with props) maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3933/profiles.xml (with props) Modified: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3944BasedirInterpolationTest.java Modified: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java?rev=729788&r1=729787&r2=729788&view=diff ============================================================================== --- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java (original) +++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java Sun Dec 28 14:10:51 2008 @@ -95,6 +95,7 @@ suite.addTestSuite( MavenITmng3940EnvVarInterpolationTest.class ); suite.addTestSuite( MavenITmng3938MergePluginExecutionsTest.class ); suite.addTestSuite( MavenITmng3937MergedPluginExecutionGoalsTest.class ); + suite.addTestSuite( MavenITmng3933OsTriggeredExternalProfileTest.class ); suite.addTestSuite( MavenITmng3927PluginDefaultExecutionConfigTest.class ); suite.addTestSuite( MavenITmng3925MergedPluginExecutionOrderTest.class ); suite.addTestSuite( MavenITmng3924XmlMarkupInterpolationTest.class ); Added: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3933OsTriggeredExternalProfileTest.java URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3933OsTriggeredExternalProfileTest.java?rev=729788&view=auto ============================================================================== --- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3933OsTriggeredExternalProfileTest.java (added) +++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3933OsTriggeredExternalProfileTest.java Sun Dec 28 14:10:51 2008 @@ -0,0 +1,72 @@ +package org.apache.maven.it; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import org.apache.maven.it.Verifier; +import org.apache.maven.it.util.ResourceExtractor; +import org.apache.maven.it.util.Os; + +import java.io.File; +import java.util.Properties; + +/** + * This is a test set for <a href="http://jira.codehaus.org/browse/MNG-3933">MNG-3933</a>. + * + * @author Benjamin Bentmann + * @version $Id$ + */ +public class MavenITmng3933OsTriggeredExternalProfileTest + extends AbstractMavenIntegrationTestCase +{ + + public MavenITmng3933OsTriggeredExternalProfileTest() + { + super( "(2.0.10,2.1.0-M1),(2.1.0-M1,)" ); + } + + /** + * Test that OS-triggered profiles from an external profiles.xml are activated. + */ + public void testitMNG3933() + throws Exception + { + File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3933" ); + + Verifier verifier = new Verifier( testDir.getAbsolutePath() ); + verifier.setAutoclean( false ); + verifier.deleteDirectory( "target" ); + verifier.executeGoal( "validate" ); + verifier.verifyErrorFreeLog(); + verifier.resetStreams(); + + Properties props = verifier.loadProperties( "target/profile.properties" ); + if ( Os.isFamily( Os.FAMILY_WINDOWS ) || Os.isFamily( Os.FAMILY_MAC ) || Os.isFamily( Os.FAMILY_UNIX ) ) + { + assertEquals( "PASSED", props.getProperty( "project.properties.profileProperty" ) ); + } + else + { + System.out.println(); + System.out.println( "[WARNING] Skipping test on unrecognized OS: " + Os.OS_NAME ); + System.out.println(); + } + } + +} Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3933OsTriggeredExternalProfileTest.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3933OsTriggeredExternalProfileTest.java ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Modified: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3944BasedirInterpolationTest.java URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3944BasedirInterpolationTest.java?rev=729788&r1=729787&r2=729788&view=diff ============================================================================== --- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3944BasedirInterpolationTest.java (original) +++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3944BasedirInterpolationTest.java Sun Dec 28 14:10:51 2008 @@ -21,7 +21,6 @@ import org.apache.maven.it.Verifier; import org.apache.maven.it.util.ResourceExtractor; -import org.apache.maven.it.util.Os; import java.io.File; import java.util.Properties; Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3933/pom.xml URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3933/pom.xml?rev=729788&view=auto ============================================================================== --- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3933/pom.xml (added) +++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3933/pom.xml Sun Dec 28 14:10:51 2008 @@ -0,0 +1,57 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> + +<project> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3933</groupId> + <artifactId>test1</artifactId> + <version>1.0-SNAPSHOT</version> + + <name>Maven Integration Test :: MNG-3933</name> + <description> + Test that OS-triggered profiles from an external profiles.xml are activated. + </description> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-expression</artifactId> + <version>2.1-SNAPSHOT</version> + <executions> + <execution> + <phase>validate</phase> + <goals> + <goal>eval</goal> + </goals> + <configuration> + <outputFile>target/profile.properties</outputFile> + <expressions> + <expression>project/properties</expression> + </expressions> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3933/pom.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3933/pom.xml ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3933/profiles.xml URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3933/profiles.xml?rev=729788&view=auto ============================================================================== --- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3933/profiles.xml (added) +++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3933/profiles.xml Sun Dec 28 14:10:51 2008 @@ -0,0 +1,56 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> + +<profiles> + <profile> + <id>PROFILE-A</id> + <activation> + <os> + <family>winDOWS</family> + </os> + </activation> + <properties> + <profileProperty>PASSED</profileProperty> + </properties> + </profile> + <profile> + <id>PROFILE-B</id> + <activation> + <os> + <family>unIX</family> + </os> + </activation> + <properties> + <profileProperty>PASSED</profileProperty> + </properties> + </profile> + <profile> + <id>PROFILE-C</id> + <activation> + <os> + <family>mAC</family> + </os> + </activation> + <properties> + <profileProperty>PASSED</profileProperty> + </properties> + </profile> +</profiles> Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3933/profiles.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3933/profiles.xml ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision