org.apache.maven.shared.dependency.tree
Class DefaultDependencyTreeBuilderTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.codehaus.plexus.PlexusTestCase
              extended by org.apache.maven.shared.dependency.tree.DefaultDependencyTreeBuilderTest
All Implemented Interfaces:
junit.framework.Test

public class DefaultDependencyTreeBuilderTest
extends org.codehaus.plexus.PlexusTestCase

Tests DefaultDependencyTreeBuilder.

Version:
$Id: DefaultDependencyTreeBuilderTest.java 1100703 2011-05-08 08:27:33Z hboutemy $
Author:
Mark Hobson
See Also:
DefaultDependencyTreeBuilder

Constructor Summary
DefaultDependencyTreeBuilderTest()
           
 
Method Summary
protected  void setUp()
          
protected  void tearDown()
          
 void testProjectWithConflictDependencyScopeCurrentPom()
          Tests building a tree for a project with a dependency that has conflicting scopes, where the nearest is not broadened since it is defined in the top-level POM: g:p:t:1 +- g:b:t:1:test (scope not updated to compile) \- g:a:t:1 \- (g:b:t:1:compile - omitted for duplicate)
 void testProjectWithConflictDependencyScopeFirstWins()
          Tests building a tree for a project with a dependency that has conflicting scopes, where the winner is encountered first: g:p:t:1 \- g:a:t:1 +- g:b:t:1 | \- g:c:t:1:compile \- (g:c:t:1:compile - scope updated from test; omitted for duplicate)
 void testProjectWithConflictDependencyScopeLastWins()
          Tests building a tree for a project with a dependency that has conflicting scopes, where the winner is encountered last: g:p:t:1 \- g:a:t:1 +- (g:c:t:1:compile - scope updated from test; omitted for duplicate) \- g:b:t:1 \- g:c:t:1:compile
 void testProjectWithConflictDependencyVersionFirstWins()
          Tests building a tree for a project with a dependency that has conflicting versions, where the nearest is encountered first: g:p:t:1 +- g:a:t:1 \- g:b:t:1 \- (g:a:t:2 - omitted for conflict with 1)
 void testProjectWithConflictDependencyVersionLastWins()
          Tests building a tree for a project with a dependency that has conflicting versions, where the nearest is encountered last: g:p:t:1 +- g:a:t:1 | \- (g:b:t:2 - omitted for conflict with 1) \- g:b:t:1
 void testProjectWithDependency()
          Tests building a tree for a project with one dependency: g:p:t:1 \- g:a:t:1
 void testProjectWithDuplicateDependency()
          Tests building a tree for a project with a duplicate transitive dependency: g:p:t:1 +- g:a:t:1 | \- g:c:t:1 \- g:b:t:1 \- (g:c:t:1 - omitted for duplicate)
 void testProjectWithManagedTransitiveDependencyScope()
          Tests building a tree for a project with one transitive dependency whose scope is fixed in dependency management: g:p:t:1 \- g:a:t:1 \- g:b:t:1:test (scope managed from compile)
 void testProjectWithManagedTransitiveDependencyVersion()
          Tests building a tree for a project with one transitive dependency whose version is fixed in dependency management: g:p:t:1 \- g:a:t:1 \- g:b:t:2 (version managed from 1)
 void testProjectWithManagedTransitiveDependencyVersionAndConflictDependencyVersion()
          Tests building a tree for a project with a dependency that has conflicting versions and the version is also fixed in dependency management: g:p:t:1 +- g:a:t:1 \- g:b:t:1 \- (g:a:t:3 - version managed from 2; omitted for conflict with 1)
 void testProjectWithManagedTransitiveDependencyVersionAndScope()
          Tests building a tree for a project with one transitive dependency whose version and scope are fixed in dependency management: g:p:t:1 \- g:a:t:1 \- g:b:t:2:test (version managed from 1; scope managed from compile)
 void testProjectWithTransitiveDependency()
          Tests building a tree for a project with one transitive dependency: g:p:t:1 \- g:a:t:1 \- g:b:t:1
 void testProjectWithVersionRange()
          Tests building a tree for a project with a dependency with version range g:p:t:1 \- g:a:t:1
 
Methods inherited from class org.codehaus.plexus.PlexusTestCase
customizeComponentConfiguration, customizeContainerConfiguration, customizeContext, getBasedir, getClassLoader, getConfiguration, getConfiguration, getConfigurationName, getContainer, getCustomConfigurationName, getResourceAsStream, getTestConfiguration, getTestConfiguration, getTestFile, getTestFile, getTestPath, getTestPath, lookup, lookup, lookup, lookup, release, setupContainer
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultDependencyTreeBuilderTest

public DefaultDependencyTreeBuilderTest()
Method Detail

setUp

protected void setUp()
              throws Exception

Overrides:
setUp in class org.codehaus.plexus.PlexusTestCase
Throws:
Exception

tearDown

protected void tearDown()
                 throws Exception

Overrides:
tearDown in class org.codehaus.plexus.PlexusTestCase
Throws:
Exception

testProjectWithDependency

public void testProjectWithDependency()
                               throws DependencyTreeBuilderException
Tests building a tree for a project with one dependency:
 g:p:t:1
 \- g:a:t:1
 

Throws:
DependencyTreeBuilderException

testProjectWithTransitiveDependency

