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 * ArchivaWebappDependencyGraphTest
32 * DependencyGraphTest for testing <code>org.apache.maven.archiva:archiva-webapp:1.0-alpha-2-SNAPSHOT</code>
34 * Generated by <code>archivadev:generate-dependency-tests</code> plugin
37 public class ArchivaWebappDependencyGraphTest
38 extends AbstractDependencyGraphFactoryTestCase
40 public void testResolvedDepsToNodes()
41 throws GraphTaskException
43 MemoryRepositoryDependencyGraphBuilder graphBuilder =
44 new MemoryRepositoryDependencyGraphBuilder();
45 MemoryRepository repository = new ArchivaWebappMemoryRepository();
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.archiva:archiva-webapp:1.0-alpha-2-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.archiva:archiva-webapp:1.0-alpha-2-SNAPSHOT";
63 List expectedNodes = new ArrayList();
65 // Check for all nodes, regardless of scope.
66 expectedNodes.clear();
67 expectedNodes.add( "ant:ant-optional:1.5.1::jar" );
68 expectedNodes.add( "backport-util-concurrent:backport-util-concurrent:3.0::jar" );
69 expectedNodes.add( "classworlds:classworlds:1.1::jar" );
70 expectedNodes.add( "commons-beanutils:commons-beanutils:1.7.0::jar" );
71 expectedNodes.add( "commons-beanutils:commons-beanutils-bean-collections:1.7.0::jar" );
72 expectedNodes.add( "commons-codec:commons-codec:1.3::jar" );
73 expectedNodes.add( "commons-collections:commons-collections:3.2::jar" );
74 expectedNodes.add( "commons-configuration:commons-configuration:1.3::jar" );
75 expectedNodes.add( "commons-digester:commons-digester:1.6::jar" );
76 expectedNodes.add( "commons-io:commons-io:1.2::jar" );
77 expectedNodes.add( "commons-jxpath:commons-jxpath:1.2::jar" );
78 expectedNodes.add( "commons-lang:commons-lang:2.2::jar" );
79 expectedNodes.add( "commons-logging:commons-logging:1.0.4::jar" );
80 expectedNodes.add( "commons-logging:commons-logging-api:1.0.4::jar" );
81 expectedNodes.add( "dom4j:dom4j:1.6.1::jar" );
82 expectedNodes.add( "freemarker:freemarker:2.3.4::jar" );
83 expectedNodes.add( "geronimo-spec:geronimo-spec-jta:1.0.1B-rc2::jar" );
84 expectedNodes.add( "it.could:webdav:0.4::jar" );
85 expectedNodes.add( "javax.activation:activation:1.1::jar" );
86 expectedNodes.add( "javax.jdo:jdo2-api:2.0::jar" );
87 expectedNodes.add( "javax.mail:mail:1.4::jar" );
88 expectedNodes.add( "javax.resource:connector:1.0::jar" );
89 expectedNodes.add( "javax.servlet:jsp-api:2.0::jar" );
90 expectedNodes.add( "javax.servlet:jstl:1.1.2::jar" );
91 expectedNodes.add( "javax.servlet:servlet-api:2.4::jar" );
92 expectedNodes.add( "javax.transaction:jta:1.0.1B::jar" );
93 expectedNodes.add( "jaxen:jaxen:1.1::jar" );
94 expectedNodes.add( "jdom:jdom:1.0::jar" );
95 expectedNodes.add( "jpox:jpox:1.1.7::jar" );
96 expectedNodes.add( "jtidy:jtidy:4aug2000r7-dev::jar" );
97 expectedNodes.add( "junit:junit:3.8.1::jar" );
98 expectedNodes.add( "log4j:log4j:1.2.8::jar" );
99 expectedNodes.add( "net.java.dev.stax-utils:stax-utils:20060502::jar" );
100 expectedNodes.add( "net.sf.ehcache:ehcache:1.2.4::jar" );
101 expectedNodes.add( "ognl:ognl:2.6.7::jar" );
102 expectedNodes.add( "opensymphony:oscore:2.2.4::jar" );
103 expectedNodes.add( "opensymphony:sitemesh:2.2.1::jar" );
104 expectedNodes.add( "opensymphony:webwork:2.2.4::jar" );
105 expectedNodes.add( "opensymphony:xwork:1.2.1::jar" );
106 expectedNodes.add( "org.apache.derby:derby:10.1.3.1::jar" );
107 expectedNodes.add( "org.apache.lucene:lucene-core:2.0.0::jar" );
108 expectedNodes.add( "org.apache.maven:maven-artifact:2.0.5::jar" );
109 expectedNodes.add( "org.apache.maven:maven-artifact-manager:2.0.5::jar" );
110 expectedNodes.add( "org.apache.maven:maven-model:2.0.5::jar" );
111 expectedNodes.add( "org.apache.maven:maven-profile:2.0.5::jar" );
112 expectedNodes.add( "org.apache.maven:maven-project:2.0.5::jar" );
113 expectedNodes.add( "org.apache.maven:maven-repository-metadata:2.0.5::jar" );
114 expectedNodes.add( "org.apache.maven:maven-settings:2.0.5::jar" );
115 expectedNodes.add( "org.apache.maven.archiva:archiva-applet:1.0-alpha-2-SNAPSHOT::jar" );
116 expectedNodes.add( "org.apache.maven.archiva:archiva-artifact-reports:1.0-alpha-2-SNAPSHOT::jar" );
117 expectedNodes.add( "org.apache.maven.archiva:archiva-common:1.0-alpha-2-SNAPSHOT::jar" );
118 expectedNodes.add( "org.apache.maven.archiva:archiva-configuration:1.0-alpha-2-SNAPSHOT::jar" );
119 expectedNodes.add( "org.apache.maven.archiva:archiva-consumer-api:1.0-alpha-2-SNAPSHOT::jar" );
120 expectedNodes.add( "org.apache.maven.archiva:archiva-core-consumers:1.0-alpha-2-SNAPSHOT::jar" );
121 expectedNodes.add( "org.apache.maven.archiva:archiva-database:1.0-alpha-2-SNAPSHOT::jar" );
122 expectedNodes.add( "org.apache.maven.archiva:archiva-database-consumers:1.0-alpha-2-SNAPSHOT::jar" );
123 expectedNodes.add( "org.apache.maven.archiva:archiva-indexer:1.0-alpha-2-SNAPSHOT::jar" );
124 expectedNodes.add( "org.apache.maven.archiva:archiva-lucene-consumers:1.0-alpha-2-SNAPSHOT::jar" );
125 expectedNodes.add( "org.apache.maven.archiva:archiva-model:1.0-alpha-2-SNAPSHOT::jar" );
126 expectedNodes.add( "org.apache.maven.archiva:archiva-policies:1.0-alpha-2-SNAPSHOT::jar" );
127 expectedNodes.add( "org.apache.maven.archiva:archiva-proxy:1.0-alpha-2-SNAPSHOT::jar" );
128 expectedNodes.add( "org.apache.maven.archiva:archiva-report-manager:1.0-alpha-2-SNAPSHOT::jar" );
129 expectedNodes.add( "org.apache.maven.archiva:archiva-repository-layer:1.0-alpha-2-SNAPSHOT::jar" );
130 expectedNodes.add( "org.apache.maven.archiva:archiva-scheduled:1.0-alpha-2-SNAPSHOT::jar" );
131 expectedNodes.add( "org.apache.maven.archiva:archiva-security:1.0-alpha-2-SNAPSHOT::jar" );
132 expectedNodes.add( "org.apache.maven.archiva:archiva-signature-consumers:1.0-alpha-2-SNAPSHOT::jar" );
133 expectedNodes.add( "org.apache.maven.archiva:archiva-xml-tools:1.0-alpha-2-SNAPSHOT::jar" );
134 expectedNodes.add( "org.apache.maven.shared:maven-app-configuration-model:1.0::jar" );
135 expectedNodes.add( "org.apache.maven.shared:maven-app-configuration-web:1.0::jar" );
136 expectedNodes.add( "org.apache.maven.wagon:wagon-file:1.0-beta-2::jar" );
137 expectedNodes.add( "org.apache.maven.wagon:wagon-http-lightweight:1.0-beta-2::jar" );
138 expectedNodes.add( "org.apache.maven.wagon:wagon-http-shared:1.0-beta-2::jar" );
139 expectedNodes.add( "org.apache.maven.wagon:wagon-provider-api:1.0-beta-2::jar" );
140 expectedNodes.add( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" );
141 expectedNodes.add( "org.codehaus.plexus:plexus-component-api:1.0-alpha-22::jar" );
142 expectedNodes.add( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" );
143 expectedNodes.add( "org.codehaus.plexus:plexus-digest:1.1::jar" );
144 expectedNodes.add( "org.codehaus.plexus:plexus-ehcache:1.0-alpha-2::jar" );
145 expectedNodes.add( "org.codehaus.plexus:plexus-expression-evaluator:1.0-alpha-1::jar" );
146 expectedNodes.add( "org.codehaus.plexus:plexus-jdo2:1.0-alpha-8::jar" );
147 expectedNodes.add( "org.codehaus.plexus:plexus-mail-sender-api:1.0-alpha-6::jar" );
148 expectedNodes.add( "org.codehaus.plexus:plexus-mail-sender-javamail:1.0-alpha-6::jar" );
149 expectedNodes.add( "org.codehaus.plexus:plexus-quartz:1.0-alpha-3::jar" );
150 expectedNodes.add( "org.codehaus.plexus:plexus-slf4j-logging:1.1-alpha-1::jar" );
151 expectedNodes.add( "org.codehaus.plexus:plexus-taskqueue:1.0-alpha-6::jar" );
152 expectedNodes.add( "org.codehaus.plexus:plexus-utils:1.4::jar" );
153 expectedNodes.add( "org.codehaus.plexus:plexus-velocity:1.1.2::jar" );
154 expectedNodes.add( "org.codehaus.plexus:plexus-xwork-integration:1.0-alpha-6::jar" );
155 expectedNodes.add( "org.codehaus.plexus.cache:plexus-cache-api:1.0-alpha-2::jar" );
156 expectedNodes.add( "org.codehaus.plexus.cache:plexus-cache-ehcache:1.0-alpha-2::jar" );
157 expectedNodes.add( "org.codehaus.plexus.redback:redback-authentication-api:1.0-alpha-1::jar" );
158 expectedNodes.add( "org.codehaus.plexus.redback:redback-authentication-keys:1.0-alpha-1::jar" );
159 expectedNodes.add( "org.codehaus.plexus.redback:redback-authentication-users:1.0-alpha-1::jar" );
160 expectedNodes.add( "org.codehaus.plexus.redback:redback-authorization-api:1.0-alpha-1::jar" );
161 expectedNodes.add( "org.codehaus.plexus.redback:redback-authorization-rbac:1.0-alpha-1::jar" );
162 expectedNodes.add( "org.codehaus.plexus.redback:redback-common-jdo:1.0-alpha-1::jar" );
163 expectedNodes.add( "org.codehaus.plexus.redback:redback-configuration:1.0-alpha-1::jar" );
164 expectedNodes.add( "org.codehaus.plexus.redback:redback-keys-api:1.0-alpha-1::jar" );
165 expectedNodes.add( "org.codehaus.plexus.redback:redback-keys-cached:1.0-alpha-1::jar" );
166 expectedNodes.add( "org.codehaus.plexus.redback:redback-keys-jdo:1.0-alpha-1::jar" );
167 expectedNodes.add( "org.codehaus.plexus.redback:redback-policy:1.0-alpha-1::jar" );
168 expectedNodes.add( "org.codehaus.plexus.redback:redback-rbac-cached:1.0-alpha-1::jar" );
169 expectedNodes.add( "org.codehaus.plexus.redback:redback-rbac-jdo:1.0-alpha-1::jar" );
170 expectedNodes.add( "org.codehaus.plexus.redback:redback-rbac-model:1.0-alpha-1::jar" );
171 expectedNodes.add( "org.codehaus.plexus.redback:redback-rbac-role-manager:1.0-alpha-1::jar" );
172 expectedNodes.add( "org.codehaus.plexus.redback:redback-system:1.0-alpha-1::jar" );
173 expectedNodes.add( "org.codehaus.plexus.redback:redback-taglib:1.0-alpha-1::jar" );
174 expectedNodes.add( "org.codehaus.plexus.redback:redback-users-api:1.0-alpha-1::jar" );
175 expectedNodes.add( "org.codehaus.plexus.redback:redback-users-cached:1.0-alpha-1::jar" );
176 expectedNodes.add( "org.codehaus.plexus.redback:redback-users-jdo:1.0-alpha-1::jar" );
177 expectedNodes.add( "org.codehaus.plexus.redback:redback-xwork-content:1.0-alpha-1::war" );
178 expectedNodes.add( "org.codehaus.plexus.redback:redback-xwork-integration:1.0-alpha-1::jar" );
179 expectedNodes.add( "org.codehaus.plexus.registry:plexus-registry-api:1.0-alpha-2::jar" );
180 expectedNodes.add( "org.codehaus.plexus.registry:plexus-registry-commons:1.0-alpha-2::jar" );
181 expectedNodes.add( "org.codehaus.plexus.webdav:plexus-webdav-api:1.0-alpha-2::jar" );
182 expectedNodes.add( "org.codehaus.plexus.webdav:plexus-webdav-simple:1.0-alpha-2::jar" );
183 expectedNodes.add( "org.codehaus.woodstox:wstx-asl:3.2.1::jar" );
184 expectedNodes.add( "org.extremecomponents:extremecomponents:1.0.1::jar" );
185 expectedNodes.add( "org.rifers:rife-continuations:0.0.2::jar" );
186 expectedNodes.add( "org.slf4j:slf4j-api:1.2::jar" );
187 expectedNodes.add( "org.slf4j:slf4j-log4j12:1.2::jar" );
188 expectedNodes.add( "org.slf4j:slf4j-simple:1.2::jar" );
189 expectedNodes.add( "quartz:quartz:1.4.5::jar" );
190 expectedNodes.add( "stax:stax-api:1.0.1::jar" );
191 expectedNodes.add( "taglibs:standard:1.1.2::jar" );
192 expectedNodes.add( "velocity:velocity:1.4::jar" );
193 expectedNodes.add( "velocity:velocity-dep:1.4::jar" );
194 expectedNodes.add( "xerces:xercesImpl:2.6.2::jar" );
195 expectedNodes.add( "xml-apis:xml-apis:1.3.03::jar" );
197 assertGraph( graph, expectedRootRef, expectedNodes );