[MNG-4009] [regression] Effects of active profiles from parent are not inherited by children.

o Added IT

git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@738159 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2009-01-27 17:29:57 +00:00
parent 3da0c8504b
commit 573b19be5b
4 changed files with 174 additions and 0 deletions

View File

@ -90,6 +90,7 @@ public class IntegrationTestSuite
// suite.addTestSuite( MavenIT0109ReleaseUpdateTest.class );
// suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137
suite.addTestSuite( MavenITmng4009InheritProfileEffectsTest.class );
suite.addTestSuite( MavenITmng4008MergedFilterOrderTest.class );
suite.addTestSuite( MavenITmng4007PlatformFileSeparatorTest.class );
suite.addTestSuite( MavenITmng4000MultiPluginExecutionsTest.class );

View File

@ -0,0 +1,64 @@
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 java.io.File;
import java.util.Properties;
/**
* This is a test set for <a href="http://jira.codehaus.org/browse/MNG-4009">MNG-4009</a>.
*
* @author Benjamin Bentmann
* @version $Id$
*/
public class MavenITmng4009InheritProfileEffectsTest
extends AbstractMavenIntegrationTestCase
{
public MavenITmng4009InheritProfileEffectsTest()
{
super();
}
/**
* Verify that the effects of profiles on a parent are inherited by children.
*/
public void testitMNG4009()
throws Exception
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4009" );
Verifier verifier = new Verifier( new File( testDir, "sub" ).getAbsolutePath() );
verifier.setAutoclean( false );
verifier.deleteDirectory( "target" );
verifier.getCliOptions().add( "-Pparent-profile" );
verifier.executeGoal( "validate" );
verifier.verifyErrorFreeLog();
verifier.resetStreams();
Properties props = verifier.loadProperties( "target/profile.properties" );
assertEquals( "PASSED", props.getProperty( "project.properties.parentProfileProperty" ) );
}
}

View File

@ -0,0 +1,44 @@
<?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 xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.its.mng4009</groupId>
<artifactId>parent</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<name>Maven Integration Test :: MNG-4009</name>
<description>
Verify that the effects of profiles on a parent are inherited by children.
</description>
<profiles>
<profile>
<id>parent-profile</id>
<properties>
<!-- our children should see this, too -->
<parentProfileProperty>PASSED</parentProfileProperty>
</properties>
</profile>
</profiles>
</project>

View File

@ -0,0 +1,65 @@
<?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 xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.maven.its.mng4009</groupId>
<artifactId>parent</artifactId>
<version>1.0</version>
</parent>
<groupId>org.apache.maven.its.mng4009</groupId>
<artifactId>test</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<name>Maven Integration Test :: MNG-4009</name>
<description>
Verify that the effects of profiles on a parent are inherited by children.
</description>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.its.plugins</groupId>
<artifactId>maven-it-plugin-expression</artifactId>
<version>2.1-SNAPSHOT</version>
<configuration>
<outputFile>target/profile.properties</outputFile>
<expressions>
<expression>project/properties</expression>
</expressions>
</configuration>
<executions>
<execution>
<id>effective-model</id>
<phase>validate</phase>
<goals>
<goal>eval</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>