Repository: maven-integration-testing Updated Branches: refs/heads/master 67974fe93 -> ba8184a03
use touch plugin for every checks 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/ba8184a0 Tree: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/tree/ba8184a0 Diff: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/diff/ba8184a0 Branch: refs/heads/master Commit: ba8184a032e2c4dc7369cc71a501b58bafa980f2 Parents: 67974fe Author: Hervé Boutemy <hbout...@apache.org> Authored: Sun Jun 1 17:46:57 2014 +0200 Committer: Hervé Boutemy <hbout...@apache.org> Committed: Sun Jun 1 17:46:57 2014 +0200 ---------------------------------------------------------------------- ...enITmng5608ProfileActivationWarningTest.java | 15 +++++---- .../src/test/resources/mng-5608/pom.xml | 34 ++++++++++++++------ 2 files changed, 33 insertions(+), 16 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/ba8184a0/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5608ProfileActivationWarningTest.java ---------------------------------------------------------------------- diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5608ProfileActivationWarningTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5608ProfileActivationWarningTest.java index 410ee41..f80dae3 100644 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5608ProfileActivationWarningTest.java +++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5608ProfileActivationWarningTest.java @@ -50,12 +50,9 @@ public class MavenITmng5608ProfileActivationWarningTest verifier.verifyErrorFreeLog(); verifier.resetStreams(); - // check expected profiles activated, just for sanity - Properties props = verifier.loadProperties( "target/project.properties" ); - assertEquals( "expected profile exists-basedir", "expected active profile", - props.getProperty( "exists-basedir" ) ); - assertEquals( "expected profile mng-5608-missing-project.basedir", "expected active profile", - props.getProperty( "mng-5608-missing-project.basedir" ) ); + // check expected profiles activated, just for sanity (or build should have failed, given other profiles) + assertFileExists( testDir, "target/exists-basedir" ); + assertFileExists( testDir, "target/mng-5608-missing-project.basedir" ); // check that the 2 profiles using ${project.basedir} caused warnings List<String> logFile = verifier.loadFile( verifier.getBasedir(), verifier.getLogFileName(), false ); @@ -63,6 +60,12 @@ public class MavenITmng5608ProfileActivationWarningTest assertNotNull( findWarning( logFile, "mng-5608-missing-project.basedir" ) ); } + private void assertFileExists( File dir, String filename ) + { + File file = new File( dir, filename ); + assertTrue( "expected file: " + file , file.exists() ); + } + private String findWarning( List<String> logLines, String profileId ) { Pattern pattern = Pattern.compile( "(?i).*Failed to interpolate file location ..project.basedir./pom.xml for profile " + profileId + ": .*" ); http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/ba8184a0/core-it-suite/src/test/resources/mng-5608/pom.xml ---------------------------------------------------------------------- diff --git a/core-it-suite/src/test/resources/mng-5608/pom.xml b/core-it-suite/src/test/resources/mng-5608/pom.xml index e1d8717..29a2ee6 100644 --- a/core-it-suite/src/test/resources/mng-5608/pom.xml +++ b/core-it-suite/src/test/resources/mng-5608/pom.xml @@ -33,13 +33,13 @@ under the License. <plugins> <plugin> <groupId>org.apache.maven.its.plugins</groupId> - <artifactId>maven-it-plugin-uses-properties</artifactId> + <artifactId>maven-it-plugin-touch</artifactId> <version>2.1-SNAPSHOT</version> <executions> <execution> <phase>validate</phase> <goals> - <goal>generate-properties</goal> + <goal>touch</goal> </goals> </execution> </executions> @@ -61,7 +61,6 @@ under the License. <plugin> <groupId>org.apache.maven.its.plugins</groupId> <artifactId>maven-it-plugin-touch</artifactId> - <version>2.1-SNAPSHOT</version> <configuration> <fail>true</fail><!-- this profile should not be activated --> </configuration> @@ -76,9 +75,17 @@ under the License. <missing>${project.basedir}/pom.xml</missing> </file> </activation> - <properties> - <mng-5608-missing-project.basedir>expected active profile</mng-5608-missing-project.basedir> - </properties> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-touch</artifactId> + <configuration> + <pluginItem>mng-5608-missing-project.basedir</pluginItem> + </configuration> + </plugin> + </plugins> + </build> </profile> <!-- for reference: ${basedir} supported for profile activation, see MNG-2363 --> @@ -89,9 +96,17 @@ under the License. <exists>${basedir}/pom.xml</exists> </file> </activation> - <properties> - <exists-basedir>expected active profile</exists-basedir> - </properties> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-touch</artifactId> + <configuration> + <goalItem>exists-basedir</goalItem> + </configuration> + </plugin> + </plugins> + </build> </profile> <profile> <id>missing-basedir</id> @@ -105,7 +120,6 @@ under the License. <plugin> <groupId>org.apache.maven.its.plugins</groupId> <artifactId>maven-it-plugin-touch</artifactId> - <version>2.1-SNAPSHOT</version> <configuration> <fail>true</fail><!-- this profile should not be activated --> </configuration>