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@736067 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
794f751293
commit
2cd1b9036d
|
@ -36,7 +36,7 @@ public class MavenITmng0761MissingSnapshotDistRepoTest
|
|||
|
||||
public MavenITmng0761MissingSnapshotDistRepoTest()
|
||||
{
|
||||
super( "(2.0.2,)" );
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -47,14 +47,16 @@ public class MavenITmng0761MissingSnapshotDistRepoTest
|
|||
throws Exception
|
||||
{
|
||||
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0761" );
|
||||
|
||||
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
|
||||
verifier.deleteArtifact( "org.apache.maven", "maven-it-it0062-SNAPSHOT", "1.0", "jar" );
|
||||
verifier.executeGoal( "deploy" );
|
||||
verifier.assertFilePresent( "target/classes/org/apache/maven/it0062/Person.class" );
|
||||
verifier.assertFilePresent( "target/maven-it-it0062-1.0-SNAPSHOT.jar" );
|
||||
verifier.setAutoclean( false );
|
||||
verifier.deleteDirectory( "target" );
|
||||
verifier.deleteArtifacts( "org.apache.maven.its.mng0761" );
|
||||
verifier.executeGoal( "validate" );
|
||||
verifier.verifyErrorFreeLog();
|
||||
verifier.resetStreams();
|
||||
|
||||
verifier.assertFilePresent( "target/repo/org/apache/maven/its/mng0761/test/1.0-SNAPSHOT/test-1.0-SNAPSHOT.jar" );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -47,6 +47,8 @@ public class MavenITmng0768OfflineModeTest
|
|||
{
|
||||
// phase 1: run build in online mode to fill local repo
|
||||
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
|
||||
verifier.setAutoclean( false );
|
||||
verifier.deleteDirectory( "target" );
|
||||
verifier.deleteArtifacts( "org.apache.maven.its.it0069" );
|
||||
verifier.setLogFileName( "log1.txt" );
|
||||
verifier.executeGoal( "org.apache.maven.its.plugins:maven-it-plugin-dependency-resolution:2.1-SNAPSHOT:compile" );
|
||||
|
@ -58,6 +60,8 @@ public class MavenITmng0768OfflineModeTest
|
|||
{
|
||||
// phase 2: run build in offline mode to check it still passes (after deleting test repo, to be sure)
|
||||
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
|
||||
verifier.setAutoclean( false );
|
||||
verifier.deleteDirectory( "target" );
|
||||
verifier.deleteDirectory( "repo" );
|
||||
List cliOptions = new ArrayList();
|
||||
cliOptions.add( "-o" );
|
||||
|
@ -72,6 +76,8 @@ public class MavenITmng0768OfflineModeTest
|
|||
{
|
||||
// phase 3: delete test artifact and run build in offline mode to check it fails now
|
||||
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
|
||||
verifier.setAutoclean( false );
|
||||
verifier.deleteDirectory( "target" );
|
||||
verifier.deleteArtifacts( "org.apache.maven.its.it0069" );
|
||||
List cliOptions = new ArrayList();
|
||||
cliOptions.add( "-o" );
|
||||
|
|
|
@ -37,22 +37,22 @@ public class MavenITmng0773SettingsProfileReactorPollutionTest
|
|||
{
|
||||
|
||||
/**
|
||||
* Verify that profiles from settings.xml do not pollute module lists
|
||||
* across projects in a reactorized build.
|
||||
* Verify that profiles from settings.xml do not pollute module lists across projects in a reactorized build.
|
||||
*/
|
||||
public void testitMNG773()
|
||||
throws Exception
|
||||
{
|
||||
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0773" );
|
||||
|
||||
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
|
||||
verifier.setAutoclean( false );
|
||||
List cliOptions = new ArrayList();
|
||||
cliOptions.add( "--settings settings.xml" );
|
||||
cliOptions.add( "--settings" );
|
||||
cliOptions.add( "settings.xml" );
|
||||
verifier.setCliOptions( cliOptions );
|
||||
verifier.executeGoal( "package" );
|
||||
verifier.assertFilePresent( "subproject/target/subproject-1.0.jar" );
|
||||
verifier.executeGoal( "validate" );
|
||||
verifier.verifyErrorFreeLog();
|
||||
verifier.resetStreams();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -42,12 +42,16 @@ public class MavenITmng0781PluginConfigVsExecConfigTest
|
|||
throws Exception
|
||||
{
|
||||
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0781" );
|
||||
|
||||
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
|
||||
verifier.setAutoclean( false );
|
||||
verifier.deleteDirectory( "target" );
|
||||
verifier.executeGoal( "process-resources" );
|
||||
verifier.assertFilePresent( "target/exec-level.txt" );
|
||||
verifier.assertFilePresent( "target/resources-resources.txt" );
|
||||
verifier.verifyErrorFreeLog();
|
||||
verifier.resetStreams();
|
||||
|
||||
verifier.assertFilePresent( "target/exec-level.txt" );
|
||||
verifier.assertFilePresent( "target/resources-resources.txt" );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -23,8 +23,7 @@ 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;
|
||||
import java.util.Properties;
|
||||
|
||||
/**
|
||||
* This is a test set for <a href="http://jira.codehaus.org/browse/MNG-814">MNG-814</a>.
|
||||
|
@ -43,16 +42,18 @@ public class MavenITmng0814ExplicitProfileActivationTest
|
|||
throws Exception
|
||||
{
|
||||
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0814" );
|
||||
|
||||
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
|
||||
verifier.deleteArtifact( "org.apache.maven", "maven-core-it-support", "1.0", "jar" );
|
||||
List cliOptions = new ArrayList();
|
||||
cliOptions.add( "-P test-profile" );
|
||||
verifier.setCliOptions( cliOptions );
|
||||
verifier.executeGoal( "compile" );
|
||||
verifier.assertFilePresent( "target/classes/org/apache/maven/it0067/Person.class" );
|
||||
verifier.setAutoclean( false );
|
||||
verifier.deleteDirectory( "target" );
|
||||
verifier.getCliOptions().add( "-P" );
|
||||
verifier.getCliOptions().add( "test-profile" );
|
||||
verifier.executeGoal( "validate" );
|
||||
verifier.verifyErrorFreeLog();
|
||||
verifier.resetStreams();
|
||||
|
||||
Properties props = verifier.loadProperties( "target/profile.properties" );
|
||||
assertEquals( "PASSED", props.getProperty( "project.properties.testProp" ) );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Binary file not shown.
|
@ -1,15 +1,66 @@
|
|||
<?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 :: it0062</name>
|
||||
<groupId>org.apache.maven.its.it0062</groupId>
|
||||
<artifactId>maven-it-it0062</artifactId>
|
||||
<description>Test that a deployment of a snapshot falls back to a non-snapshot repository if no snapshot repository is
|
||||
specified.</description>
|
||||
|
||||
<groupId>org.apache.maven.its.mng0761</groupId>
|
||||
<artifactId>test</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<name>Maven Integration Test :: MNG-761</name>
|
||||
<description>
|
||||
Test that a deployment of a snapshot falls back to a non-snapshot repository if no snapshot repository is
|
||||
specified.
|
||||
</description>
|
||||
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>repo</id>
|
||||
<url>file://localhost/${project.basedir}/target/test-repo</url>
|
||||
<url>file://localhost/${project.basedir}/target/repo</url>
|
||||
<uniqueVersion>false</uniqueVersion>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.its.plugins</groupId>
|
||||
<artifactId>maven-it-plugin-artifact</artifactId>
|
||||
<version>2.1-SNAPSHOT</version>
|
||||
<configuration>
|
||||
<mainFile>main.jar</mainFile>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>test</id>
|
||||
<phase>validate</phase>
|
||||
<goals>
|
||||
<goal>set</goal>
|
||||
<goal>install</goal>
|
||||
<goal>deploy</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
package org.apache.maven.it0062;
|
||||
|
||||
public class Person
|
||||
{
|
||||
private String name;
|
||||
|
||||
public void setName( String name )
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
}
|
|
@ -22,11 +22,11 @@ under the License.
|
|||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>org.apache.maven.its.it0069</groupId>
|
||||
<artifactId>maven-it-it0069</artifactId>
|
||||
<groupId>org.apache.maven.its.mng0768</groupId>
|
||||
<artifactId>test</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<name>Maven Integration Test :: it0069</name>
|
||||
<name>Maven Integration Test :: MNG-768</name>
|
||||
<description>Test offline mode.</description>
|
||||
|
||||
<dependencies>
|
||||
|
@ -45,7 +45,7 @@ under the License.
|
|||
<checksumPolicy>ignore</checksumPolicy>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<checksumPolicy>ignore</checksumPolicy>
|
||||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
|
|
@ -1,12 +1,36 @@
|
|||
<?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 :: it0058</name>
|
||||
<groupId>org.apache.maven.its.it0058</groupId>
|
||||
<artifactId>maven-it-it0058</artifactId>
|
||||
<description>Verify that profiles from settings.xml do not pollute module lists
|
||||
across projects in a reactorized build.</description>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<groupId>org.apache.maven.its.mng0773</groupId>
|
||||
<artifactId>parent</artifactId>
|
||||
<version>1.0</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>Maven Integration Test :: MNG-773</name>
|
||||
<description>
|
||||
Verify that profiles from settings.xml do not pollute module lists across projects in a reactorized build.
|
||||
</description>
|
||||
|
||||
<modules>
|
||||
<module>subproject</module>
|
||||
|
|
|
@ -1,18 +1,11 @@
|
|||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>org.apache.maven.its.it0058</groupId>
|
||||
<artifactId>maven-it-it0058</artifactId>
|
||||
<groupId>org.apache.maven.its.mng0773</groupId>
|
||||
<artifactId>parent</artifactId>
|
||||
<version>1.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>subproject</artifactId>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<type>jar</type>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
package org.apache.maven.it0058;
|
||||
|
||||
public class Person
|
||||
{
|
||||
private String name;
|
||||
|
||||
public void setName( String name )
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
name = jason
|
|
@ -1,16 +0,0 @@
|
|||
package org.apache.maven.it0058;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
public class PersonTest
|
||||
extends TestCase
|
||||
{
|
||||
public void testPerson()
|
||||
{
|
||||
Person person = new Person();
|
||||
|
||||
person.setName( "foo" );
|
||||
|
||||
assertEquals( "foo", person.getName() );
|
||||
}
|
||||
}
|
|
@ -1,22 +1,63 @@
|
|||
<?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 :: it0067</name>
|
||||
<groupId>org.apache.maven.its.it0067</groupId>
|
||||
<artifactId>maven-it-it0067</artifactId>
|
||||
<description>Test activation of a profile from the command line.</description>
|
||||
|
||||
<groupId>org.apache.maven.its.mng0814</groupId>
|
||||
<artifactId>test</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<name>Maven Integration Test :: MNG-814</name>
|
||||
<description>Test activation of a profile from the command line.</description>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>test-profile</id>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>3.8.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<properties>
|
||||
<testProp>PASSED</testProp>
|
||||
</properties>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.its.plugins</groupId>
|
||||
<artifactId>maven-it-plugin-expression</artifactId>
|
||||
<version>2.1-SNAPSHOT</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>validate</phase>
|
||||
<goals>
|
||||
<goal>eval</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputFile>target/profile.properties</outputFile>
|
||||
<expressions>
|
||||
<expression>project/properties</expression>
|
||||
</expressions>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
package org.apache.maven.it0067;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
public class Person
|
||||
{
|
||||
private String name;
|
||||
|
||||
public void setName( String name )
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue