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