public void testProjectWithTransitiveDependency()
                                         throws DependencyTreeBuilderException
Tests building a tree for a project with one transitive dependency:
 g:p:t:1
 \- g:a:t:1
    \- g:b:t:1
 

Throws:
DependencyTreeBuilderException

testProjectWithDuplicateDependency

public void testProjectWithDuplicateDependency()
                                        throws DependencyTreeBuilderException
Tests building a tree for a project with a duplicate transitive dependency:
 g:p:t:1
 +- g:a:t:1
 |  \- g:c:t:1
 \- g:b:t:1
    \- (g:c:t:1 - omitted for duplicate)
 

Throws:
DependencyTreeBuilderException

testProjectWithConflictDependencyVersionFirstWins

public void testProjectWithConflictDependencyVersionFirstWins()
                                                       throws DependencyTreeBuilderException
Tests building a tree for a project with a dependency that has conflicting versions, where the nearest is encountered first:
 g:p:t:1
 +- g:a:t:1
 \- g:b:t:1
    \- (g:a:t:2 - omitted for conflict with 1)
 

Throws:
DependencyTreeBuilderException

testProjectWithConflictDependencyVersionLastWins

public void testProjectWithConflictDependencyVersionLastWins()
                                                      throws DependencyTreeBuilderException
Tests building a tree for a project with a dependency that has conflicting versions, where the nearest is encountered last:
 g:p:t:1
 +- g:a:t:1
 |  \- (g:b:t:2 - omitted for conflict with 1)
 \- g:b:t:1
 

Throws:
DependencyTreeBuilderException

testProjectWithConflictDependencyScopeCurrentPom

public void testProjectWithConflictDependencyScopeCurrentPom()
                                                      throws DependencyTreeBuilderException
Tests building a tree for a project with a dependency that has conflicting scopes, where the nearest is not broadened since it is defined in the top-level POM:
 g:p:t:1
 +- g:b:t:1:test (scope not updated to compile)
 \- g:a:t:1
    \- (g:b:t:1:compile - omitted for duplicate)
 

Throws:
DependencyTreeBuilderException

testProjectWithConflictDependencyScopeFirstWins

public void testProjectWithConflictDependencyScopeFirstWins()
                                                     throws DependencyTreeBuilderException
Tests building a tree for a project with a dependency that has conflicting scopes, where the winner is encountered first:
 g:p:t:1
 \- g:a:t:1
    +- g:b:t:1
    |  \- g:c:t:1:compile
    \- (g:c:t:1:compile - scope updated from test; omitted for duplicate)
 

Throws:
DependencyTreeBuilderException

testProjectWithConflictDependencyScopeLastWins

public void testProjectWithConflictDependencyScopeLastWins()
                                                    throws DependencyTreeBuilderException
Tests building a tree for a project with a dependency that has conflicting scopes, where the winner is encountered last:
 g:p:t:1
 \- g:a:t:1
    +- (g:c:t:1:compile - scope updated from test; omitted for duplicate)
    \- g:b:t:1
       \- g:c:t:1:compile
 

Throws:
DependencyTreeBuilderException

testProjectWithManagedTransitiveDependencyVersion

public void testProjectWithManagedTransitiveDependencyVersion()
                                                       throws DependencyTreeBuilderException
Tests building a tree for a project with one transitive dependency whose version is fixed in dependency management:
 g:p:t:1
 \- g:a:t:1
    \- g:b:t:2 (version managed from 1)
 

Throws:
DependencyTreeBuilderException

testProjectWithManagedTransitiveDependencyScope

public void testProjectWithManagedTransitiveDependencyScope()
                                                     throws DependencyTreeBuilderException
Tests building a tree for a project with one transitive dependency whose scope is fixed in dependency management:
 g:p:t:1
 \- g:a:t:1
    \- g:b:t:1:test (scope managed from compile)
 

Throws:
DependencyTreeBuilderException

testProjectWithManagedTransitiveDependencyVersionAndScope

public void testProjectWithManagedTransitiveDependencyVersionAndScope()
                                                               throws DependencyTreeBuilderException
Tests building a tree for a project with one transitive dependency whose version and scope are fixed in dependency management:
 g:p:t:1
 \- g:a:t:1
    \- g:b:t:2:test (version managed from 1; scope managed from compile)
 

Throws:
DependencyTreeBuilderException

testProjectWithManagedTransitiveDependencyVersionAndConflictDependencyVersion

public void testProjectWithManagedTransitiveDependencyVersionAndConflictDependencyVersion()
                                                                                   throws DependencyTreeBuilderException
Tests building a tree for a project with a dependency that has conflicting versions and the version is also fixed in dependency management:
 g:p:t:1
 +- g:a:t:1
 \- g:b:t:1
    \- (g:a:t:3 - version managed from 2; omitted for conflict with 1)
 

Throws:
DependencyTreeBuilderException

testProjectWithVersionRange

public void testProjectWithVersionRange()
                                 throws org.apache.maven.artifact.versioning.InvalidVersionSpecificationException,
                                        DependencyTreeBuilderException
Tests building a tree for a project with a dependency with version range
 g:p:t:1
 \- g:a:t:1
 

Throws:
org.apache.maven.artifact.versioning.InvalidVersionSpecificationException
DependencyTreeBuilderException


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