diff --git a/maven-core-it/it0105/cli-options.txt b/maven-core-it/it0105/cli-options.txt new file mode 100644 index 0000000000..95ea6e735d --- /dev/null +++ b/maven-core-it/it0105/cli-options.txt @@ -0,0 +1 @@ +-Dparam=PARAM diff --git a/maven-core-it/it0105/expected-results.txt b/maven-core-it/it0105/expected-results.txt new file mode 100644 index 0000000000..e97e56f118 --- /dev/null +++ b/maven-core-it/it0105/expected-results.txt @@ -0,0 +1 @@ +target/classes/test.properties diff --git a/maven-core-it/it0105/filter.properties b/maven-core-it/it0105/filter.properties new file mode 100644 index 0000000000..e69de29bb2 diff --git a/maven-core-it/it0105/goals.txt b/maven-core-it/it0105/goals.txt new file mode 100644 index 0000000000..9daeafb986 --- /dev/null +++ b/maven-core-it/it0105/goals.txt @@ -0,0 +1 @@ +test diff --git a/maven-core-it/it0105/pom.xml b/maven-core-it/it0105/pom.xml new file mode 100644 index 0000000000..f24839c3b0 --- /dev/null +++ b/maven-core-it/it0105/pom.xml @@ -0,0 +1,34 @@ + + 4.0.0 + testing + maven-core-it-it0105 + 1.0 + + + junit + junit + 3.8.1 + jar + test + + + + + + + + src/main/resources + true + + + + + + foo + + diff --git a/maven-core-it/it0105/src/main/resources/test.properties b/maven-core-it/it0105/src/main/resources/test.properties new file mode 100644 index 0000000000..402442e8fe --- /dev/null +++ b/maven-core-it/it0105/src/main/resources/test.properties @@ -0,0 +1,3 @@ +systemProperty=${user.home} +param=${param} +pom.property=${my.property} diff --git a/maven-core-it/it0105/src/test/java/org/apache/maven/it0105/FilterTest.java b/maven-core-it/it0105/src/test/java/org/apache/maven/it0105/FilterTest.java new file mode 100644 index 0000000000..53caf19ab8 --- /dev/null +++ b/maven-core-it/it0105/src/test/java/org/apache/maven/it0105/FilterTest.java @@ -0,0 +1,49 @@ +package org.apache.maven.it0105; + +import junit.framework.TestCase; + +import java.util.Properties; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; + +public class FilterTest + extends TestCase +{ + private String basedir; + + private Properties properties; + + protected void setUp() + throws Exception + { + basedir = System.getProperty( "basedir" ); + + properties = new Properties(); + + File testPropertiesFile = new File( basedir, "target/classes/test.properties" ); + + assertTrue( testPropertiesFile.exists() ); + + properties.load( new FileInputStream( testPropertiesFile ) ); + } + + public void testSystemPropertyInterpolation() + throws IOException + { + assertEquals( "System property", System.getProperty( "user.home" ), properties.getProperty( "systemProperty" ) ); + } + + public void testParameterInterpolation() + throws IOException + { + assertEquals( "Parameter", System.getProperty( "parameter" ), properties.getProperty( "parameter" ) ); + } + + public void testPomPropertyInterpolation() + throws IOException + { + assertEquals( "Pom Property", "foo", properties.getProperty( "pom.property" ) ); + } + +}