1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.codehaus.mojo.cobertura.stubs;
21
22 import org.apache.maven.artifact.handler.ArtifactHandler;
23 import org.apache.maven.artifact.handler.DefaultArtifactHandler;
24 import org.apache.maven.artifact.versioning.VersionRange;
25
26 import java.io.File;
27
28
29
30
31 public class ArtifactStub
32 extends org.apache.maven.plugin.testing.stubs.ArtifactStub
33 {
34 private File artifactFile;
35
36 private String groupId;
37
38 private String artifactId;
39
40 private String version;
41
42 private VersionRange versionRange;
43
44 public void setFile( File file )
45 {
46 artifactFile = file;
47 }
48
49 public void setGroupId( String groupId )
50 {
51 this.groupId = groupId;
52 }
53
54 public String getType()
55 {
56 return "pom";
57 }
58
59 public String getGroupId()
60 {
61 return groupId;
62 }
63
64 public void setArtifactId( String artifactId )
65 {
66 this.artifactId = artifactId;
67 }
68
69 public String getArtifactId()
70 {
71 return artifactId;
72 }
73
74 public VersionRange getVersionRange()
75 {
76 return versionRange;
77 }
78
79 public void setVersionRange( VersionRange versionRange )
80 {
81 this.versionRange = versionRange;
82 }
83
84 public ArtifactHandler getArtifactHandler()
85 {
86 return new DefaultArtifactHandler()
87 {
88 public String getLanguage()
89 {
90 return "java";
91 }
92 };
93 }
94
95 public File getFile()
96 {
97 return artifactFile;
98 }
99
100 public String getVersion()
101 {
102 return version;
103 }
104
105 public void setVersion( String version )
106 {
107 this.version = version;
108 }
109 }