mirror of https://github.com/apache/maven.git
o adding IT it0105
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@465878 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c3a801db81
commit
98141a96c8
|
@ -0,0 +1,35 @@
|
|||
<project xmlns="http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>testing</groupId>
|
||||
<artifactId>maven-core-it-it0105</artifactId>
|
||||
<description>MRESOURCES-18</description>
|
||||
<version>1.0</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<type>jar</type>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<!-- Enabling this will fix the problem for
|
||||
maven-resources-plugin 2.2-20060403.015736-1 and earlier.
|
||||
<filters>
|
||||
<filter>filter.properties</filter>
|
||||
</filters>
|
||||
-->
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
</build>
|
||||
|
||||
<properties>
|
||||
<my.property>foo</my.property>
|
||||
</properties>
|
||||
</project>
|
|
@ -0,0 +1,3 @@
|
|||
systemProperty=${java.version}
|
||||
param=${param}
|
||||
pom.property=${my.property}
|
|
@ -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( "java.version" ), 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" ) );
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue