mirror of https://github.com/apache/maven.git
[MNG-3933] Profiles.xml does not pickup OS family
o Added IT git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@729788 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
74176ac173
commit
52c6049ea3
|
@ -95,6 +95,7 @@ public class IntegrationTestSuite
|
||||||
suite.addTestSuite( MavenITmng3940EnvVarInterpolationTest.class );
|
suite.addTestSuite( MavenITmng3940EnvVarInterpolationTest.class );
|
||||||
suite.addTestSuite( MavenITmng3938MergePluginExecutionsTest.class );
|
suite.addTestSuite( MavenITmng3938MergePluginExecutionsTest.class );
|
||||||
suite.addTestSuite( MavenITmng3937MergedPluginExecutionGoalsTest.class );
|
suite.addTestSuite( MavenITmng3937MergedPluginExecutionGoalsTest.class );
|
||||||
|
suite.addTestSuite( MavenITmng3933OsTriggeredExternalProfileTest.class );
|
||||||
suite.addTestSuite( MavenITmng3927PluginDefaultExecutionConfigTest.class );
|
suite.addTestSuite( MavenITmng3927PluginDefaultExecutionConfigTest.class );
|
||||||
suite.addTestSuite( MavenITmng3925MergedPluginExecutionOrderTest.class );
|
suite.addTestSuite( MavenITmng3925MergedPluginExecutionOrderTest.class );
|
||||||
suite.addTestSuite( MavenITmng3924XmlMarkupInterpolationTest.class );
|
suite.addTestSuite( MavenITmng3924XmlMarkupInterpolationTest.class );
|
||||||
|
|
|
@ -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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -21,7 +21,6 @@ package org.apache.maven.it;
|
||||||
|
|
||||||
import org.apache.maven.it.Verifier;
|
import org.apache.maven.it.Verifier;
|
||||||
import org.apache.maven.it.util.ResourceExtractor;
|
import org.apache.maven.it.util.ResourceExtractor;
|
||||||
import org.apache.maven.it.util.Os;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
|
|
@ -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>
|
|
@ -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>
|
Loading…
Reference in New Issue