o Decoupled ITs from production plugins

git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@736024 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2009-01-20 14:06:05 +00:00
parent b68956f74a
commit 49d23968f2
8 changed files with 89 additions and 40 deletions

View File

@ -41,14 +41,16 @@ public class MavenITmng0282NonReactorExecWhenProjectIndependentTest
throws Exception
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0282" );
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
verifier.deleteArtifact( "org.apache.maven.its.plugins", "maven-it-plugin-no-project", "1.0", "maven-plugin" );
verifier.setAutoclean( false );
verifier.deleteDirectory( "target" );
verifier.deleteDirectory( "subproject/target" );
verifier.executeGoal( "org.apache.maven.its.plugins:maven-it-plugin-no-project:light-touch" );
verifier.assertFilePresent( "target/touch.txt" );
verifier.assertFileNotPresent( "subproject/target/touch.txt" );
verifier.verifyErrorFreeLog();
verifier.resetStreams();
}
}
}

View File

@ -34,6 +34,7 @@ import java.util.Properties;
public class MavenITmng0294MergeGlobalAndUserSettingsTest
extends AbstractMavenIntegrationTestCase
{
public MavenITmng0294MergeGlobalAndUserSettingsTest()
{
}
@ -45,7 +46,10 @@ public class MavenITmng0294MergeGlobalAndUserSettingsTest
throws Exception
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0294" );
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
verifier.setAutoclean( false );
verifier.deleteDirectory( "target" );
Properties systemProperties = new Properties();
systemProperties.put( "org.apache.maven.user-settings", "user-settings.xml" );
systemProperties.put( "org.apache.maven.global-settings", "global-settings.xml" );
@ -58,9 +62,10 @@ public class MavenITmng0294MergeGlobalAndUserSettingsTest
verifier.getCliOptions().add( new File( testDir, "global-settings.xml" ).getAbsolutePath() );
}
verifier.executeGoal( "org.apache.maven.its.plugins:maven-it-plugin-touch:touch" );
verifier.assertFilePresent( "target/test.txt" );
verifier.verifyErrorFreeLog();
verifier.resetStreams();
verifier.assertFilePresent( "target/test.txt" );
}
}

View File

@ -43,15 +43,18 @@ public class MavenITmng0471CustomLifecycleTest
throws Exception
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0471" );
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
verifier.setAutoclean( false );
verifier.deleteDirectory( "target" );
List goals = Arrays.asList( new String[]{"org.apache.maven.its.plugins:maven-it-plugin-fork:fork",
"org.apache.maven.its.plugins:maven-it-plugin-fork:fork-goal"} );
verifier.executeGoals( goals );
verifier.assertFilePresent( "target/forked/touch.txt" );
verifier.assertFilePresent( "target/forked2/touch.txt" );
verifier.verifyErrorFreeLog();
verifier.resetStreams();
verifier.assertFilePresent( "target/forked/touch.txt" );
verifier.assertFilePresent( "target/forked2/touch.txt" );
}
}
}

View File

@ -47,6 +47,8 @@ public class MavenITmng0479OverrideCentralRepoTest
// Phase 1: Ensure the test plugin is downloaded before the test cuts off access to central
File child1 = new File( testDir, "setup" );
Verifier verifier = new Verifier( child1.getAbsolutePath() );
verifier.setAutoclean( false );
verifier.deleteDirectory( "target" );
verifier.executeGoal( "org.apache.maven.its.plugins:maven-it-plugin-expression:2.1-SNAPSHOT:eval" );
verifier.verifyErrorFreeLog();
@ -55,6 +57,8 @@ public class MavenITmng0479OverrideCentralRepoTest
// Phase 2: Now run the test
File child2 = new File( testDir, "test" );
verifier = new Verifier( child2.getAbsolutePath() );
verifier.setAutoclean( false );
verifier.deleteDirectory( "target" );
verifier.setCliOptions( Collections.singletonList( "-s settings.xml" ) );
verifier.executeGoal( "org.apache.maven.its.plugins:maven-it-plugin-expression:2.1-SNAPSHOT:eval" );

View File

@ -44,6 +44,8 @@ public class MavenITmng0496IgnoreUnknownPluginParametersTest
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0496" );
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
verifier.setAutoclean( false );
verifier.deleteDirectory( "target" );
verifier.executeGoal( "org.apache.maven.its.plugins:maven-it-plugin-file:2.1-SNAPSHOT:file" );
verifier.assertFilePresent( "target/file.txt" );
verifier.verifyErrorFreeLog();

View File

@ -23,6 +23,7 @@ import org.apache.maven.it.Verifier;
import org.apache.maven.it.util.ResourceExtractor;
import java.io.File;
import java.util.List;
/**
* This is a test set for <a href="http://jira.codehaus.org/browse/MNG-507">MNG-507</a>.
@ -41,17 +42,25 @@ public class MavenITmng0507ArtifactRelocationTest
throws Exception
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0507" );
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
verifier.setAutoclean( false );
verifier.deleteDirectory( "target" );
verifier.deleteArtifact( "org.apache.maven", "maven-core-it-support", "1.1", "jar" );
verifier.deleteArtifact( "org.apache.maven", "maven-core-it-support", "1.1", "pom" );
verifier.deleteArtifact( "org.apache.maven", "maven-core-it-support-old-location", "1.1", "jar" );
verifier.deleteArtifact( "org.apache.maven", "maven-core-it-support-old-location", "1.1", "pom" );
verifier.executeGoal( "package" );
verifier.assertArtifactPresent( "org.apache.maven", "maven-core-it-support", "1.1", "jar" );
verifier.assertArtifactPresent( "org.apache.maven", "maven-core-it-support", "1.1", "pom" );
verifier.assertArtifactPresent( "org.apache.maven", "maven-core-it-support-old-location", "1.1", "pom" );
verifier.executeGoal( "validate" );
verifier.verifyErrorFreeLog();
verifier.resetStreams();
}
}
verifier.assertArtifactPresent( "org.apache.maven", "maven-core-it-support", "1.1", "jar" );
verifier.assertArtifactPresent( "org.apache.maven", "maven-core-it-support", "1.1", "pom" );
verifier.assertArtifactPresent( "org.apache.maven", "maven-core-it-support-old-location", "1.1", "pom" );
verifier.assertArtifactNotPresent( "org.apache.maven", "maven-core-it-support-old-location", "1.1", "jar" );
List artifacts = verifier.loadLines( "target/artifacts.txt", "UTF-8" );
assertTrue( artifacts.toString(), artifacts.contains( "org.apache.maven:maven-core-it-support:jar:1.1" ) );
}
}

View File

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

View File

@ -1,22 +1,62 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<project>
<modelVersion>4.0.0</modelVersion>
<name>Maven Integration Test :: it0035</name>
<groupId>org.apache.maven.its.it0035</groupId>
<artifactId>maven-it-it0035</artifactId>
<description>Test artifact relocation.</description>
<groupId>org.apache.maven.its.mng0507</groupId>
<artifactId>test</artifactId>
<version>1.0</version>
<name>Maven Integration Test :: MNG-507</name>
<description>Test artifact relocation.</description>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<type>jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core-it-support-old-location</artifactId>
<version>1.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.its.plugins</groupId>
<artifactId>maven-it-plugin-dependency-resolution</artifactId>
<version>2.1-SNAPSHOT</version>
<executions>
<execution>
<id>test</id>
<phase>validate</phase>
<configuration>
<compileArtifacts>target/artifacts.txt</compileArtifacts>
<significantPathLevels>1</significantPathLevels>
</configuration>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>