View Javadoc
1   /*
2    * #%L
3    * Mojo's Maven plugin for Cobertura
4    * %%
5    * Copyright (C) 2005 - 2013 Codehaus
6    * %%
7    * Licensed under the Apache License, Version 2.0 (the "License");
8    * you may not use this file except in compliance with the License.
9    * You may obtain a copy of the License at
10   * 
11   *      http://www.apache.org/licenses/LICENSE-2.0
12   * 
13   * Unless required by applicable law or agreed to in writing, software
14   * distributed under the License is distributed on an "AS IS" BASIS,
15   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   * See the License for the specific language governing permissions and
17   * limitations under the License.
18   * #L%
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   * @author Edwin Punzalan
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 }