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 * MavenProjectInfoReportsPluginDependencyGraphTest
32 * DependencyGraphTest for testing <code>org.apache.maven.plugins:maven-project-info-reports-plugin:2.1-SNAPSHOT</code>
34 * Generated by <code>archivadev:generate-dependency-tests</code> plugin
37 public class MavenProjectInfoReportsPluginDependencyGraphTest
38 extends AbstractDependencyGraphFactoryTestCase
41 public void testResolvedDepsToNodes()
42 throws GraphTaskException
44 MemoryRepositoryDependencyGraphBuilder graphBuilder =
45 new MemoryRepositoryDependencyGraphBuilder();
46 MemoryRepository repository = new MavenProjectInfoReportsPluginMemoryRepository();
47 graphBuilder.setMemoryRepository( repository );
49 // Create the factory, and add the test resolver.
50 DependencyGraphFactory factory = new DependencyGraphFactory();
51 factory.setGraphBuilder( graphBuilder );
52 factory.setDesiredScope( DependencyScope.TEST );
54 // Get the model to resolve from
55 VersionedReference rootRef = toVersionedReference( "org.apache.maven.plugins:maven-project-info-reports-plugin:2.1-SNAPSHOT");
57 // Perform the resolution.
58 DependencyGraph graph = factory.getGraph( rootRef );
61 assertNotNull( "Graph shouldn't be null.", graph );
63 String expectedRootRef = "org.apache.maven.plugins:maven-project-info-reports-plugin:2.1-SNAPSHOT";
64 List expectedNodes = new ArrayList();
66 // Check for all nodes, regardless of scope.
67 expectedNodes.clear();
68 expectedNodes.add( "classworlds:classworlds:1.1-alpha-2::jar" );
69 expectedNodes.add( "com.jcraft:jsch:0.1.27::jar" );
70 expectedNodes.add( "commons-beanutils:commons-beanutils:1.7.0::jar" );
71 expectedNodes.add( "commons-cli:commons-cli:1.0::jar" );
72 expectedNodes.add( "commons-collections:commons-collections:3.1::jar" );
73 expectedNodes.add( "commons-digester:commons-digester:1.6::jar" );
74 expectedNodes.add( "commons-logging:commons-logging:1.0.4::jar" );
75 expectedNodes.add( "commons-validator:commons-validator:1.2.0::jar" );
76 expectedNodes.add( "httpunit:httpunit:1.6::jar" );
77 expectedNodes.add( "jakarta-regexp:jakarta-regexp:1.4::jar" );
78 expectedNodes.add( "javax.servlet:servlet-api:2.3::jar" );
79 expectedNodes.add( "jtidy:jtidy:4aug2000r7-dev::jar" );
80 expectedNodes.add( "junit:junit:3.8.1::jar" );
81 expectedNodes.add( "nekohtml:nekohtml:0.9.1::jar" );
82 expectedNodes.add( "org.apache.bcel:bcel:5.2::jar" );
83 expectedNodes.add( "org.apache.maven:maven-artifact:2.0.4::jar" );
84 expectedNodes.add( "org.apache.maven:maven-artifact-manager:2.0.2::jar" );
85 expectedNodes.add( "org.apache.maven:maven-core:2.0::jar" );
86 expectedNodes.add( "org.apache.maven:maven-error-diagnostics:2.0::jar" );
87 expectedNodes.add( "org.apache.maven:maven-model:2.0.4::jar" );
88 expectedNodes.add( "org.apache.maven:maven-monitor:2.0::jar" );
89 expectedNodes.add( "org.apache.maven:maven-plugin-api:2.0.4::jar" );
90 expectedNodes.add( "org.apache.maven:maven-plugin-descriptor:2.0::jar" );
91 expectedNodes.add( "org.apache.maven:maven-plugin-parameter-documenter:2.0::jar" );
92 expectedNodes.add( "org.apache.maven:maven-plugin-registry:2.0::jar" );
93 expectedNodes.add( "org.apache.maven:maven-profile:2.0::jar" );
94 expectedNodes.add( "org.apache.maven:maven-project:2.0.4::jar" );
95 expectedNodes.add( "org.apache.maven:maven-repository-metadata:2.0::jar" );
96 expectedNodes.add( "org.apache.maven:maven-settings:2.0.4::jar" );
97 expectedNodes.add( "org.apache.maven.doxia:doxia-core:1.0-alpha-8::jar" );
98 expectedNodes.add( "org.apache.maven.doxia:doxia-decoration-model:1.0-alpha-8::jar" );
99 expectedNodes.add( "org.apache.maven.doxia:doxia-sink-api:1.0-alpha-8::jar" );
100 expectedNodes.add( "org.apache.maven.doxia:doxia-site-renderer:1.0-alpha-8::jar" );
101 expectedNodes.add( "org.apache.maven.reporting:maven-reporting-api:2.0.4::jar" );
102 expectedNodes.add( "org.apache.maven.reporting:maven-reporting-impl:2.0.4::jar" );
103 expectedNodes.add( "org.apache.maven.scm:maven-scm-api:1.0-beta-4::jar" );
104 expectedNodes.add( "org.apache.maven.scm:maven-scm-manager-plexus:1.0-beta-4::jar" );
105 expectedNodes.add( "org.apache.maven.scm:maven-scm-provider-clearcase:1.0-beta-4::jar" );
106 expectedNodes.add( "org.apache.maven.scm:maven-scm-provider-cvs-commons:1.0-beta-4::jar" );
107 expectedNodes.add( "org.apache.maven.scm:maven-scm-provider-cvsexe:1.0-beta-4::jar" );
108 expectedNodes.add( "org.apache.maven.scm:maven-scm-provider-perforce:1.0-beta-4::jar" );
109 expectedNodes.add( "org.apache.maven.scm:maven-scm-provider-starteam:1.0-beta-4::jar" );
110 expectedNodes.add( "org.apache.maven.scm:maven-scm-provider-svn-commons:1.0-beta-4::jar" );
111 expectedNodes.add( "org.apache.maven.scm:maven-scm-provider-svnexe:1.0-beta-4::jar" );
112 expectedNodes.add( "org.apache.maven.shared:maven-dependency-tree:1.0-alpha-2::jar" );
113 expectedNodes.add( "org.apache.maven.shared:maven-plugin-testing-harness:1.0::jar" );
114 expectedNodes.add( "org.apache.maven.shared:maven-shared-jar:1.0-SNAPSHOT::jar" );
115 expectedNodes.add( "org.apache.maven.wagon:wagon-file:1.0-beta-2::jar" );
116 expectedNodes.add( "org.apache.maven.wagon:wagon-http-lightweight:1.0-beta-2::jar" );
117 expectedNodes.add( "org.apache.maven.wagon:wagon-http-shared:1.0-beta-2::jar" );
118 expectedNodes.add( "org.apache.maven.wagon:wagon-provider-api:1.0-beta-2::jar" );
119 expectedNodes.add( "org.apache.maven.wagon:wagon-ssh:1.0-beta-2::jar" );
120 expectedNodes.add( "org.apache.maven.wagon:wagon-ssh-common:1.0-beta-2::jar" );
121 expectedNodes.add( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" );
122 expectedNodes.add( "org.codehaus.plexus:plexus-digest:1.0::jar" );
123 expectedNodes.add( "org.codehaus.plexus:plexus-i18n:1.0-beta-6::jar" );
124 expectedNodes.add( "org.codehaus.plexus:plexus-interactivity-api:1.0-alpha-4::jar" );
125 expectedNodes.add( "org.codehaus.plexus:plexus-utils:1.1::jar" );
126 expectedNodes.add( "org.codehaus.plexus:plexus-velocity:1.1.3::jar" );
127 expectedNodes.add( "oro:oro:2.0.7::jar" );
128 expectedNodes.add( "plexus:plexus-utils:1.0.2::jar" );
129 expectedNodes.add( "regexp:regexp:1.3::jar" );
130 expectedNodes.add( "rhino:js:1.5R4.1::jar" );
131 expectedNodes.add( "velocity:velocity:1.4::jar" );
132 expectedNodes.add( "velocity:velocity-dep:1.4::jar" );
133 expectedNodes.add( "xerces:xercesImpl:2.6.2::jar" );
134 expectedNodes.add( "xerces:xmlParserAPIs:2.2.1::jar" );
135 expectedNodes.add( "xml-apis:xml-apis:1.0.b2::jar" );
137 assertGraph( graph, expectedRootRef, expectedNodes );