1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.artifact.factory;
20
21 import org.apache.maven.artifact.Artifact;
22 import org.apache.maven.artifact.versioning.VersionRange;
23 import org.codehaus.plexus.PlexusTestCase;
24
25 public class DefaultArtifactFactoryTest extends PlexusTestCase {
26
27 public void testPropagationOfSystemScopeRegardlessOfInheritedScope() throws Exception {
28 ArtifactFactory factory = (ArtifactFactory) lookup(ArtifactFactory.ROLE);
29
30 Artifact artifact = factory.createDependencyArtifact(
31 "test-grp", "test-artifact", VersionRange.createFromVersion("1.0"), "type", null, "system", "provided");
32 Artifact artifact2 = factory.createDependencyArtifact(
33 "test-grp", "test-artifact-2", VersionRange.createFromVersion("1.0"), "type", null, "system", "test");
34 Artifact artifact3 = factory.createDependencyArtifact(
35 "test-grp",
36 "test-artifact-3",
37 VersionRange.createFromVersion("1.0"),
38 "type",
39 null,
40 "system",
41 "runtime");
42 Artifact artifact4 = factory.createDependencyArtifact(
43 "test-grp",
44 "test-artifact-4",
45 VersionRange.createFromVersion("1.0"),
46 "type",
47 null,
48 "system",
49 "compile");
50
51
52 Artifact artifact5 = factory.createDependencyArtifact(
53 "test-grp", "test-artifact-5", VersionRange.createFromVersion("1.0"), "type", null, "system", "system");
54
55 assertEquals("system", artifact.getScope());
56 assertEquals("system", artifact2.getScope());
57 assertEquals("system", artifact3.getScope());
58 assertEquals("system", artifact4.getScope());
59 assertEquals("system", artifact5.getScope());
60 }
61 }