MNG2045: core it test

git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@585311 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brian E Fox 2007-10-17 01:02:37 +00:00
parent 0ff80af1ff
commit 63a1cedd0a
7 changed files with 140 additions and 0 deletions

View File

@ -160,6 +160,7 @@ public class IntegrationTestSuite
suite.addTestSuite( MavenIT0114ExtensionThatProvidesResources.class ); suite.addTestSuite( MavenIT0114ExtensionThatProvidesResources.class );
suite.addTestSuite( MavenIT0118AttachedArtifactsInReactor.class ); suite.addTestSuite( MavenIT0118AttachedArtifactsInReactor.class );
suite.addTestSuite( MavenITmng2254PomEncodingTest.class); suite.addTestSuite( MavenITmng2254PomEncodingTest.class);
suite.addTestSuite( MavenITmng2045testJarDependenciesBrokenInReactorTest.class);
// ---------------------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------------------
// Tests that need to be fixed. // Tests that need to be fixed.

View File

@ -0,0 +1,37 @@
package org.apache.maven.integrationtests;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import org.apache.maven.integrationtests.AbstractMavenIntegrationTestCase;
import org.apache.maven.it.Verifier;
import org.apache.maven.it.util.ResourceExtractor;
/**
* Simple IT test invoking maven in a reactor with 2 projects.
* First project produced a test-jar, which is required to
* compile second project.
*
* @author <a href="mailto:brianf@apache.org">Brian Fox</a>
* @author mikko.koponen@ri.fi
*/
public class MavenITmng2045testJarDependenciesBrokenInReactorTest extends AbstractMavenIntegrationTestCase {
public void testitMNG2045()
throws Exception
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-2045-testJarDependenciesBrokenInReactor" );
Verifier verifier;
verifier = new Verifier( testDir.getAbsolutePath() );
verifier.deleteArtifact( "testing", "mng-2045-test", "1.0-SNAPSHOT", "pom" );
verifier.deleteArtifact( "testing", "first-project", "1.0-SNAPSHOT", "jar" );
verifier.deleteArtifact( "testing", "second-project", "1.0-SNAPSHOT", "jar" );
verifier.executeGoal( "install" );
verifier.verifyErrorFreeLog();
verifier.resetStreams();
}
}

View File

@ -0,0 +1,29 @@
<?xml version="1.0"?>
<project>
<parent>
<groupId>testing</groupId>
<artifactId>mng-2045-test</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>first-project</artifactId>
<name>first-project</name>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<goals><goal>test-jar</goal></goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,8 @@
package com.mycompany.app;
public class SomeGeneralTestClass {
public void foo() {
System.out.println("FOO!");
}
}

View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>testing</groupId>
<artifactId>mng-2045-test</artifactId>
<name>mng-2045-test</name>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<modules>
<module>first-project</module>
<module>second-project</module>
</modules>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>
</project>

View File

@ -0,0 +1,27 @@
<?xml version="1.0"?>
<project>
<parent>
<groupId>testing</groupId>
<artifactId>mng-2045-test</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>second-project</artifactId>
<name>second-project</name>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>first-project</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<!-- This also fails:
<classifier>tests</classifier>
-->
<scope>compile</scope>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,15 @@
package com.somecompany;
import com.mycompany.app.SomeGeneralTestClass;
/**
* Hello world!
*
*/
public class OtherAppRequiringGeneralTestClass {
public static void main(String[] args) throws Exception {
SomeGeneralTestClass.class.newInstance();
}
}