Updated Branches: refs/heads/issues/MNG-5418 ddf30175b -> 7d32dc123
it test for MNG-5418 Project: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/repo Commit: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/commit/7d32dc12 Tree: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/tree/7d32dc12 Diff: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/diff/7d32dc12 Branch: refs/heads/issues/MNG-5418 Commit: 7d32dc12347afb3c74bc6111b15d600c172a1d2a Parents: ddf3017 Author: olivier lamy <ol...@apache.org> Authored: Sat Jan 5 09:40:04 2013 +0100 Committer: olivier lamy <ol...@apache.org> Committed: Sat Jan 5 09:40:04 2013 +0100 ---------------------------------------------------------------------- ...Tmng5418FileProjectPropertiesActivatorTest.java | 62 ++++++ core-it-suite/src/test/resources/mng-5418/pom.xml | 161 +++++++++++++++ 2 files changed, 223 insertions(+), 0 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/7d32dc12/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5418FileProjectPropertiesActivatorTest.java ---------------------------------------------------------------------- diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5418FileProjectPropertiesActivatorTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5418FileProjectPropertiesActivatorTest.java new file mode 100644 index 0000000..8f817f8 --- /dev/null +++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5418FileProjectPropertiesActivatorTest.java @@ -0,0 +1,62 @@ +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.util.ResourceExtractor; + +import java.io.File; + +/** + * This is a test set for <a href="http://jira.codehaus.org/browse/MNG-5481">MNG-5418</a>. + * + * @author Olivier Lamy + */ +public class MavenITmng5418FileProjectPropertiesActivatorTest + extends AbstractMavenIntegrationTestCase +{ + + public MavenITmng5418FileProjectPropertiesActivatorTest() + { + super( "[3.1,)" ); + } + + /** + * Test that the file-based profile activator resolves project properties. + */ + public void testit() + throws Exception + { + File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-5418" ); + + Verifier verifier = newVerifier( testDir.getAbsolutePath() ); + verifier.setAutoclean( false ); + verifier.deleteDirectory( "target" ); + verifier.executeGoal( "validate" ); + verifier.verifyErrorFreeLog(); + verifier.resetStreams(); + + verifier.assertFilePresent( "target/path1.txt" ); + verifier.assertFilePresent( "target/file1.txt" ); + verifier.assertFilePresent( "target/missing1.txt" ); + verifier.assertFileNotPresent( "target/missing2.txt" ); + + } + +} http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/7d32dc12/core-it-suite/src/test/resources/mng-5418/pom.xml ---------------------------------------------------------------------- diff --git a/core-it-suite/src/test/resources/mng-5418/pom.xml b/core-it-suite/src/test/resources/mng-5418/pom.xml new file mode 100644 index 0000000..c84aa52 --- /dev/null +++ b/core-it-suite/src/test/resources/mng-5418/pom.xml @@ -0,0 +1,161 @@ +<?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.mng5418</groupId> + <artifactId>parent</artifactId> + <version>0.1</version> + <packaging>pom</packaging> + + <name>Maven Integration Test :: MNG-5418</name> + <description> + Test that the file-based profile activator resolves file path with project properties. + </description> + + + <properties> + <site.base.path>${basedir}</site.base.path> + <site.final.path>${site.base.path}/sub1</site.final.path> + <site.final.file>${site.base.path}/sub1/foo.txt</site.final.file> + <site.final.path.not>${site.base.path}/sub2</site.final.path.not> + </properties> + + <profiles> + <profile> + <id>path-1</id> + <activation> + <file> + <exists>${site.final.path}</exists> + </file> + </activation> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-log-file</artifactId> + <version>2.1-SNAPSHOT</version> + <executions> + <execution> + <id>test-1</id> + <phase>validate</phase> + <configuration> + <logFile>target/path1.txt</logFile> + </configuration> + <goals> + <goal>reset</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + <profile> + <id>file-1</id> + <activation> + <file> + <exists>${site.final.file}</exists> + </file> + </activation> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-log-file</artifactId> + <version>2.1-SNAPSHOT</version> + <executions> + <execution> + <id>test-2</id> + <phase>validate</phase> + <configuration> + <logFile>target/file1.txt</logFile> + </configuration> + <goals> + <goal>reset</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + <profile> + <id>missing-1</id> + <activation> + <file> + <missing>${site.final.path.not}</missing> + </file> + </activation> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-log-file</artifactId> + <version>2.1-SNAPSHOT</version> + <executions> + <execution> + <id>test-3</id> + <phase>validate</phase> + <configuration> + <logFile>target/missing1.txt</logFile> + </configuration> + <goals> + <goal>reset</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + <profile> + <id>missing-2</id> + <activation> + <file> + <exists>${site.final.path.not}</exists> + </file> + </activation> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-log-file</artifactId> + <version>2.1-SNAPSHOT</version> + <executions> + <execution> + <id>test-4</id> + <phase>validate</phase> + <configuration> + <logFile>target/missing2.txt</logFile> + </configuration> + <goals> + <goal>reset</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + </profiles> +</project> http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/7d32dc12/core-it-suite/src/test/resources/mng-5418/sub1/foo.txt ---------------------------------------------------------------------- diff --git a/core-it-suite/src/test/resources/mng-5418/sub1/foo.txt b/core-it-suite/src/test/resources/mng-5418/sub1/foo.txt new file mode 100644 index 0000000..e69de29