View Javadoc

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