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