mirror of https://github.com/apache/maven.git
o Strengthened IT
git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@816726 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
e663e1a7b8
commit
76ea07d222
|
@ -23,6 +23,7 @@ import org.apache.maven.it.Verifier;
|
|||
import org.apache.maven.it.util.ResourceExtractor;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Properties;
|
||||
|
||||
/**
|
||||
* This is a test set for <a href="http://jira.codehaus.org/browse/MNG-674">MNG-674</a>.
|
||||
|
@ -33,15 +34,16 @@ import java.io.File;
|
|||
public class MavenITmng0674PluginParameterAliasTest
|
||||
extends AbstractMavenIntegrationTestCase
|
||||
{
|
||||
|
||||
public MavenITmng0674PluginParameterAliasTest()
|
||||
{
|
||||
super( ALL_MAVEN_VERSIONS );
|
||||
}
|
||||
|
||||
/**
|
||||
* Test parameter alias usage.
|
||||
* Test parameter alias usage for lifecycle-bound goal execution.
|
||||
*/
|
||||
public void testitMNG674()
|
||||
public void testitLifecycle()
|
||||
throws Exception
|
||||
{
|
||||
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0674" );
|
||||
|
@ -49,11 +51,35 @@ public class MavenITmng0674PluginParameterAliasTest
|
|||
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
|
||||
verifier.setAutoclean( false );
|
||||
verifier.deleteDirectory( "target" );
|
||||
verifier.executeGoal( "org.apache.maven.its.plugins:maven-it-plugin-touch:touch" );
|
||||
verifier.setLogFileName( "log-lifecycle.txt" );
|
||||
verifier.executeGoal( "validate" );
|
||||
verifier.verifyErrorFreeLog();
|
||||
verifier.resetStreams();
|
||||
|
||||
verifier.assertFilePresent( "target/touchFile.txt" );
|
||||
Properties props = verifier.loadProperties( "target/config.properties" );
|
||||
assertEquals( "MNG-674-1", props.getProperty( "aliasParam" ) );
|
||||
assertEquals( "MNG-674-2", props.getProperty( "aliasDefaultExpressionParam" ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Test parameter alias usage for direct goal execution from CLI.
|
||||
*/
|
||||
public void testitCli()
|
||||
throws Exception
|
||||
{
|
||||
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0674" );
|
||||
|
||||
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
|
||||
verifier.setAutoclean( false );
|
||||
verifier.deleteDirectory( "target" );
|
||||
verifier.setLogFileName( "log-cli.txt" );
|
||||
verifier.executeGoal( "org.apache.maven.its.plugins:maven-it-plugin-configuration:config" );
|
||||
verifier.verifyErrorFreeLog();
|
||||
verifier.resetStreams();
|
||||
|
||||
Properties props = verifier.loadProperties( "target/config.properties" );
|
||||
assertEquals( "MNG-674-1", props.getProperty( "aliasParam" ) );
|
||||
assertEquals( "MNG-674-2", props.getProperty( "aliasDefaultExpressionParam" ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,21 +1,36 @@
|
|||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<name>Maven Integration Test :: it0049</name>
|
||||
<groupId>org.apache.maven.its.it0049</groupId>
|
||||
<artifactId>maven-it-it0049</artifactId>
|
||||
<description>Test parameter alias usage.</description>
|
||||
|
||||
<groupId>org.apache.maven.its.mng0674</groupId>
|
||||
<artifactId>test</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<name>Maven Integration Test :: MNG-674</name>
|
||||
<description>Test parameter alias usage.</description>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.its.plugins</groupId>
|
||||
<artifactId>maven-it-plugin-touch</artifactId>
|
||||
<artifactId>maven-it-plugin-configuration</artifactId>
|
||||
<version>2.1-SNAPSHOT</version>
|
||||
<configuration>
|
||||
<pluginFile>touchFile.txt</pluginFile>
|
||||
<propertiesFile>target/config.properties</propertiesFile>
|
||||
<!-- parameter that has no default value -->
|
||||
<aliasParamLegacy>MNG-674-1</aliasParamLegacy>
|
||||
<!-- parameter that has a default value -->
|
||||
<fullyAnnotatedParam>MNG-674-2</fullyAnnotatedParam>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>test</id>
|
||||
<phase>validate</phase>
|
||||
<goals>
|
||||
<goal>config</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
|
|
Loading…
Reference in New Issue