assertEquals( "popped node is project node", projectNode, stack.pop() );
}
public void testApplyNodeVersionParentWins()
{
DependencyManagementStack stack = new DependencyManagementStack();
Dependency dep;
// top node.
DependencyGraphNode projectNode = toNode( "org.apache.maven.archiva:depmanstack-testcase:1.0::jar" );
dep = toDependency( "junit:junit:3.8.1::jar" );
dep.setScope( "test" );
projectNode.addDependencyManagement( dep );
stack.push( projectNode );
// direct node.
DependencyGraphNode directNode = toNode( "org.apache.maven.archiva:depmanstack-common:1.0::jar" );
dep = toDependency( "junit:junit:3.7::jar" );
dep.setScope( "test" );
directNode.addDependencyManagement( dep );
stack.push( directNode );
// transitive node.
DependencyGraphNode transNode = toNode( "org.apache.maven.archiva:depmanstack-model:1.0::jar" );
dep = toDependency( "junit:junit:3.7.1::jar" );
transNode.addDependencyManagement( dep );
stack.push( transNode );
// Test it
DependencyGraphNode junitNode = toNode( "junit:junit:1.0::jar" );
assertRules( "junit (lvl:trans)", stack, junitNode, "3.8.1", "test", null );
stack.pop();
assertRules( "junit (lvl:direct)", stack, junitNode, "3.8.1", "test", null );
stack.pop();
assertRules( "junit (lvl:project)", stack, junitNode, "3.8.1", "test", null );
}