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 * ContinuumStoreDependencyGraphTest
32 * DependencyGraphTest for testing <code>org.apache.maven.continuum:continuum-store:1.1-SNAPSHOT</code>
34 * Generated by <code>archivadev:generate-dependency-tests</code> plugin
37 public class ContinuumStoreDependencyGraphTest
38 extends AbstractDependencyGraphFactoryTestCase
40 public void testResolvedDepsToNodes()
41 throws GraphTaskException
43 MemoryRepositoryDependencyGraphBuilder graphBuilder =
44 new MemoryRepositoryDependencyGraphBuilder();
45 MemoryRepository repository = new ContinuumStoreMemoryRepository();
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.continuum:continuum-store:1.1-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.continuum:continuum-store:1.1-SNAPSHOT";
63 List expectedNodes = new ArrayList();
65 // Check for all nodes, regardless of scope.
66 expectedNodes.clear();
67 expectedNodes.add( "ant:ant:1.6::jar" );
68 expectedNodes.add( "geronimo-spec:geronimo-spec-jta:1.0.1B-rc2::jar" );
69 expectedNodes.add( "hsqldb:hsqldb:1.7.3.3::jar" );
70 expectedNodes.add( "jakarta-regexp:jakarta-regexp:1.4::jar" );
71 expectedNodes.add( "javax.jdo:jdo2-api:2.0::jar" );
72 expectedNodes.add( "javax.resource:connector:1.0::jar" );
73 expectedNodes.add( "javax.transaction:jta:1.0.1B::jar" );
74 expectedNodes.add( "jmock:jmock:1.0.1::jar" );
75 expectedNodes.add( "jpox:jpox:1.1.7::jar" );
76 expectedNodes.add( "jpox:jpox-enhancer:1.1.7::jar" );
77 expectedNodes.add( "junit:junit:3.8.1::jar" );
78 expectedNodes.add( "log4j:log4j:1.2.8::jar" );
79 expectedNodes.add( "net.java.dev.stax-utils:stax-utils:20060502::jar" );
80 expectedNodes.add( "ognl:ognl:2.6.7::jar" );
81 expectedNodes.add( "org.apache.bcel:bcel:5.2::jar" );
82 expectedNodes.add( "org.apache.maven.continuum:continuum-api:1.1-SNAPSHOT::jar" );
83 expectedNodes.add( "org.apache.maven.continuum:continuum-model:1.1-SNAPSHOT::jar" );
84 expectedNodes.add( "org.apache.maven.continuum:continuum-test:1.1-SNAPSHOT::jar" );
85 expectedNodes.add( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" );
86 expectedNodes.add( "org.codehaus.plexus:plexus-component-api:1.0-alpha-20::jar" );
87 expectedNodes.add( "org.codehaus.plexus:plexus-container-default:1.0-alpha-20::jar" );
88 expectedNodes.add( "org.codehaus.plexus:plexus-formica:1.0-beta-13::jar" );
89 expectedNodes.add( "org.codehaus.plexus:plexus-i18n:1.0-beta-6::jar" );
90 expectedNodes.add( "org.codehaus.plexus:plexus-jdo2:1.0-alpha-8::jar" );
91 expectedNodes.add( "org.codehaus.plexus:plexus-utils:1.4::jar" );
92 expectedNodes.add( "oro:oro:2.0.6::jar" );
93 expectedNodes.add( "stax:stax-api:1.0.1::jar" );
95 assertGraph( graph, expectedRootRef, expectedNodes );