From 436f79079ce3d38e51c8b71bd87a415d0de4bdd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Boutemy?= Date: Sun, 1 Jun 2014 17:46:57 +0200 Subject: [PATCH] use touch plugin for every checks --- ...ITmng5608ProfileActivationWarningTest.java | 15 ++++---- .../src/test/resources/mng-5608/pom.xml | 34 +++++++++++++------ 2 files changed, 33 insertions(+), 16 deletions(-) diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5608ProfileActivationWarningTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5608ProfileActivationWarningTest.java index 410ee41b1f..f80dae3a39 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5608ProfileActivationWarningTest.java +++ b/its/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 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 logLines, String profileId ) { Pattern pattern = Pattern.compile( "(?i).*Failed to interpolate file location ..project.basedir./pom.xml for profile " + profileId + ": .*" ); diff --git a/its/core-it-suite/src/test/resources/mng-5608/pom.xml b/its/core-it-suite/src/test/resources/mng-5608/pom.xml index e1d87174f3..29a2ee648c 100644 --- a/its/core-it-suite/src/test/resources/mng-5608/pom.xml +++ b/its/core-it-suite/src/test/resources/mng-5608/pom.xml @@ -33,13 +33,13 @@ under the License. org.apache.maven.its.plugins - maven-it-plugin-uses-properties + maven-it-plugin-touch 2.1-SNAPSHOT validate - generate-properties + touch @@ -61,7 +61,6 @@ under the License. org.apache.maven.its.plugins maven-it-plugin-touch - 2.1-SNAPSHOT true @@ -76,9 +75,17 @@ under the License. ${project.basedir}/pom.xml - - expected active profile - + + + + org.apache.maven.its.plugins + maven-it-plugin-touch + + mng-5608-missing-project.basedir + + + + @@ -89,9 +96,17 @@ under the License. ${basedir}/pom.xml - - expected active profile - + + + + org.apache.maven.its.plugins + maven-it-plugin-touch + + exists-basedir + + + + missing-basedir @@ -105,7 +120,6 @@ under the License. org.apache.maven.its.plugins maven-it-plugin-touch - 2.1-SNAPSHOT true