o Merged it0097 into the IT for the corresponding issue MNG-2068

git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@733392 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2009-01-10 22:43:36 +00:00
parent 3015e642bf
commit 54977074bd
12 changed files with 35 additions and 142 deletions

View File

@ -291,7 +291,6 @@ public class IntegrationTestSuite
suite.addTestSuite( MavenIT0130CleanLifecycleTest.class ); suite.addTestSuite( MavenIT0130CleanLifecycleTest.class );
suite.addTestSuite( MavenIT0115CustomArtifactHandlerAndCustomLifecycleTest.class ); suite.addTestSuite( MavenIT0115CustomArtifactHandlerAndCustomLifecycleTest.class );
suite.addTestSuite( MavenIT0113ServerAuthzAvailableToWagonMgrInPluginTest.class ); suite.addTestSuite( MavenIT0113ServerAuthzAvailableToWagonMgrInPluginTest.class );
suite.addTestSuite( MavenIT0097Test.class );
suite.addTestSuite( MavenIT0090Test.class ); suite.addTestSuite( MavenIT0090Test.class );
suite.addTestSuite( MavenIT0087Test.class ); suite.addTestSuite( MavenIT0087Test.class );
suite.addTestSuite( MavenIT0086Test.class ); suite.addTestSuite( MavenIT0086Test.class );

View File

@ -1,55 +0,0 @@
package org.apache.maven.it;
/*
* 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.
*/
import org.apache.maven.it.Verifier;
import org.apache.maven.it.util.ResourceExtractor;
import java.io.File;
/**
* This is a test set for <a href="http://jira.codehaus.org/browse/MNG-2068">MNG-2068</a>.
*
* @author John Casey
* @version $Id$
*/
public class MavenIT0097Test
extends AbstractMavenIntegrationTestCase
{
// TODO: There is another IT for this issue, check whether these are dups or could be merged
/**
* Test that the implied relative path for the parent POM works, even two levels deep.
*/
public void testit0097()
throws Exception
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0097" );
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
verifier.setAutoclean( false );
verifier.deleteArtifacts( "org.apache.maven.its.mng2068" );
verifier.executeGoal( "validate" );
verifier.verifyErrorFreeLog();
verifier.resetStreams();
}
}

View File

@ -49,22 +49,7 @@ public class MavenITmng2068ReactorRelativeParentsTest
public void testitInheritedIdFields() public void testitInheritedIdFields()
throws Exception throws Exception
{ {
testitMNG2068( "test-1" ); File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-2068/test-1" );
}
/**
* Test successful lineage construction when parent specifies groupId+version itself.
*/
public void testitExplicitIdFields()
throws Exception
{
testitMNG2068( "test-2" );
}
private void testitMNG2068( String project )
throws Exception
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-2068/" + project );
File projectDir = new File( testDir, "parent" ); File projectDir = new File( testDir, "parent" );
Verifier verifier = new Verifier( projectDir.getAbsolutePath() ); Verifier verifier = new Verifier( projectDir.getAbsolutePath() );
@ -75,4 +60,38 @@ public class MavenITmng2068ReactorRelativeParentsTest
verifier.resetStreams(); verifier.resetStreams();
} }
/**
* Test successful lineage construction when parent specifies groupId+version itself.
*/
public void testitExplicitIdFields()
throws Exception
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-2068/test-2" );
File projectDir = new File( testDir, "parent" );
Verifier verifier = new Verifier( projectDir.getAbsolutePath() );
verifier.setAutoclean( false );
verifier.deleteArtifacts( "org.apache.maven.its.mng2068" );
verifier.executeGoal( "validate" );
verifier.verifyErrorFreeLog();
verifier.resetStreams();
}
/**
* Test that the implied relative path for the parent POM works, even two levels deep.
*/
public void testitComplex()
throws Exception
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-2068/test-3" );
File projectDir = testDir;
Verifier verifier = new Verifier( projectDir.getAbsolutePath() );
verifier.setAutoclean( false );
verifier.deleteArtifacts( "org.apache.maven.its.mng2068" );
verifier.executeGoal( "validate" );
verifier.verifyErrorFreeLog();
verifier.resetStreams();
}
} }

View File

@ -1,14 +0,0 @@
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.its.it0097</groupId>
<version>1</version>
<artifactId>maven-it0097-plugin</artifactId>
<packaging>maven-plugin</packaging>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>2.0</version>
</dependency>
</dependencies>
</project>

View File

@ -1,56 +0,0 @@
package org.apache.maven.it0096;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
/**
* @goal it0097
*/
public class It0096Mojo extends AbstractMojo
{
/**
* @parameter default-value="${project.build.directory}"
* @required
* @readonly
*/
private File targetDirectory;
public void execute() throws MojoExecutionException
{
targetDirectory.mkdirs();
File myFile = new File( targetDirectory, "it0097.txt" );
if ( myFile.exists() )
{
throw new MojoExecutionException( "This mojo has already been run, or the project wasn't cleaned." );
}
else
{
FileWriter writer = null;
try
{
writer = new FileWriter( myFile );
writer.write( "test" );
writer.close();
}
catch ( IOException e )
{
throw new MojoExecutionException( "Failed to write test file: " + myFile );
}
finally
{
if ( writer != null )
{
try{ writer.close(); }
catch( IOException e ) {}
}
}
}
}
}