org.apache.maven.it
Class MavenITmng2972OverridePluginDependencyTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.maven.it.AbstractMavenIntegrationTestCase
              extended by org.apache.maven.it.MavenITmng2972OverridePluginDependencyTest
All Implemented Interfaces:
Test

public class MavenITmng2972OverridePluginDependencyTest
extends AbstractMavenIntegrationTestCase

This is a test set for MNG-2972.

Version:
$Id: MavenITmng2972OverridePluginDependencyTest.java 981712 2010-08-03 00:36:19Z bentmann $
Author:
Benjamin Bentmann

Field Summary
 
Fields inherited from class org.apache.maven.it.AbstractMavenIntegrationTestCase
ALL_MAVEN_VERSIONS
 
Constructor Summary
MavenITmng2972OverridePluginDependencyTest()
           
 
Method Summary
 void testitCommandLineInvocation()
          Verify that a project-level plugin dependency replaces the original dependency from the plugin POM.
 void testitLifecycleInvocation()
          Verify that a project-level plugin dependency replaces the original dependency from the plugin POM.
 
Methods inherited from class org.apache.maven.it.AbstractMavenIntegrationTestCase
matchesVersionRange, newVerifier, newVerifier, newVerifier, newVerifier, requiresJavaVersion, requiresMavenVersion, runTest, setupLocalRepo
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, setName, setUp, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MavenITmng2972OverridePluginDependencyTest

public MavenITmng2972OverridePluginDependencyTest()
Method Detail

testitLifecycleInvocation

public void testitLifecycleInvocation()
                               throws Exception
Verify that a project-level plugin dependency replaces the original dependency from the plugin POM.

Throws:
Exception

testitCommandLineInvocation

public void testitCommandLineInvocation()
                                 throws Exception
Verify that a project-level plugin dependency replaces the original dependency from the plugin POM. Apart from testing direct CLI invocation this time, this test also employs a slightly different version for the overriding dependency. The original bug is caused by usage of a HashSet but whenever the random order of its elements happens to match the correct ordering, the test cannot detect the bad implementation. The obvious way to increase the test coverage is re-running the test with different dependency versions, each time producing another hash code for the dependency artifact and thereby changing its position in the HashSet's element order. The two versions 0.2-mng-2972 and 9.9-MNG-2972 we use here have at least once proven (on Sun JDK 1.6.0_07) to successfully break the correctness of the random ordering.

Throws:
Exception


Copyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.