Package org.apache.maven.archiva.dependency.graph.tasks

Examples of org.apache.maven.archiva.dependency.graph.tasks.DependencyManagementStack


        DependencyGraphNode node = toNode( "org.apache.maven.archiva:depmanstack-testcase:1.0::jar" );
        Dependency dep = toDependency( "junit:junit:3.8.1::jar" );
        dep.setScope( "test" );
        node.addDependencyManagement( dep );

        DependencyManagementStack stack = new DependencyManagementStack();
        stack.push( node );
        DependencyGraphNode oldnode = stack.pop();
        assertEquals( "added node to old node", node, oldnode );
    }
View Full Code Here


        assertEquals( "added node to old node", node, oldnode );
    }

    public void testPushPopTwoDeep()
    {
        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::jar" );
        transNode.addDependencyManagement( dep );
        stack.push( transNode );

        // Test it
        assertEquals( "popped node is trans node", transNode, stack.pop() );
        assertEquals( "popped node is direct node", directNode, stack.pop() );
        assertEquals( "popped node is project node", projectNode, stack.pop() );
    }
View Full Code Here

        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 );
    }
View Full Code Here

     * If B:1.0 has a dependency management section stating dep D should be version 2.0
     * Then the dep D when viewed from A should be version 2.0
     */
    public void testApplyNodeVersionCarlosABCD()
    {
        DependencyManagementStack stack = new DependencyManagementStack();
        Dependency dep;

        // project node, A
        DependencyGraphNode nodeA = toNode( "org.apache.maven.archiva:carlos-A:1.0::jar" );
        stack.push( nodeA );

        // sub node, B
        DependencyGraphNode nodeB = toNode( "org.apache.maven.archiva:carlos-B:1.0::jar" );
        dep = toDependency( "org.apache.maven.archiva:carlos-D:2.0::jar" );
        nodeB.addDependencyManagement( dep );
        stack.push( nodeB );

        // sub node, C
        DependencyGraphNode nodeC = toNode( "org.apache.maven.archiva:carlos-C:1.0::jar" );
        stack.push( nodeC );

        // sub node, D
        // Not added to the stack, as this is the node that is having the rules applied to it.
        DependencyGraphNode nodeD = toNode( "org.apache.maven.archiva:carlos-D:1.0::jar" );

        // Test it
        assertRules( "node D (lvl:C)", stack, nodeD, "2.0", null, null );
        stack.pop();
        assertRules( "node D (lvl:B)", stack, nodeD, "2.0", null, null );
        stack.pop();
        assertNoRules( "node D (lvl:A)", stack, nodeD, "2.0", null, null );
    }
View Full Code Here

        DependencyGraphNode node = toNode( "org.apache.maven.archiva:depmanstack-testcase:1.0::jar" );
        Dependency dep = toDependency( "junit:junit:3.8.1::jar" );
        dep.setScope( "test" );
        node.addDependencyManagement( dep );

        DependencyManagementStack stack = new DependencyManagementStack();
        stack.push( node );
        DependencyGraphNode oldnode = stack.pop();
        assertEquals( "added node to old node", node, oldnode );
    }
View Full Code Here

        assertEquals( "added node to old node", node, oldnode );
    }

    public void testPushPopTwoDeep()
    {
        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::jar" );
        transNode.addDependencyManagement( dep );
        stack.push( transNode );

        // Test it
        assertEquals( "popped node is trans node", transNode, stack.pop() );
        assertEquals( "popped node is direct node", directNode, stack.pop() );
        assertEquals( "popped node is project node", projectNode, stack.pop() );
    }
View Full Code Here

        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 );
    }
View Full Code Here

     * If B:1.0 has a dependency management section stating dep D should be version 2.0
     * Then the dep D when viewed from A should be version 2.0
     */
    public void testApplyNodeVersionCarlosABCD()
    {
        DependencyManagementStack stack = new DependencyManagementStack();
        Dependency dep;

        // project node, A
        DependencyGraphNode nodeA = toNode( "org.apache.maven.archiva:carlos-A:1.0::jar" );
        stack.push( nodeA );

        // sub node, B
        DependencyGraphNode nodeB = toNode( "org.apache.maven.archiva:carlos-B:1.0::jar" );
        dep = toDependency( "org.apache.maven.archiva:carlos-D:2.0::jar" );
        nodeB.addDependencyManagement( dep );
        stack.push( nodeB );

        // sub node, C
        DependencyGraphNode nodeC = toNode( "org.apache.maven.archiva:carlos-C:1.0::jar" );
        stack.push( nodeC );

        // sub node, D
        // Not added to the stack, as this is the node that is having the rules applied to it.
        DependencyGraphNode nodeD = toNode( "org.apache.maven.archiva:carlos-D:1.0::jar" );

        // Test it
        assertRules( "node D (lvl:C)", stack, nodeD, "2.0", null, null );
        stack.pop();
        assertRules( "node D (lvl:B)", stack, nodeD, "2.0", null, null );
        stack.pop();
        assertNoRules( "node D (lvl:A)", stack, nodeD, "2.0", null, null );
    }
View Full Code Here

TOP

Related Classes of org.apache.maven.archiva.dependency.graph.tasks.DependencyManagementStack

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.