1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.eclipse.aether.internal.test.util;
20
21 import java.util.List;
22
23 import org.eclipse.aether.DefaultRepositorySystemSession;
24 import org.eclipse.aether.RepositorySystemSession;
25 import org.eclipse.aether.artifact.Artifact;
26 import org.eclipse.aether.collection.DependencyCollectionContext;
27 import org.eclipse.aether.collection.DependencyGraphTransformationContext;
28 import org.eclipse.aether.collection.VersionFilter;
29 import org.eclipse.aether.graph.Dependency;
30 import org.eclipse.aether.resolution.VersionRangeResult;
31
32
33
34
35 public class TestUtils {
36
37 private TestUtils() {
38
39 }
40
41
42
43
44
45 public static DefaultRepositorySystemSession newSession() {
46 DefaultRepositorySystemSession session = new DefaultRepositorySystemSession();
47 session.setLocalRepositoryManager(new TestLocalRepositoryManager());
48 return session;
49 }
50
51
52
53
54 public static DependencyCollectionContext newCollectionContext(
55 RepositorySystemSession session, Dependency dependency, List<Dependency> managedDependencies) {
56 return new TestDependencyCollectionContext(session, null, dependency, managedDependencies);
57 }
58
59
60
61
62 public static DependencyCollectionContext newCollectionContext(
63 RepositorySystemSession session,
64 Artifact artifact,
65 Dependency dependency,
66 List<Dependency> managedDependencies) {
67 return new TestDependencyCollectionContext(session, artifact, dependency, managedDependencies);
68 }
69
70
71
72
73 public static DependencyGraphTransformationContext newTransformationContext(RepositorySystemSession session) {
74 return new TestDependencyGraphTransformationContext(session);
75 }
76
77
78
79
80 public static VersionFilter.VersionFilterContext newVersionFilterContext(
81 RepositorySystemSession session, VersionRangeResult rangeResult) {
82 return new TestVersionFilterContext(session, rangeResult);
83 }
84 }