mirror of
https://github.com/apache/maven.git
synced 2025-02-28 13:49:19 +00:00
o adding IT it0088
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@465862 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6ccfd023a6
commit
af51d54d16
@ -0,0 +1,44 @@
|
||||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.apache.maven.it</groupId>
|
||||
<artifactId>maven-core-it0088</artifactId>
|
||||
<description>Test path translation.</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>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-core-it-plugin</artifactId>
|
||||
<version>1.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>process-resources</phase>
|
||||
<configuration>
|
||||
<projectBuildDirectory>${project.build.directory}</projectBuildDirectory>
|
||||
<targetDirectoryString>target</targetDirectoryString>
|
||||
<targetDirectoryFile>target</targetDirectoryFile>
|
||||
</configuration>
|
||||
<goals>
|
||||
<goal>generate-properties</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
@ -0,0 +1 @@
|
||||
project.build.directory = ${project.build.directory}
|
@ -0,0 +1,53 @@
|
||||
package org.apache.maven.it0088;
|
||||
|
||||
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 testProjectBuildDirectoryAfterResourceFiltering()
|
||||
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( projectBuildDirectory.getAbsolutePath(), testProperties.getProperty( "project.build.directory" ) );
|
||||
}
|
||||
|
||||
public void testProjectBuildDirectoryForMojoExecution()
|
||||
throws Exception
|
||||
{
|
||||
Properties testProperties = new Properties();
|
||||
|
||||
File testPropertiesFile = new File( basedir, "target/mojo-generated.properties" );
|
||||
|
||||
assertTrue( testPropertiesFile.exists() );
|
||||
|
||||
testProperties.load( new FileInputStream( testPropertiesFile ) );
|
||||
|
||||
File projectBuildDirectory = new File( basedir, "target" );
|
||||
|
||||
assertEquals( projectBuildDirectory.getAbsolutePath(), testProperties.getProperty( "project.build.directory" ) );
|
||||
assertEquals( projectBuildDirectory.getAbsolutePath(), testProperties.getProperty( "targetDirectoryFile" ) );
|
||||
assertEquals( "target", testProperties.getProperty( "targetDirectoryString" ) );
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user