o adding IT it0091

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@465865 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jason van Zyl 2006-10-19 20:50:00 +00:00
parent b1c46ed005
commit 3dbf496c38
5 changed files with 104 additions and 0 deletions
maven-core-integration-tests/src/test/resources/it0091
pom.xmlrun.sh
src
main
test/java/org/apache/maven/it0091

View File

@ -0,0 +1,40 @@
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.it</groupId>
<artifactId>maven-core-it0090</artifactId>
<description>Test that currently demonstrates that properties are not correctly
interpolated into other areas in the POM. This may strictly be a boolean
problem: I captured the problem as it was reported.</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>
<properties>
<filter.resources>true</filter.resources>
<name>jason</name>
</properties>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<!--
<filtering>${filtering.resources}</filtering>
-->
</resource>
<resource>
<directory>${project.build.sourceDirectory}</directory>
<filtering>true</filtering>
<includes>
<include>**/*.properties</include>
</includes>
</resource>
</resources>
</build>
</project>

View File

@ -0,0 +1,10 @@
#!/bin/sh
m2Versions="2.0.1 2.0.2 2.0.3 2.0.4"
for i in $m2Versions
do
echo "Testing against version $i"
M2_HOME=$HOME/maven-${i}
mvn clean test
done

View File

@ -0,0 +1,2 @@
# When we want to test the filtering of envars
name=${name}

View File

@ -0,0 +1,51 @@
package org.apache.maven.it0091;
import junit.framework.TestCase;
import java.util.Properties;
import java.io.File;
import java.io.FileInputStream;
public class PomInterpolationTest
extends TestCase
{
private String basedir;
protected void setUp()
throws Exception
{
basedir = System.getProperty( "basedir" );
}
public void testProjectBuildDirectoryAfterForMojoExecution()
throws Exception
{
Properties testProperties = new Properties();
File testPropertiesFile = new File( basedir, "target/classes/test.properties" );
assertTrue( testPropertiesFile.exists() );
testProperties.load( new FileInputStream( testPropertiesFile ) );
File projectBuildDirectory = new File( basedir, "target" );
assertEquals( testProperties.getProperty( "name" ), "jason" );
}
public void testInterpolatedProjectSourceDirectory()
throws Exception
{
Properties testProperties = new Properties();
File testPropertiesFile = new File( basedir, "target/classes/source.properties" );
assertTrue( testPropertiesFile.exists() );
testProperties.load( new FileInputStream( testPropertiesFile ) );
File projectBuildDirectory = new File( basedir, "target" );
assertEquals( testProperties.getProperty( "name" ), "jason" );
}
}