diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java b/its/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java index 2a5240e83d..1199713436 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java @@ -88,6 +88,7 @@ public class IntegrationTestSuite // suite.addTestSuite( MavenIT0109ReleaseUpdateTest.class ); // suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137 + suite.addTestSuite( MavenITmng3833PomInterpolationDataFlowChainTest.class ); suite.addTestSuite( MavenITmng3831PomInterpolationTest.class ); suite.addTestSuite( MavenITmng3827PluginConfigTest.class ); suite.addTestSuite( MavenITmng3822BasedirAlignedInterpolationTest.class ); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3833PomInterpolationDataFlowChainTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3833PomInterpolationDataFlowChainTest.java new file mode 100644 index 0000000000..80baca0613 --- /dev/null +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3833PomInterpolationDataFlowChainTest.java @@ -0,0 +1,67 @@ +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 MNG-3833. + * + * @author Benjamin Bentmann + * @version $Id$ + */ +public class MavenITmng3833PomInterpolationDataFlowChainTest + extends AbstractMavenIntegrationTestCase +{ + + public MavenITmng3833PomInterpolationDataFlowChainTest() + { + } + + /** + * Test that POM interpolation fully interpolates all properties in data flow chain, i.e. where property + * A depends on property B, and property B depends on property C and so on. + */ + public void testitMNG3833() + throws Exception + { + File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3833" ); + + Verifier verifier = new Verifier( testDir.getAbsolutePath() ); + verifier.setAutoclean( false ); + verifier.deleteDirectory( "target" ); + verifier.executeGoal( "validate" ); + verifier.verifyErrorFreeLog(); + verifier.resetStreams(); + + Properties props = verifier.loadProperties( "target/interpolated.properties" ); + + for ( int i = 0; i < 24; i++ ) + { + String index = ( ( i < 10 ) ? "0" : "" ) + i; + assertEquals( "PASSED", props.getProperty( "project.properties.property" + index ) ); + } + } + +} diff --git a/its/core-it-suite/src/test/resources/mng-3833/pom.xml b/its/core-it-suite/src/test/resources/mng-3833/pom.xml new file mode 100644 index 0000000000..7beadc2e25 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-3833/pom.xml @@ -0,0 +1,90 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng3833 + coreit + 0.1 + jar + + Maven Integration Test :: MNG-3833 + + Test that POM interpolation fully interpolates all properties in data flow chain, i.e. where property + A depends on property B, and property B depends on property C and so on. + + + + + ${property22} + ${property20} + ${property18} + ${property16} + ${property14} + ${property12} + ${property10} + ${property08} + ${property06} + ${property04} + ${property02} + ${property00} + PASSED + ${property01} + ${property03} + ${property05} + ${property09} + ${property11} + ${property07} + ${property13} + ${property15} + ${property17} + ${property19} + ${property21} + + + + + + org.apache.maven.its.plugins + maven-it-plugin-expression + 2.1-SNAPSHOT + + + validate + + eval + + + target/interpolated.properties + + project/properties + + + + + + + +