View Javadoc

1   package org.apache.maven.archiver;
2   
3   /*
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
11   *
12   *   http://www.apache.org/licenses/LICENSE-2.0
13   *
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
19   * under the License.
20   */
21  
22  import org.apache.maven.artifact.Artifact;
23  import org.apache.maven.artifact.handler.ArtifactHandler;
24  import org.apache.maven.artifact.metadata.ArtifactMetadata;
25  import org.apache.maven.artifact.repository.ArtifactRepository;
26  import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
27  import org.apache.maven.artifact.versioning.ArtifactVersion;
28  import org.apache.maven.artifact.versioning.OverConstrainedVersionException;
29  import org.apache.maven.artifact.versioning.VersionRange;
30  
31  import java.io.File;
32  import java.util.Collection;
33  import java.util.List;
34  
35  /**
36   * @todo move to maven-artifact-test
37   */
38  class MockArtifact
39      implements Artifact
40  {
41      private String groupId;
42  
43      private String artifactId;
44  
45      private String version;
46  
47      private File file;
48  
49      private String scope;
50  
51      private String type;
52  
53      private String classifier;
54  
55      private String baseVersion;
56      
57      private ArtifactHandler artifactHandler;
58  
59      private boolean snapshot;
60  
61      public String getGroupId()
62      {
63          return groupId;
64      }
65  
66      public String getArtifactId()
67      {
68          return artifactId;
69      }
70  
71      public String getVersion()
72      {
73          return version;
74      }
75  
76      public void setVersion( String string )
77      {
78          this.version = string;
79      }
80      
81      public void setSnapshotVersion( String snapshotVersion, String baseVersion )
82      {
83          snapshot = true;
84          version = snapshotVersion;
85          this.baseVersion = baseVersion;
86      }
87  
88      public String getScope()
89      {
90          return scope;
91      }
92  
93      public String getType()
94      {
95          return type;
96      }
97  
98      public String getClassifier()
99      {
100         return classifier;
101     }
102 
103     public boolean hasClassifier()
104     {
105         return classifier != null;
106     }
107 
108     public File getFile()
109     {
110         return file;
111     }
112 
113     public void setFile( File file )
114     {
115         this.file = file;
116     }
117 
118     public String getBaseVersion()
119     {
120         return baseVersion;
121     }
122 
123     public void setBaseVersion( String string )
124     {
125         this.baseVersion = string;
126     }
127 
128     public String getId()
129     {
130         // TODO
131         return null;
132     }
133 
134     public String getDependencyConflictId()
135     {
136         // TODO
137         return null;
138     }
139 
140     public void addMetadata( ArtifactMetadata artifactMetadata )
141     {
142         // TODO
143     }
144 
145     public Collection getMetadataList()
146     {
147         // TODO
148         return null;  //To change body of implemented methods use File | Settings | File Templates.
149     }
150 
151     public void setRepository( ArtifactRepository artifactRepository )
152     {
153         //To change body of implemented methods use File | Settings | File Templates.
154         // TODO
155     }
156 
157     public ArtifactRepository getRepository()
158     {
159         // TODO
160         return null;  //To change body of implemented methods use File | Settings | File Templates.
161     }
162 
163     public void updateVersion( String string, ArtifactRepository artifactRepository )
164     {
165         //To change body of implemented methods use File | Settings | File Templates.
166         // TODO
167     }
168 
169     public String getDownloadUrl()
170     {
171         // TODO
172         return null;  //To change body of implemented methods use File | Settings | File Templates.
173     }
174 
175     public void setDownloadUrl( String string )
176     {
177         //To change body of implemented methods use File | Settings | File Templates.
178         // TODO
179     }
180 
181     public ArtifactFilter getDependencyFilter()
182     {
183         // TODO
184         return null;  //To change body of implemented methods use File | Settings | File Templates.
185     }
186 
187     public void setDependencyFilter( ArtifactFilter artifactFilter )
188     {
189         // TODO
190         //To change body of implemented methods use File | Settings | File Templates.
191     }
192 
193     public ArtifactHandler getArtifactHandler()
194     {
195         return artifactHandler;
196     }
197 
198     public List getDependencyTrail()
199     {
200         // TODO
201         return null;  //To change body of implemented methods use File | Settings | File Templates.
202     }
203 
204     public void setDependencyTrail( List list )
205     {
206         //To change body of implemented methods use File | Settings | File Templates.
207         // TODO
208     }
209 
210     public VersionRange getVersionRange()
211     {
212         return VersionRange.createFromVersion( version );
213     }
214 
215     public void setVersionRange( VersionRange versionRange )
216     {
217         // TODO
218         //To change body of implemented methods use File | Settings | File Templates.
219     }
220 
221     public void selectVersion( String string )
222     {
223         // TODO
224         //To change body of implemented methods use File | Settings | File Templates.
225     }
226 
227     public boolean isSnapshot()
228     {
229         return snapshot;
230     }
231 
232     public void setResolved( boolean b )
233     {
234         // TODO
235         //To change body of implemented methods use File | Settings | File Templates.
236     }
237 
238     public boolean isResolved()
239     {
240         // TODO
241         return false;  //To change body of implemented methods use File | Settings | File Templates.
242     }
243 
244     public void setResolvedVersion( String string )
245     {
246         // TODO
247         //To change body of implemented methods use File | Settings | File Templates.
248     }
249 
250     public void setArtifactHandler( ArtifactHandler artifactHandler )
251     {
252         this.artifactHandler = artifactHandler;
253     }
254 
255     public boolean isRelease()
256     {
257         // TODO
258         return false;  //To change body of implemented methods use File | Settings | File Templates.
259     }
260 
261     public void setRelease( boolean b )
262     {
263         // TODO
264         //To change body of implemented methods use File | Settings | File Templates.
265     }
266 
267     public List getAvailableVersions()
268     {
269         // TODO
270         return null;  //To change body of implemented methods use File | Settings | File Templates.
271     }
272 
273     public void setAvailableVersions( List list )
274     {
275         // TODO
276         //To change body of implemented methods use File | Settings | File Templates.
277     }
278 
279     public boolean isOptional()
280     {
281         return false;  //To change body of implemented methods use File | Settings | File Templates.
282         // TODO
283     }
284 
285     public void setOptional( boolean b )
286     {
287         // TODO
288         //To change body of implemented methods use File | Settings | File Templates.
289     }
290 
291     public ArtifactVersion getSelectedVersion()
292         throws OverConstrainedVersionException
293     {
294         // TODO
295         return null;  //To change body of implemented methods use File | Settings | File Templates.
296     }
297 
298     public boolean isSelectedVersionKnown()
299         throws OverConstrainedVersionException
300     {
301         return false;  //To change body of implemented methods use File | Settings | File Templates.
302         // TODO
303     }
304 
305     public void setGroupId( String groupId )
306     {
307         this.groupId = groupId;
308     }
309 
310     public void setArtifactId( String artifactId )
311     {
312         this.artifactId = artifactId;
313     }
314 
315     public void setType( String type )
316     {
317         this.type = type;
318     }
319 
320     public void setClassifier( String classifier )
321     {
322         this.classifier = classifier;
323     }
324 
325     public void setScope( String string )
326     {
327          this.scope = string;
328     }
329 
330     public int compareTo( Object o )
331     {
332         // TODO
333         return 0;  //To change body of implemented methods use File | Settings | File Templates.
334     }
335 }