1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.archiver;
20
21 import java.io.File;
22 import java.util.Collection;
23 import java.util.List;
24
25 import org.apache.maven.artifact.Artifact;
26 import org.apache.maven.artifact.handler.ArtifactHandler;
27 import org.apache.maven.artifact.metadata.ArtifactMetadata;
28 import org.apache.maven.artifact.repository.ArtifactRepository;
29 import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
30 import org.apache.maven.artifact.versioning.ArtifactVersion;
31 import org.apache.maven.artifact.versioning.OverConstrainedVersionException;
32 import org.apache.maven.artifact.versioning.VersionRange;
33
34
35
36
37 @SuppressWarnings("deprecation")
38 public class MockArtifact implements Artifact {
39 private String groupId;
40
41 private String artifactId;
42
43 private String version;
44
45 private File file;
46
47 private String scope;
48
49 private String type;
50
51 private String classifier;
52
53 private String baseVersion;
54
55 private ArtifactHandler artifactHandler;
56
57 private boolean snapshot;
58
59 public String getGroupId() {
60 return groupId;
61 }
62
63 public String getArtifactId() {
64 return artifactId;
65 }
66
67 public String getVersion() {
68 return version;
69 }
70
71 public void setVersion(String string) {
72 this.version = string;
73 }
74
75 public void setSnapshotVersion(String snapshotVersion, String baseVersion) {
76 snapshot = true;
77 version = snapshotVersion;
78 this.baseVersion = baseVersion;
79 }
80
81 public String getScope() {
82 return scope;
83 }
84
85 public String getType() {
86 return type;
87 }
88
89 public String getClassifier() {
90 return classifier;
91 }
92
93 public boolean hasClassifier() {
94 return classifier != null;
95 }
96
97 public File getFile() {
98 return file;
99 }
100
101 public void setFile(File file) {
102 this.file = file;
103 }
104
105 public String getBaseVersion() {
106 return baseVersion;
107 }
108
109 public void setBaseVersion(String string) {
110 this.baseVersion = string;
111 }
112
113 public String getId() {
114 return null;
115 }
116
117 public String getDependencyConflictId() {
118 return null;
119 }
120
121 public void addMetadata(ArtifactMetadata artifactMetadata) {}
122
123 public ArtifactMetadata getMetadata(Class<?> metadataClass) {
124 return null;
125 }
126
127 public Collection<ArtifactMetadata> getMetadataList() {
128 return null;
129 }
130
131 public void setRepository(ArtifactRepository artifactRepository) {
132
133 }
134
135 public ArtifactRepository getRepository() {
136 return null;
137 }
138
139 public void updateVersion(String string, ArtifactRepository artifactRepository) {
140
141 }
142
143 public String getDownloadUrl() {
144 return null;
145 }
146
147 public void setDownloadUrl(String string) {
148
149 }
150
151 public ArtifactFilter getDependencyFilter() {
152 return null;
153 }
154
155 public void setDependencyFilter(ArtifactFilter artifactFilter) {
156
157 }
158
159 public ArtifactHandler getArtifactHandler() {
160 return artifactHandler;
161 }
162
163 public List<String> getDependencyTrail() {
164 return null;
165 }
166
167 public void setDependencyTrail(List<String> list) {
168
169 }
170
171 public VersionRange getVersionRange() {
172 return VersionRange.createFromVersion(version);
173 }
174
175 public void setVersionRange(VersionRange versionRange) {
176
177 }
178
179 public void selectVersion(String string) {
180
181 }
182
183 public boolean isSnapshot() {
184 return snapshot;
185 }
186
187 public void setResolved(boolean b) {
188
189 }
190
191 public boolean isResolved() {
192 return false;
193 }
194
195 public void setResolvedVersion(String string) {
196
197 }
198
199 public void setArtifactHandler(ArtifactHandler artifactHandler) {
200 this.artifactHandler = artifactHandler;
201 }
202
203 public boolean isRelease() {
204 return false;
205 }
206
207 public void setRelease(boolean b) {
208
209 }
210
211 public List<ArtifactVersion> getAvailableVersions() {
212 return null;
213 }
214
215 public void setAvailableVersions(List<ArtifactVersion> list) {
216
217 }
218
219 public boolean isOptional() {
220 return false;
221 }
222
223 public void setOptional(boolean b) {
224
225 }
226
227 public ArtifactVersion getSelectedVersion() throws OverConstrainedVersionException {
228 return VersionRange.createFromVersion(version).getSelectedVersion(this);
229 }
230
231 public boolean isSelectedVersionKnown() throws OverConstrainedVersionException {
232 return VersionRange.createFromVersion(version).isSelectedVersionKnown(this);
233 }
234
235 public void setGroupId(String groupId) {
236 this.groupId = groupId;
237 }
238
239 public void setArtifactId(String artifactId) {
240 this.artifactId = artifactId;
241 }
242
243 public void setType(String type) {
244 this.type = type;
245 }
246
247 public void setClassifier(String classifier) {
248 this.classifier = classifier;
249 }
250
251 public void setScope(String string) {
252 this.scope = string;
253 }
254
255 public int compareTo(Artifact o) {
256 return 0;
257 }
258 }