1 package org.apache.maven.plugins.enforcer;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.io.File;
23 import java.io.Reader;
24 import java.util.Date;
25 import java.util.List;
26 import java.util.Map;
27
28 import org.apache.maven.execution.RuntimeInformation;
29 import org.apache.maven.project.MavenProject;
30 import org.codehaus.classworlds.ClassRealm;
31 import org.codehaus.plexus.PlexusContainer;
32 import org.codehaus.plexus.PlexusContainerException;
33 import org.codehaus.plexus.component.composition.CompositionException;
34 import org.codehaus.plexus.component.composition.UndefinedComponentComposerException;
35 import org.codehaus.plexus.component.discovery.ComponentDiscoveryListener;
36 import org.codehaus.plexus.component.factory.ComponentInstantiationException;
37 import org.codehaus.plexus.component.repository.ComponentDescriptor;
38 import org.codehaus.plexus.component.repository.exception.ComponentLifecycleException;
39 import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
40 import org.codehaus.plexus.component.repository.exception.ComponentRepositoryException;
41 import org.codehaus.plexus.configuration.PlexusConfigurationResourceException;
42 import org.codehaus.plexus.context.Context;
43 import org.codehaus.plexus.logging.Logger;
44 import org.codehaus.plexus.logging.LoggerManager;
45
46
47
48
49
50
51
52 public class MockPlexusContainer
53 implements PlexusContainer
54 {
55
56
57
58
59
60
61 public Object lookup( String theComponentKey )
62 throws ComponentLookupException
63 {
64 if ( theComponentKey.equals( MavenProject.class.getName() ) )
65 {
66 return new MavenProject();
67 }
68 else if ( theComponentKey.equals( RuntimeInformation.class.getName() ) )
69 {
70 return new MockRuntimeInformation();
71 }
72
73 return null;
74 }
75
76
77
78
79
80
81 public void addComponentDescriptor( ComponentDescriptor theComponentDescriptor )
82 throws ComponentRepositoryException
83 {
84
85
86 }
87
88
89
90
91
92
93 public void addContextValue( Object theKey, Object theValue )
94 {
95
96
97 }
98
99
100
101
102
103
104 public void addJarRepository( File theRepository )
105 {
106
107
108 }
109
110
111
112
113
114
115 public void addJarResource( File theResource )
116 throws PlexusContainerException
117 {
118
119
120 }
121
122
123
124
125
126
127
128 public void composeComponent( Object theComponent, ComponentDescriptor theComponentDescriptor )
129 throws CompositionException, UndefinedComponentComposerException
130 {
131
132
133 }
134
135
136
137
138
139
140 public PlexusContainer createChildContainer( String theName, List theClasspathJars, Map theContext )
141 throws PlexusContainerException
142 {
143
144 return null;
145 }
146
147
148
149
150
151
152
153 public PlexusContainer createChildContainer( String theName, List theClasspathJars, Map theContext,
154 List theDiscoveryListeners )
155 throws PlexusContainerException
156 {
157
158 return null;
159 }
160
161
162
163
164
165
166 public Object createComponentInstance( ComponentDescriptor theComponentDescriptor )
167 throws ComponentInstantiationException, ComponentLifecycleException
168 {
169
170 return null;
171 }
172
173
174
175
176
177
178 public void dispose()
179 {
180
181
182 }
183
184
185
186
187
188
189 public PlexusContainer getChildContainer( String theName )
190 {
191
192 return null;
193 }
194
195
196
197
198
199
200 public ComponentDescriptor getComponentDescriptor( String theComponentKey )
201 {
202
203 return null;
204 }
205
206
207
208
209
210
211 public List getComponentDescriptorList( String theRole )
212 {
213
214 return null;
215 }
216
217
218
219
220
221
222 public Map getComponentDescriptorMap( String theRole )
223 {
224
225 return null;
226 }
227
228
229
230
231
232
233 public ClassRealm getComponentRealm( String theComponentKey )
234 {
235
236 return null;
237 }
238
239
240
241
242
243
244 public ClassRealm getContainerRealm()
245 {
246
247 return null;
248 }
249
250
251
252
253
254
255 public Context getContext()
256 {
257
258 return null;
259 }
260
261
262
263
264
265
266 public Date getCreationDate()
267 {
268
269 return null;
270 }
271
272
273
274
275
276
277 public Logger getLogger()
278 {
279
280 return null;
281 }
282
283
284
285
286
287
288 public LoggerManager getLoggerManager()
289 {
290
291 return null;
292 }
293
294
295
296
297
298
299 public boolean hasChildContainer( String theName )
300 {
301
302 return false;
303 }
304
305
306
307
308
309
310 public boolean hasComponent( String theComponentKey )
311 {
312
313 return false;
314 }
315
316
317
318
319
320
321 public boolean hasComponent( String theRole, String theRoleHint )
322 {
323
324 return false;
325 }
326
327
328
329
330
331
332 public void initialize()
333 throws PlexusContainerException
334 {
335
336
337 }
338
339
340
341
342
343
344 public boolean isInitialized()
345 {
346
347 return false;
348 }
349
350
351
352
353
354
355 public boolean isStarted()
356 {
357
358 return false;
359 }
360
361
362
363
364
365
366 public Object lookup( String theRole, String theRoleHint )
367 throws ComponentLookupException
368 {
369
370 return null;
371 }
372
373
374
375
376
377
378 public List lookupList( String theRole )
379 throws ComponentLookupException
380 {
381
382 return null;
383 }
384
385
386
387
388
389
390 public Map lookupMap( String theRole )
391 throws ComponentLookupException
392 {
393
394 return null;
395 }
396
397
398
399
400
401
402 public void registerComponentDiscoveryListener( ComponentDiscoveryListener theListener )
403 {
404
405
406 }
407
408
409
410
411
412
413 public void release( Object theComponent )
414 throws ComponentLifecycleException
415 {
416
417
418 }
419
420
421
422
423
424
425 public void releaseAll( Map theComponents )
426 throws ComponentLifecycleException
427 {
428
429
430 }
431
432
433
434
435
436
437 public void releaseAll( List theComponents )
438 throws ComponentLifecycleException
439 {
440
441
442 }
443
444
445
446
447
448
449 public void removeChildContainer( String theName )
450 {
451
452
453 }
454
455
456
457
458
459
460 public void removeComponentDiscoveryListener( ComponentDiscoveryListener theListener )
461 {
462
463
464 }
465
466
467
468
469
470
471 public void resume( Object theComponent )
472 throws ComponentLifecycleException
473 {
474
475
476 }
477
478
479
480
481
482
483 public void setConfigurationResource( Reader theConfiguration )
484 throws PlexusConfigurationResourceException
485 {
486
487
488 }
489
490
491
492
493
494
495 public void setLoggerManager( LoggerManager theLoggerManager )
496 {
497
498
499 }
500
501
502
503
504
505
506 public void setParentPlexusContainer( PlexusContainer theParentContainer )
507 {
508
509
510 }
511
512
513
514
515
516
517 public void start()
518 throws PlexusContainerException
519 {
520
521
522 }
523
524
525
526
527
528
529 public void suspend( Object theComponent )
530 throws ComponentLifecycleException
531 {
532
533
534 }
535
536 }