o Decoupled IT from production plugins

git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@894184 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2009-12-28 15:17:30 +00:00
parent 576b63037f
commit ff475c2eb1
17 changed files with 170 additions and 197 deletions

View File

@ -36,34 +36,29 @@ public class MavenITmng4275RelocationWarningTest
public MavenITmng4275RelocationWarningTest()
{
super( "[2.0,2.0.9),[2.2.1,)" );
super( "[2.0,2.0.9),[2.2.1,3.0-alpha-1),[3.0-alpha-3,)" );
}
/**
* Verify that relocations are logged (at warning level).
*/
public void testit()
throws Exception
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4275" );
File depsDir = new File( testDir, "dependencies" );
File projectDir = new File( testDir, "project" );
Verifier verifier = new Verifier( depsDir.getAbsolutePath() );
verifier.deleteArtifacts( "org.apache.maven.it.mng4275" );
verifier.executeGoal( "install" );
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
verifier.setAutoclean( false );
verifier.deleteDirectory( "target" );
verifier.deleteArtifacts( "org.apache.maven.its.mng4275" );
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", verifier.newDefaultFilterProperties() );
verifier.getCliOptions().add( "--settings" );
verifier.getCliOptions().add( "settings.xml" );
verifier.executeGoal( "validate" );
verifier.verifyErrorFreeLog();
verifier.resetStreams();
// now, build the project that depends on the above.
verifier = new Verifier( projectDir.getAbsolutePath() );
verifier.executeGoal( "install" );
verifier.verifyErrorFreeLog();
verifier.resetStreams();
List lines = verifier.loadFile( new File( projectDir, verifier.getLogFileName() ), false );
List lines = verifier.loadFile( new File( testDir, verifier.getLogFileName() ), false );
boolean foundWarning = false;
for ( Iterator it = lines.iterator(); it.hasNext(); )
{
@ -73,10 +68,10 @@ public class MavenITmng4275RelocationWarningTest
{
assertTrue(
"Relocation target should have been logged right after warning.",
line.indexOf( "This artifact has been relocated to org.apache.maven.it.mng4275:relocated:1" ) > -1 );
line.indexOf( "This artifact has been relocated to org.apache.maven.its.mng4275:relocated:1" ) > -1 );
break;
}
else if ( line.startsWith( "[WARNING] While downloading org.apache.maven.it.mng4275:relocation:1" ) )
else if ( line.startsWith( "[WARNING] While downloading org.apache.maven.its.mng4275:relocation:1" ) )
{
foundWarning = true;
}

View File

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<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.it.mng4275</groupId>
<artifactId>dependencies</artifactId>
<version>1</version>
<packaging>pom</packaging>
<modules>
<module>relocation</module>
<module>relocated</module>
</modules>
</project>

View File

@ -1,19 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<artifactId>relocated</artifactId>
<groupId>org.apache.maven.it.mng4275</groupId>
<version>1</version>
<name>relocated</name>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>

View File

@ -1,13 +0,0 @@
package org.apache.maven.it.mng4275.relocated;
/**
* Hello world!
*
*/
public class App
{
public static void main( String[] args )
{
System.out.println( "Hello World: Relocated." );
}
}

View File

@ -1,38 +0,0 @@
package org.apache.maven.it.mng4275.relocated;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
/**
* Unit test for simple App.
*/
public class AppTest
extends TestCase
{
/**
* Create the test case
*
* @param testName name of the test case
*/
public AppTest( String testName )
{
super( testName );
}
/**
* @return the suite of tests being tested
*/
public static Test suite()
{
return new TestSuite( AppTest.class );
}
/**
* Rigourous Test :-)
*/
public void testApp()
{
assertTrue( true );
}
}

View File

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<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.it.mng4275</groupId>
<version>1</version>
<artifactId>relocation</artifactId>
<properties>
<maven.test.skip>true</maven.test.skip>
</properties>
<distributionManagement>
<relocation>
<groupId>org.apache.maven.it.mng4275</groupId>
<artifactId>relocated</artifactId>
<version>1</version>
<message>Relocation Test!</message>
</relocation>
</distributionManagement>
</project>

View File

@ -0,0 +1,61 @@
<?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>
<groupId>org.apache.maven.its.mng4275</groupId>
<artifactId>project</artifactId>
<packaging>jar</packaging>
<version>1</version>
<name>Maven Integration Test :: MNG-4275</name>
<description>
Verify that relocations are logged (at warning level).
</description>
<dependencies>
<dependency>
<groupId>org.apache.maven.its.mng4275</groupId>
<artifactId>relocation</artifactId>
<version>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>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -1,22 +0,0 @@
<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.it.mng4275</groupId>
<artifactId>project</artifactId>
<packaging>jar</packaging>
<version>1</version>
<name>project</name>
<dependencies>
<dependency>
<groupId>org.apache.maven.it.mng4275</groupId>
<artifactId>relocation</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>

View File

@ -1,15 +0,0 @@
package org.apache.maven.it.mng4275.project;
/**
* Hello world!
*
*/
public class App
{
public static void main( String[] args )
{
System.out.println( "Hello World!" );
org.apache.maven.it.mng4275.relocated.App.main( args );
}
}

View File

@ -1,38 +0,0 @@
package org.apache.maven.it.mng4275.project;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
/**
* Unit test for simple App.
*/
public class AppTest
extends TestCase
{
/**
* Create the test case
*
* @param testName name of the test case
*/
public AppTest( String testName )
{
super( testName );
}
/**
* @return the suite of tests being tested
*/
public static Test suite()
{
return new TestSuite( AppTest.class );
}
/**
* Rigourous Test :-)
*/
public void testApp()
{
App.main( new String[]{} );
}
}

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.its.mng4275</groupId>
<artifactId>relocated</artifactId>
<version>1</version>
<name>relocated</name>
</project>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<groupId>org.apache.maven.its.mng4275</groupId>
<artifactId>relocated</artifactId>
<version>1</version>
<versioning>
<versions>
<version>1</version>
</versions>
<lastUpdated>20091228142805</lastUpdated>
</versioning>
</metadata>

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.its.mng4275</groupId>
<artifactId>relocation</artifactId>
<version>1</version>
<distributionManagement>
<relocation>
<groupId>org.apache.maven.its.mng4275</groupId>
<artifactId>relocated</artifactId>
<version>1</version>
<message>Relocation Test!</message>
</relocation>
</distributionManagement>
</project>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<groupId>org.apache.maven.its.mng4275</groupId>
<artifactId>relocation</artifactId>
<version>1</version>
<versioning>
<versions>
<version>1</version>
</versions>
<lastUpdated>20091228142804</lastUpdated>
</versioning>
</metadata>

View File

@ -0,0 +1,43 @@
<?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.
-->
<settings>
<profiles>
<profile>
<id>maven-core-it-repo</id>
<repositories>
<repository>
<id>maven-core-it</id>
<url>@baseurl@/repo</url>
<releases>
<checksumPolicy>ignore</checksumPolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>maven-core-it-repo</activeProfile>
</activeProfiles>
</settings>