1 package org.apache.maven.archiva.dependency.graph;
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
22 import org.apache.maven.archiva.dependency.DependencyGraphFactory;
23 import org.apache.maven.archiva.model.DependencyScope;
24 import org.apache.maven.archiva.model.VersionedReference;
26 import java.util.ArrayList;
27 import java.util.List;
30 * WagonManagerDependencyGraphTest
32 * DependencyGraphTest for testing <code>org.apache.maven.wagon:wagon-manager:2.0-SNAPSHOT</code>
34 * Generated by <code>archivadev:generate-dependency-tests</code> plugin
37 public class WagonManagerDependencyGraphTest
38 extends AbstractDependencyGraphFactoryTestCase
40 public void testResolvedDepsToNodes()
41 throws GraphTaskException
43 MemoryRepositoryDependencyGraphBuilder graphBuilder =
44 new MemoryRepositoryDependencyGraphBuilder();
45 MemoryRepository repository = new WagonManagerMemoryRepository();
46 graphBuilder.setMemoryRepository( repository );
48 // Create the factory, and add the test resolver.
49 DependencyGraphFactory factory = new DependencyGraphFactory();
50 factory.setGraphBuilder( graphBuilder );
51 factory.setDesiredScope( DependencyScope.TEST );
53 // Get the model to resolve from
54 VersionedReference rootRef = toVersionedReference( "org.apache.maven.wagon:wagon-manager:2.0-SNAPSHOT");
56 // Perform the resolution.
57 DependencyGraph graph = factory.getGraph( rootRef );
60 assertNotNull( "Graph shouldn't be null.", graph );
62 String expectedRootRef = "org.apache.maven.wagon:wagon-manager:2.0-SNAPSHOT";
63 List expectedNodes = new ArrayList();
65 // Check for all nodes, regardless of scope.
66 expectedNodes.clear();
67 expectedNodes.add( "classworlds:classworlds:1.1-alpha-2::jar" );
68 expectedNodes.add( "com.jcraft:jsch:0.1.27::jar" );
69 expectedNodes.add( "commons-httpclient:commons-httpclient:2.0.2::jar" );
70 expectedNodes.add( "commons-lang:commons-lang:2.1::jar" );
71 expectedNodes.add( "commons-logging:commons-logging:1.0.4::jar" );
72 expectedNodes.add( "commons-net:commons-net:1.4.1::jar" );
73 expectedNodes.add( "de.zeigermann.xml:xml-im-exporter:1.1::jar" );
74 expectedNodes.add( "it.could:webdav:0.4::jar" );
75 expectedNodes.add( "javax.servlet:servlet-api:2.3::jar" );
76 expectedNodes.add( "jdom:jdom:1.0::jar" );
77 expectedNodes.add( "jtidy:jtidy:4aug2000r7-dev::jar" );
78 expectedNodes.add( "junit:junit:3.8.1::jar" );
79 expectedNodes.add( "org.apache.maven.wagon:wagon-file:2.0-SNAPSHOT::jar" );
80 expectedNodes.add( "org.apache.maven.wagon:wagon-ftp:2.0-SNAPSHOT::jar" );
81 expectedNodes.add( "org.apache.maven.wagon:wagon-http-lightweight:2.0-SNAPSHOT::jar" );
82 expectedNodes.add( "org.apache.maven.wagon:wagon-http-shared:2.0-SNAPSHOT::jar" );
83 expectedNodes.add( "org.apache.maven.wagon:wagon-provider-api:2.0-SNAPSHOT::jar" );
84 expectedNodes.add( "org.apache.maven.wagon:wagon-ssh:2.0-SNAPSHOT::jar" );
85 expectedNodes.add( "org.apache.maven.wagon:wagon-ssh-common:2.0-SNAPSHOT::jar" );
86 expectedNodes.add( "org.apache.maven.wagon:wagon-ssh-external:2.0-SNAPSHOT::jar" );
87 expectedNodes.add( "org.apache.maven.wagon:wagon-webdav:2.0-SNAPSHOT::jar" );
88 expectedNodes.add( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" );
89 expectedNodes.add( "org.codehaus.plexus:plexus-component-api:1.0-alpha-16::jar" );
90 expectedNodes.add( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" );
91 expectedNodes.add( "org.codehaus.plexus:plexus-interactivity-api:1.0-alpha-6::jar" );
92 expectedNodes.add( "org.codehaus.plexus:plexus-utils:1.4.2-SNAPSHOT::jar" );
93 expectedNodes.add( "org.codehaus.plexus.webdav:plexus-webdav-api:1.0-alpha-1::jar" );
94 expectedNodes.add( "org.codehaus.plexus.webdav:plexus-webdav-simple:1.0-alpha-1::jar" );
95 expectedNodes.add( "org.mortbay.jetty:jetty:6.0.2::jar" );
96 expectedNodes.add( "org.mortbay.jetty:jetty-util:6.0.2::jar" );
97 expectedNodes.add( "org.mortbay.jetty:servlet-api-2.5:6.0.2::jar" );
98 expectedNodes.add( "oro:oro:2.0.8::jar" );
99 expectedNodes.add( "slide:slide-webdavlib:2.1::jar" );
101 assertGraph( graph, expectedRootRef, expectedNodes );