o adding IT it0054

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@465828 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jason van Zyl 2006-10-19 20:45:52 +00:00
parent 1862f24a61
commit 330da2d7da
5 changed files with 73 additions and 0 deletions

View File

@ -0,0 +1,28 @@
<model>
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core-it0054</artifactId>
<description>Test resource filtering.</description>
<packaging>jar</packaging>
<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>
<filters>
<filter>src/main/filters/filters.properties</filter>
</filters>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
</model>

View File

@ -0,0 +1,2 @@
surname = van zyl
country = Canada

View File

@ -0,0 +1,16 @@
package org.apache.maven.it0054;
public class Person
{
private String name;
public void setName( String name )
{
this.name = name;
}
public String getName()
{
return name;
}
}

View File

@ -0,0 +1,3 @@
name = jason
surname = ${surname}
country = @country@

View File

@ -0,0 +1,24 @@
package org.apache.maven.it0054;
import java.util.Properties;
import junit.framework.TestCase;
public class PersonTest
extends TestCase
{
public void testPerson()
throws Exception
{
Person person = new Person();
person.setName( "foo" );
assertEquals( "foo", person.getName() );
Properties p = new Properties();
p.load( getClass().getResourceAsStream( "/it0054.properties" ) );
assertEquals( "check name", "jason", p.getProperty( "name" ) );
assertEquals( "check surname", "van zyl", p.getProperty( "surname" ) );
assertEquals( "check country", "Canada", p.getProperty( "country" ) );
}
}