View Javadoc
1   package org.apache.maven.plugins.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 java.io.File;
23  import java.util.Collection;
24  import java.util.List;
25  
26  import org.apache.maven.artifact.Artifact;
27  import org.apache.maven.artifact.handler.ArtifactHandler;
28  import org.apache.maven.artifact.metadata.ArtifactMetadata;
29  import org.apache.maven.artifact.repository.ArtifactRepository;
30  import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
31  import org.apache.maven.artifact.versioning.ArtifactVersion;
32  import org.apache.maven.artifact.versioning.OverConstrainedVersionException;
33  import org.apache.maven.artifact.versioning.VersionRange;
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         return null;
120     }
121 
122     public String getDependencyConflictId()
123     {
124         return null;
125     }
126 
127     public void addMetadata( ArtifactMetadata artifactMetadata )
128     {
129         // intentionally empty.
130     }
131 
132     public Collection getMetadataList()
133     {
134         return null;  //To change body of implemented methods use File | Settings | File Templates.
135     }
136 
137     public void setRepository( ArtifactRepository artifactRepository )
138     {
139         //To change body of implemented methods use File | Settings | File Templates.
140     }
141 
142     public ArtifactRepository getRepository()
143     {
144         return null;  //To change body of implemented methods use File | Settings | File Templates.
145     }
146 
147     public void updateVersion( String string, ArtifactRepository artifactRepository )
148     {
149         //To change body of implemented methods use File | Settings | File Templates.
150     }
151 
152     public String getDownloadUrl()
153     {
154         return null;  //To change body of implemented methods use File | Settings | File Templates.
155     }
156 
157     public void setDownloadUrl( String string )
158     {
159         //To change body of implemented methods use File | Settings | File Templates.
160     }
161 
162     public ArtifactFilter getDependencyFilter()
163     {
164         return null;  //To change body of implemented methods use File | Settings | File Templates.
165     }
166 
167     public void setDependencyFilter( ArtifactFilter artifactFilter )
168     {
169         //To change body of implemented methods use File | Settings | File Templates.
170     }
171 
172     public ArtifactHandler getArtifactHandler()
173     {
174         return null;  //To change body of implemented methods use File | Settings | File Templates.
175     }
176 
177     public List getDependencyTrail()
178     {
179         return null;  //To change body of implemented methods use File | Settings | File Templates.
180     }
181 
182     public void setDependencyTrail( List list )
183     {
184         //To change body of implemented methods use File | Settings | File Templates.
185     }
186 
187     public void setScope( String string )
188     {
189         //To change body of implemented methods use File | Settings | File Templates.
190     }
191 
192     public VersionRange getVersionRange()
193     {
194         return null;  //To change body of implemented methods use File | Settings | File Templates.
195     }
196 
197     public void setVersionRange( VersionRange versionRange )
198     {
199         //To change body of implemented methods use File | Settings | File Templates.
200     }
201 
202     public void selectVersion( String string )
203     {
204         //To change body of implemented methods use File | Settings | File Templates.
205     }
206 
207     public boolean isSnapshot()
208     {
209         return false;  //To change body of implemented methods use File | Settings | File Templates.
210     }
211 
212     public void setResolved( boolean b )
213     {
214         //To change body of implemented methods use File | Settings | File Templates.
215     }
216 
217     public boolean isResolved()
218     {
219         return false;  //To change body of implemented methods use File | Settings | File Templates.
220     }
221 
222     public void setResolvedVersion( String string )
223     {
224         //To change body of implemented methods use File | Settings | File Templates.
225     }
226 
227     public void setArtifactHandler( ArtifactHandler artifactHandler )
228     {
229         //To change body of implemented methods use File | Settings | File Templates.
230     }
231 
232     public boolean isRelease()
233     {
234         return false;  //To change body of implemented methods use File | Settings | File Templates.
235     }
236 
237     public void setRelease( boolean b )
238     {
239         //To change body of implemented methods use File | Settings | File Templates.
240     }
241 
242     public List getAvailableVersions()
243     {
244         return null;  //To change body of implemented methods use File | Settings | File Templates.
245     }
246 
247     public void setAvailableVersions( List list )
248     {
249         //To change body of implemented methods use File | Settings | File Templates.
250     }
251 
252     public boolean isOptional()
253     {
254         return false;  //To change body of implemented methods use File | Settings | File Templates.
255     }
256 
257     public void setOptional( boolean b )
258     {
259         //To change body of implemented methods use File | Settings | File Templates.
260     }
261 
262     public ArtifactVersion getSelectedVersion()
263         throws OverConstrainedVersionException
264     {
265         return null;  //To change body of implemented methods use File | Settings | File Templates.
266     }
267 
268     public boolean isSelectedVersionKnown()
269         throws OverConstrainedVersionException
270     {
271         return false;  //To change body of implemented methods use File | Settings | File Templates.
272     }
273 
274     public void setGroupId( String groupId )
275     {
276         this.groupId = groupId;
277     }
278 
279     public void setArtifactId( String artifactId )
280     {
281         this.artifactId = artifactId;
282     }
283 
284     public void setType( String type )
285     {
286         this.type = type;
287     }
288 
289     public void setClassifier( String classifier )
290     {
291         this.classifier = classifier;
292     }
293 
294     public int compareTo( Artifact o )
295     {
296         return 0;
297     }
298 
299     public ArtifactMetadata getMetadata( Class<?> metadataClass )
300     {
301         return null;
302     }
303 }