[MNG-3680] Adding self-contained integration test that expresses the problem using an invalid repositories list (another list-based association that is handled by the same logic as the dependencies list).

git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@679858 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
John Dennis Casey 2008-07-25 16:55:49 +00:00
parent 22fa420271
commit 8fe8821672
18 changed files with 261 additions and 0 deletions

View File

@ -65,6 +65,7 @@ public class IntegrationTestSuite
* a fail fast technique as well. * a fail fast technique as well.
*/ */
suite.addTestSuite( MavenITmng3680InvalidDependencyPOMTest.class );
suite.addTestSuite( MavenITmng3679PluginExecIdInterpolationTest.class ); suite.addTestSuite( MavenITmng3679PluginExecIdInterpolationTest.class );
suite.addTestSuite( MavenITmng3671PluginLevelDepInterpolationTest.class ); suite.addTestSuite( MavenITmng3671PluginLevelDepInterpolationTest.class );
suite.addTestSuite( MavenITmng3667ResolveDepsWithBadPomVersionTest.class ); suite.addTestSuite( MavenITmng3667ResolveDepsWithBadPomVersionTest.class );

View File

@ -0,0 +1,35 @@
package org.apache.maven.integrationtests;
import java.io.File;
import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
import org.apache.maven.it.Verifier;
import org.apache.maven.it.util.ResourceExtractor;
/**
* Verify that dependencies with invalid POMs can still be used without failing
* the build.
*
* @author jdcasey
*/
public class MavenITmng3680InvalidDependencyPOMTest
extends AbstractMavenIntegrationTestCase
{
public MavenITmng3680InvalidDependencyPOMTest()
throws InvalidVersionSpecificationException
{
super( "(2.0.9,)" );
}
public void testitMNG3680 ()
throws Exception
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3680-invalidDependencyPOM" );
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
verifier.executeGoal( "compile" );
verifier.verifyErrorFreeLog();
verifier.resetStreams();
}
}

View File

@ -0,0 +1,16 @@
<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>
<artifactId>dep-L2</artifactId>
<packaging>jar</packaging>
<version>1</version>
<name>dep-L2</name>
<distributionManagement>
<repository>
<id>dep-repo</id>
<url>file://${pom.basedir}/..</url>
</repository>
</distributionManagement>
</project>

View File

@ -0,0 +1,13 @@
package tests.level2;
/**
* Hello world!
*
*/
public class AppLevel2
{
public static void main( String[] args )
{
System.out.println( "Hello World!" );
}
}

View File

@ -0,0 +1,28 @@
<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>
<artifactId>dep-L1</artifactId>
<packaging>jar</packaging>
<version>1</version>
<dependencies>
<dependency>
<groupId>tests</groupId>
<artifactId>dep-L2</artifactId>
<version>1</version>
</dependency>
</dependencies>
<!-- This is an invalid repositories section, which would trip up the model parser
if it were used in strict mode, or if the handling of the strict-mode flag
doesn't apply to association lists.
Dependency POMs should always be parsed in non-strict mode, so this
shouldn't prevent the inclusion of the above dependency.
-->
<repositories>
<id>imaginary-repo</id>
<url>http://repository.imaginary/</url>
</repositories>
</project>

View File

@ -0,0 +1,28 @@
<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>
<artifactId>dep-L1</artifactId>
<packaging>jar</packaging>
<version>1</version>
<dependencies>
<dependency>
<groupId>tests</groupId>
<artifactId>dep-L2</artifactId>
<version>1</version>
</dependency>
</dependencies>
<!-- This is an invalid repositories section, which would trip up the model parser
if it were used in strict mode, or if the handling of the strict-mode flag
doesn't apply to association lists.
Dependency POMs should always be parsed in non-strict mode, so this
shouldn't prevent the inclusion of the above dependency.
-->
<repositories>
<id>imaginary-repo</id>
<url>http://repository.imaginary/</url>
</repositories>
</project>

View File

@ -0,0 +1 @@
f4f142d0469c316b1ee67c05445415ec8ff38e4e

View File

@ -0,0 +1,16 @@
<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>
<artifactId>dep-L2</artifactId>
<packaging>jar</packaging>
<version>1</version>
<name>dep-L2</name>
<distributionManagement>
<repository>
<id>dep-repo</id>
<url>file://${pom.basedir}/..</url>
</repository>
</distributionManagement>
</project>

View File

@ -0,0 +1 @@
cce03f3942f7aadaee9ed0e8f4cf384fa4fed319

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<groupId>tests</groupId>
<artifactId>dep-L2</artifactId>
<version>1</version>
<versioning>
<versions>
<version>1</version>
</versions>
<lastUpdated>20080725163900</lastUpdated>
</versioning>
</metadata>

View File

@ -0,0 +1 @@
3f10e68aeceeb95476ec0b0ba3ed2be3ab245be9

View File

@ -0,0 +1,53 @@
<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.mng3680</groupId>
<artifactId>mng-3680-invalidDependencyPOM</artifactId>
<packaging>jar</packaging>
<version>1</version>
<name>mng-3680-invalidDependencyPOM</name>
<repositories>
<repository>
<id>dep-repo</id>
<url>file://${pom.basedir}/dep-repo</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>tests</groupId>
<artifactId>dep-L1</artifactId>
<version>1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-2</version>
<executions>
<execution>
<id>assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,15 @@
package tests;
import tests.level2.AppLevel2;
/**
* Hello world!
*
*/
public class App
{
public static void main( String[] args )
{
System.out.println( "Hello World!" );
}
}

View File

@ -0,0 +1,38 @@
package tests;
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 );
}
}