1 package org.apache.maven.plugin.testing.stubs;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import org.apache.maven.artifact.handler.ArtifactHandler;
23
24
25
26
27
28
29
30 public class DefaultArtifactHandlerStub
31 implements ArtifactHandler
32 {
33 private String extension;
34
35 private String type;
36
37 private String classifier;
38
39 private String directory;
40
41 private String packaging;
42
43 private boolean includesDependencies;
44
45 private String language;
46
47 private boolean addedToClasspath;
48
49
50
51
52
53 public DefaultArtifactHandlerStub( String t, String c )
54 {
55 type = t;
56 classifier = c;
57 if ( t.equals( "test-jar" ) )
58 {
59 extension = "jar";
60 }
61
62 }
63
64
65
66
67 public DefaultArtifactHandlerStub( String type )
68 {
69 this.type = type;
70 }
71
72
73 public String getExtension()
74 {
75 if ( extension == null )
76 {
77 extension = type;
78 }
79 return extension;
80 }
81
82
83
84
85 public String getType()
86 {
87 return type;
88 }
89
90
91 public String getClassifier()
92 {
93 return classifier;
94 }
95
96
97 public String getDirectory()
98 {
99 if ( directory == null )
100 {
101 directory = getPackaging() + "s";
102 }
103 return directory;
104 }
105
106
107 public String getPackaging()
108 {
109 if ( packaging == null )
110 {
111 packaging = getType();
112 }
113 return packaging;
114 }
115
116
117 public boolean isIncludesDependencies()
118 {
119 return includesDependencies;
120 }
121
122
123 public String getLanguage()
124 {
125 if ( language == null )
126 {
127 language = "none";
128 }
129
130 return language;
131 }
132
133
134 public boolean isAddedToClasspath()
135 {
136 return addedToClasspath;
137 }
138
139
140
141
142 public void setAddedToClasspath( boolean theAddedToClasspath )
143 {
144 this.addedToClasspath = theAddedToClasspath;
145 }
146
147
148
149
150 public void setClassifier( String theClassifier )
151 {
152 this.classifier = theClassifier;
153 }
154
155
156
157
158 public void setDirectory( String theDirectory )
159 {
160 this.directory = theDirectory;
161 }
162
163
164
165
166 public void setExtension( String theExtension )
167 {
168 this.extension = theExtension;
169 }
170
171
172
173
174 public void setIncludesDependencies( boolean theIncludesDependencies )
175 {
176 this.includesDependencies = theIncludesDependencies;
177 }
178
179
180
181
182 public void setLanguage( String theLanguage )
183 {
184 this.language = theLanguage;
185 }
186
187
188
189
190 public void setPackaging( String thePackaging )
191 {
192 this.packaging = thePackaging;
193 }
194
195
196
197
198 public void setType( String theType )
199 {
200 this.type = theType;
201 }
202 }