mirror of https://github.com/apache/maven.git
o Decoupled ITs from production plugins
git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@748923 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
b25030223d
commit
66d449f3fb
|
@ -31,43 +31,22 @@ import org.apache.maven.it.util.ResourceExtractor;
|
|||
public class MavenITmng2277AggregatorAndResolutionPluginsTest
|
||||
extends AbstractMavenIntegrationTestCase
|
||||
{
|
||||
|
||||
public MavenITmng2277AggregatorAndResolutionPluginsTest()
|
||||
{
|
||||
super( "(2.0.7,)" ); // 2.0.8+
|
||||
}
|
||||
|
||||
public void testitMNG2277 ()
|
||||
public void testitMNG2277()
|
||||
throws Exception
|
||||
{
|
||||
|
||||
// The testdir is computed from the location of this
|
||||
// file.
|
||||
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-2277" );
|
||||
|
||||
Verifier verifier;
|
||||
|
||||
/*
|
||||
* We must first make sure that any artifact created
|
||||
* by this test has been removed from the local
|
||||
* repository. Failing to do this could cause
|
||||
* unstable test results. Fortunately, the verifier
|
||||
* makes it easy to do this.
|
||||
*/
|
||||
verifier = new Verifier( testDir.getAbsolutePath() );
|
||||
verifier.deleteArtifact( "org.apache.maven.its.mng2277", "parent", "1.0", "pom" );
|
||||
verifier.deleteArtifact( "org.apache.maven.its.mng2277", "test", "1.0", "jar" );
|
||||
verifier.deleteArtifact( "org.apache.maven.its.mng2277", "assembly", "1.0", "jar" );
|
||||
|
||||
/*
|
||||
* The Command Line Options (CLI) are passed to the
|
||||
* verifier as a list. This is handy for things like
|
||||
* redefining the local repository if needed. In
|
||||
* this case, we use the -N flag so that Maven won't
|
||||
* recurse. We are only installing the parent pom to
|
||||
* the local repo here.
|
||||
*/
|
||||
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
|
||||
verifier.setAutoclean( false );
|
||||
verifier.deleteArtifacts( "org.apache.maven.its.mng2277" );
|
||||
verifier.executeGoal( "org.apache.maven.its.plugins:maven-it-plugin-all:aggregator-dependencies" );
|
||||
|
||||
verifier.verifyErrorFreeLog();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -23,8 +23,6 @@ import org.apache.maven.it.Verifier;
|
|||
import org.apache.maven.it.util.ResourceExtractor;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* This is a test set for <a href="http://jira.codehaus.org/browse/MNG-2293">MNG-2293</a>.
|
||||
|
@ -41,16 +39,15 @@ public class MavenITmng2293CustomPluginParamImplTest
|
|||
}
|
||||
|
||||
/**
|
||||
* Verify that default implementation of an implementation for a complex object works as
|
||||
* expected [MNG-2293]
|
||||
* Verify that default implementation of an implementation for a complex object works as expected.
|
||||
*/
|
||||
public void testitMNG2293()
|
||||
throws Exception
|
||||
{
|
||||
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-2293" );
|
||||
|
||||
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
|
||||
List cliOptions = new ArrayList();
|
||||
verifier.setCliOptions( cliOptions );
|
||||
verifier.setAutoclean( false );
|
||||
verifier.executeGoal( "validate" );
|
||||
verifier.verifyErrorFreeLog();
|
||||
verifier.resetStreams();
|
||||
|
|
|
@ -45,8 +45,10 @@ public class MavenITmng2318LocalParentResolutionTest
|
|||
throws Exception
|
||||
{
|
||||
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-2318" );
|
||||
|
||||
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
|
||||
verifier.executeGoal( "clean" );
|
||||
verifier.setAutoclean( false );
|
||||
verifier.executeGoal( "validate" );
|
||||
verifier.verifyErrorFreeLog();
|
||||
verifier.resetStreams();
|
||||
}
|
||||
|
|
|
@ -37,12 +37,12 @@ public class MavenITmng2339BadProjectInterpolationTest
|
|||
public void testitMNG2339a()
|
||||
throws Exception
|
||||
{
|
||||
File testDir = ResourceExtractor.simpleExtractResources( getClass(),
|
||||
"/mng-2339/a" );
|
||||
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-2339/a" );
|
||||
|
||||
Verifier verifier;
|
||||
|
||||
verifier = new Verifier( testDir.getAbsolutePath() );
|
||||
verifier.setAutoclean( false );
|
||||
|
||||
List cliOptions = new ArrayList();
|
||||
cliOptions.add( "-Dversion=foo" );
|
||||
|
@ -57,12 +57,13 @@ public class MavenITmng2339BadProjectInterpolationTest
|
|||
public void testitMNG2339b()
|
||||
throws Exception
|
||||
{
|
||||
File testDir = ResourceExtractor.simpleExtractResources( getClass(),
|
||||
"/mng-2339/b" );
|
||||
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-2339/b" );
|
||||
|
||||
Verifier verifier;
|
||||
|
||||
verifier = new Verifier( testDir.getAbsolutePath() );
|
||||
verifier.setAutoclean( false );
|
||||
verifier.deleteDirectory( "target" );
|
||||
|
||||
verifier.setLogFileName( "log-pom-specified.txt" );
|
||||
verifier.executeGoal( "initialize" );
|
||||
|
@ -74,6 +75,8 @@ public class MavenITmng2339BadProjectInterpolationTest
|
|||
verifier.resetStreams();
|
||||
|
||||
verifier = new Verifier( testDir.getAbsolutePath() );
|
||||
verifier.setAutoclean( false );
|
||||
verifier.deleteDirectory( "target" );
|
||||
|
||||
List cliOptions = new ArrayList();
|
||||
cliOptions.add( "-Dversion=2" );
|
||||
|
|
|
@ -33,15 +33,23 @@ public class MavenITmng2539PluginDependenciesComeFromPluginReposTest
|
|||
super( "(2.0.4,)" );
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify that dependencies specified in plugins are also retrieved from ordinary/non-plugin repositories.
|
||||
*/
|
||||
public void testitMNG2539()
|
||||
throws Exception
|
||||
{
|
||||
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-2539" );
|
||||
|
||||
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
|
||||
verifier.setAutoclean( false );
|
||||
verifier.deleteDirectory( "target" );
|
||||
verifier.deleteArtifacts( "org.apache.maven.its.mng2539" );
|
||||
verifier.executeGoal( "clean" );
|
||||
verifier.executeGoal( "validate" );
|
||||
verifier.verifyErrorFreeLog();
|
||||
verifier.resetStreams();
|
||||
|
||||
verifier.assertFilePresent( "target/log.txt" );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -23,6 +23,9 @@ import org.apache.maven.it.util.ResourceExtractor;
|
|||
import org.apache.maven.it.Verifier;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Date;
|
||||
import java.util.Properties;
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
public class MavenITmng2562TimestampTest
|
||||
extends AbstractMavenIntegrationTestCase
|
||||
|
@ -30,16 +33,26 @@ public class MavenITmng2562TimestampTest
|
|||
|
||||
public MavenITmng2562TimestampTest()
|
||||
{
|
||||
super( "[2.1.0-M1,)"); // 2.1.0+ only
|
||||
super( "[2.1.0-M1,)" ); // 2.1.0+ only
|
||||
}
|
||||
|
||||
public void testitMNG2562() throws Exception {
|
||||
File testDir = ResourceExtractor.simpleExtractResources(getClass(),
|
||||
"/mng-2562");
|
||||
Verifier verifier = new Verifier(testDir.getAbsolutePath());
|
||||
verifier.executeGoal("verify");
|
||||
public void testitMNG2562()
|
||||
throws Exception
|
||||
{
|
||||
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-2562" );
|
||||
|
||||
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
|
||||
verifier.setAutoclean( false );
|
||||
verifier.deleteDirectory( "target" );
|
||||
verifier.executeGoal( "validate" );
|
||||
verifier.verifyErrorFreeLog();
|
||||
verifier.resetStreams();
|
||||
|
||||
Properties props = verifier.loadProperties( "target/pom.properties" );
|
||||
String timestamp = props.getProperty( "project.properties.timestamp", "" );
|
||||
assertTrue( timestamp, timestamp.matches( "[0-9]{8}-[0-9]{4}" ) );
|
||||
Date date = new SimpleDateFormat( "yyyyMMdd-HHmm" ).parse( timestamp );
|
||||
assertTrue( new Date() + " vs " + date, Math.abs( System.currentTimeMillis() - date.getTime() ) < 24 * 60 * 60 * 1000 );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
public class Class
|
||||
{
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
System.out.println("hello");
|
||||
}
|
||||
|
||||
}
|
|
@ -1,12 +1,15 @@
|
|||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<name>Maven Integration Test :: it0107</name>
|
||||
<groupId>org.apache.maven.its.it0107</groupId>
|
||||
<artifactId>maven-it-it0107</artifactId>
|
||||
<description>Verify that default implementation of an implementation for a complex object works as
|
||||
expected [MNG-2293]</description>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<groupId>org.apache.maven.its.mng2293</groupId>
|
||||
<artifactId>test</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>Maven Integration Test :: MNG-2293</name>
|
||||
<description>
|
||||
Verify that default implementation of an implementation for a complex object works as expected.
|
||||
</description>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.apache.maven.its.it0106</groupId>
|
||||
<groupId>org.apache.maven.its.mng2318</groupId>
|
||||
<artifactId>A</artifactId>
|
||||
<version>1</version>
|
||||
<packaging>pom</packaging>
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>org.apache.maven.its.it0106</groupId>
|
||||
<groupId>org.apache.maven.its.mng2318</groupId>
|
||||
<artifactId>B</artifactId>
|
||||
<version>1</version>
|
||||
</parent>
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>org.apache.maven.its.it0106</groupId>
|
||||
<groupId>org.apache.maven.its.mng2318</groupId>
|
||||
<artifactId>A</artifactId>
|
||||
<version>1</version>
|
||||
<relativePath>A/pom.xml</relativePath>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>tests</groupId>
|
||||
<groupId>org.apache.maven.its.mng2339</groupId>
|
||||
<artifactId>interpolation-of-cliProps</artifactId>
|
||||
<version>1</version>
|
||||
|
||||
|
|
|
@ -1,16 +1,15 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>org.apache.maven.its.mng2539</groupId>
|
||||
<artifactId>mng-2539</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<description>
|
||||
Dependencies specified in plugins are only retrieved from pluginRepositories.
|
||||
</description>
|
||||
|
||||
<properties>
|
||||
<issue>MNG-2539</issue>
|
||||
</properties>
|
||||
<name>Maven Integration Test :: MNG-2539</name>
|
||||
<description>
|
||||
Verify that dependencies specified in plugins are also retrieved from ordinary/non-plugin repositories.
|
||||
</description>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
|
@ -20,7 +19,7 @@
|
|||
<checksumPolicy>ignore</checksumPolicy>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<checksumPolicy>ignore</checksumPolicy>
|
||||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
@ -38,7 +37,9 @@
|
|||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-clean-plugin</artifactId>
|
||||
<groupId>org.apache.maven.its.plugins</groupId>
|
||||
<artifactId>maven-it-plugin-log-file</artifactId>
|
||||
<version>2.1-SNAPSHOT</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.its.mng2539</groupId>
|
||||
|
@ -46,6 +47,18 @@
|
|||
<version>1.3.2</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<configuration>
|
||||
<logFile>target/log.txt</logFile>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>test</id>
|
||||
<phase>validate</phase>
|
||||
<goals>
|
||||
<goal>reset</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
|
|
@ -19,40 +19,43 @@ under the License.
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.apache.maven.its.mng2562</groupId>
|
||||
<artifactId>mng-2562-timestamp</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>1.0</version>
|
||||
<name>Apache Maven: mng-2562-timestamp</name>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<build>
|
||||
<sourceDirectory>${project.basedir}/src/main/java</sourceDirectory>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.its.plugins</groupId>
|
||||
<version>2.1-SNAPSHOT</version>
|
||||
<artifactId>maven-it-plugin-project-interpolation</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>validate</phase>
|
||||
<goals>
|
||||
<goal>verify-property</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<properties>
|
||||
<property>
|
||||
<name>timestamp</name>
|
||||
<value>${build.timestamp}</value>
|
||||
</property>
|
||||
</properties>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<properties>
|
||||
<timestamp>${build.timestamp}</timestamp>
|
||||
</properties>
|
||||
</project>
|
||||
<groupId>org.apache.maven.its.mng2562</groupId>
|
||||
<artifactId>timestamp</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>1.0</version>
|
||||
|
||||
<name>Maven Integration Test :: MNG-2562</name>
|
||||
<description>
|
||||
Verify that the property build.timestamp is available for POM interpolation.
|
||||
</description>
|
||||
|
||||
<properties>
|
||||
<timestamp>${build.timestamp}</timestamp>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.its.plugins</groupId>
|
||||
<version>2.1-SNAPSHOT</version>
|
||||
<artifactId>maven-it-plugin-expression</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>validate</phase>
|
||||
<goals>
|
||||
<goal>eval</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<outputFile>target/pom.properties</outputFile>
|
||||
<expressions>
|
||||
<expression>project/properties</expression>
|
||||
</expressions>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
Loading…
Reference in New Issue