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.UndefinedComponentComposerException;
34  import org.codehaus.plexus.component.discovery.ComponentDiscoveryListener;
35  import org.codehaus.plexus.component.factory.ComponentInstantiationException;
36  import org.codehaus.plexus.component.repository.ComponentDescriptor;
37  import org.codehaus.plexus.component.repository.exception.ComponentLifecycleException;
38  import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
39  import org.codehaus.plexus.component.repository.exception.ComponentRepositoryException;
40  import org.codehaus.plexus.configuration.PlexusConfigurationException;
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      {
82          // TODO Auto-generated method stub
83  
84      }
85  
86      /*
87       * (non-Javadoc)
88       *
89       * @see org.codehaus.plexus.PlexusContainer#addContextValue(java.lang.Object, java.lang.Object)
90       */
91      public void addContextValue( Object theKey, Object theValue )
92      {
93          // TODO Auto-generated method stub
94  
95      }
96  
97      /*
98       * (non-Javadoc)
99       *
100      * @see org.codehaus.plexus.PlexusContainer#addJarRepository(java.io.File)
101      */
102     public void addJarRepository( File theRepository )
103     {
104         // TODO Auto-generated method stub
105 
106     }
107 
108     /*
109      * (non-Javadoc)
110      *
111      * @see org.codehaus.plexus.PlexusContainer#addJarResource(java.io.File)
112      */
113     public void addJarResource( File theResource )
114         throws PlexusContainerException
115     {
116         // TODO Auto-generated method stub
117 
118     }
119 
120     /*
121      * (non-Javadoc)
122      *
123      * @see org.codehaus.plexus.PlexusContainer#composeComponent(java.lang.Object,
124      *      org.codehaus.plexus.component.repository.ComponentDescriptor)
125      */
126     public void composeComponent( Object theComponent, ComponentDescriptor theComponentDescriptor )
127         throws UndefinedComponentComposerException
128     {
129         // TODO Auto-generated method stub
130 
131     }
132 
133     /*
134      * (non-Javadoc)
135      *
136      * @see org.codehaus.plexus.PlexusContainer#createChildContainer(java.lang.String, java.util.List, java.util.Map)
137      */
138     public PlexusContainer createChildContainer( String theName, List theClasspathJars, Map theContext )
139         throws PlexusContainerException
140     {
141         // TODO Auto-generated method stub
142         return null;
143     }
144 
145     /*
146      * (non-Javadoc)
147      *
148      * @see org.codehaus.plexus.PlexusContainer#createChildContainer(java.lang.String, java.util.List, java.util.Map,
149      *      java.util.List)
150      */
151     public PlexusContainer createChildContainer( String theName, List theClasspathJars, Map theContext,
152                                                  List theDiscoveryListeners )
153         throws PlexusContainerException
154     {
155         // TODO Auto-generated method stub
156         return null;
157     }
158 
159     /*
160      * (non-Javadoc)
161      *
162      * @see org.codehaus.plexus.PlexusContainer#createComponentInstance(org.codehaus.plexus.component.repository.ComponentDescriptor)
163      */
164     public Object createComponentInstance( ComponentDescriptor theComponentDescriptor )
165         throws ComponentInstantiationException, ComponentLifecycleException
166     {
167         // TODO Auto-generated method stub
168         return null;
169     }
170 
171     /*
172      * (non-Javadoc)
173      *
174      * @see org.codehaus.plexus.PlexusContainer#dispose()
175      */
176     public void dispose()
177     {
178         // TODO Auto-generated method stub
179 
180     }
181 
182     /*
183      * (non-Javadoc)
184      *
185      * @see org.codehaus.plexus.PlexusContainer#getChildContainer(java.lang.String)
186      */
187     public PlexusContainer getChildContainer( String theName )
188     {
189         // TODO Auto-generated method stub
190         return null;
191     }
192 
193     /*
194      * (non-Javadoc)
195      *
196      * @see org.codehaus.plexus.PlexusContainer#getComponentDescriptor(java.lang.String)
197      */
198     public ComponentDescriptor getComponentDescriptor( String theComponentKey )
199     {
200         // TODO Auto-generated method stub
201         return null;
202     }
203 
204     /*
205      * (non-Javadoc)
206      *
207      * @see org.codehaus.plexus.PlexusContainer#getComponentDescriptorList(java.lang.String)
208      */
209     public List getComponentDescriptorList( String theRole )
210     {
211         // TODO Auto-generated method stub
212         return null;
213     }
214 
215     /*
216      * (non-Javadoc)
217      *
218      * @see org.codehaus.plexus.PlexusContainer#getComponentDescriptorMap(java.lang.String)
219      */
220     public Map getComponentDescriptorMap( String theRole )
221     {
222         // TODO Auto-generated method stub
223         return null;
224     }
225 
226     /*
227      * (non-Javadoc)
228      *
229      * @see org.codehaus.plexus.PlexusContainer#getComponentRealm(java.lang.String)
230      */
231     public ClassRealm getComponentRealm( String theComponentKey )
232     {
233         // TODO Auto-generated method stub
234         return null;
235     }
236 
237     /*
238      * (non-Javadoc)
239      *
240      * @see org.codehaus.plexus.PlexusContainer#getContext()
241      */
242     public Context getContext()
243     {
244         // TODO Auto-generated method stub
245         return null;
246     }
247 
248     /*
249      * (non-Javadoc)
250      *
251      * @see org.codehaus.plexus.PlexusContainer#getCreationDate()
252      */
253     public Date getCreationDate()
254     {
255         // TODO Auto-generated method stub
256         return null;
257     }
258 
259     /*
260      * (non-Javadoc)
261      *
262      * @see org.codehaus.plexus.PlexusContainer#getLogger()
263      */
264     public Logger getLogger()
265     {
266         // TODO Auto-generated method stub
267         return null;
268     }
269 
270     /*
271      * (non-Javadoc)
272      *
273      * @see org.codehaus.plexus.PlexusContainer#getLoggerManager()
274      */
275     public LoggerManager getLoggerManager()
276     {
277         // TODO Auto-generated method stub
278         return null;
279     }
280 
281     /*
282      * (non-Javadoc)
283      *
284      * @see org.codehaus.plexus.PlexusContainer#hasChildContainer(java.lang.String)
285      */
286     public boolean hasChildContainer( String theName )
287     {
288         // TODO Auto-generated method stub
289         return false;
290     }
291 
292     /*
293      * (non-Javadoc)
294      *
295      * @see org.codehaus.plexus.PlexusContainer#hasComponent(java.lang.String)
296      */
297     public boolean hasComponent( String theComponentKey )
298     {
299         // TODO Auto-generated method stub
300         return false;
301     }
302 
303     /*
304      * (non-Javadoc)
305      *
306      * @see org.codehaus.plexus.PlexusContainer#hasComponent(java.lang.String, java.lang.String)
307      */
308     public boolean hasComponent( String theRole, String theRoleHint )
309     {
310         // TODO Auto-generated method stub
311         return false;
312     }
313 
314     /*
315      * (non-Javadoc)
316      *
317      * @see org.codehaus.plexus.PlexusContainer#initialize()
318      */
319     public void initialize()
320         throws PlexusContainerException
321     {
322         // TODO Auto-generated method stub
323 
324     }
325 
326     /*
327      * (non-Javadoc)
328      *
329      * @see org.codehaus.plexus.PlexusContainer#isInitialized()
330      */
331     public boolean isInitialized()
332     {
333         // TODO Auto-generated method stub
334         return false;
335     }
336 
337     /*
338      * (non-Javadoc)
339      *
340      * @see org.codehaus.plexus.PlexusContainer#isStarted()
341      */
342     public boolean isStarted()
343     {
344         // TODO Auto-generated method stub
345         return false;
346     }
347 
348     /*
349      * (non-Javadoc)
350      *
351      * @see org.codehaus.plexus.PlexusContainer#lookup(java.lang.String, java.lang.String)
352      */
353     public Object lookup( String theRole, String theRoleHint )
354         throws ComponentLookupException
355     {
356         // TODO Auto-generated method stub
357         return null;
358     }
359 
360     /*
361      * (non-Javadoc)
362      *
363      * @see org.codehaus.plexus.PlexusContainer#lookupList(java.lang.String)
364      */
365     public List lookupList( String theRole )
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#lookupMap(java.lang.String)
376      */
377     public Map lookupMap( 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#registerComponentDiscoveryListener(org.codehaus.plexus.component.discovery.ComponentDiscoveryListener)
388      */
389     public void registerComponentDiscoveryListener( ComponentDiscoveryListener theListener )
390     {
391         // TODO Auto-generated method stub
392 
393     }
394 
395     /*
396      * (non-Javadoc)
397      *
398      * @see org.codehaus.plexus.PlexusContainer#release(java.lang.Object)
399      */
400     public void release( Object theComponent )
401         throws ComponentLifecycleException
402     {
403         // TODO Auto-generated method stub
404 
405     }
406 
407     /*
408      * (non-Javadoc)
409      *
410      * @see org.codehaus.plexus.PlexusContainer#releaseAll(java.util.Map)
411      */
412     public void releaseAll( Map theComponents )
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.List)
423      */
424     public void releaseAll( List 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#removeChildContainer(java.lang.String)
435      */
436     public void removeChildContainer( String theName )
437     {
438         // TODO Auto-generated method stub
439 
440     }
441 
442     /*
443      * (non-Javadoc)
444      *
445      * @see org.codehaus.plexus.PlexusContainer#removeComponentDiscoveryListener(org.codehaus.plexus.component.discovery.ComponentDiscoveryListener)
446      */
447     public void removeComponentDiscoveryListener( ComponentDiscoveryListener theListener )
448     {
449         // TODO Auto-generated method stub
450 
451     }
452 
453     /*
454      * (non-Javadoc)
455      *
456      * @see org.codehaus.plexus.PlexusContainer#resume(java.lang.Object)
457      */
458     public void resume( Object theComponent )
459         throws ComponentLifecycleException
460     {
461         // TODO Auto-generated method stub
462 
463     }
464 
465     /*
466      * (non-Javadoc)
467      *
468      * @see org.codehaus.plexus.PlexusContainer#setConfigurationResource(java.io.Reader)
469      */
470     public void setConfigurationResource( Reader theConfiguration )
471         throws PlexusConfigurationResourceException
472     {
473         // TODO Auto-generated method stub
474 
475     }
476 
477     /*
478      * (non-Javadoc)
479      *
480      * @see org.codehaus.plexus.PlexusContainer#setLoggerManager(org.codehaus.plexus.logging.LoggerManager)
481      */
482     public void setLoggerManager( LoggerManager theLoggerManager )
483     {
484         // TODO Auto-generated method stub
485 
486     }
487 
488     /*
489      * (non-Javadoc)
490      *
491      * @see org.codehaus.plexus.PlexusContainer#setParentPlexusContainer(org.codehaus.plexus.PlexusContainer)
492      */
493     public void setParentPlexusContainer( PlexusContainer theParentContainer )
494     {
495         // TODO Auto-generated method stub
496 
497     }
498 
499     /*
500      * (non-Javadoc)
501      *
502      * @see org.codehaus.plexus.PlexusContainer#start()
503      */
504     public void start()
505         throws PlexusContainerException
506     {
507         // TODO Auto-generated method stub
508 
509     }
510 
511     /*
512      * (non-Javadoc)
513      *
514      * @see org.codehaus.plexus.PlexusContainer#suspend(java.lang.Object)
515      */
516     public void suspend( Object theComponent )
517         throws ComponentLifecycleException
518     {
519         // TODO Auto-generated method stub
520 
521     }
522 
523     @Override
524     public <T> T lookup( Class<T> role )
525         throws ComponentLookupException
526     {
527         // TODO Auto-generated method stub
528         return null;
529     }
530 
531     @Override
532     public <T> T lookup( Class<T> role, String hint )
533         throws ComponentLookupException
534     {
535         // TODO Auto-generated method stub
536         return null;
537     }
538 
539     @Override
540     public <T> T lookup( Class<T> type, String role, String hint )
541         throws ComponentLookupException
542     {
543         // TODO Auto-generated method stub
544         return null;
545     }
546 
547     @Override
548     public <T> List<T> lookupList( Class<T> role )
549         throws ComponentLookupException
550     {
551         // TODO Auto-generated method stub
552         return null;
553     }
554 
555     @Override
556     public <T> Map<String, T> lookupMap( Class<T> role )
557         throws ComponentLookupException
558     {
559         // TODO Auto-generated method stub
560         return null;
561     }
562 
563     @Override
564     public boolean hasComponent( Class<?> role )
565     {
566         // TODO Auto-generated method stub
567         return false;
568     }
569 
570     @Override
571     public boolean hasComponent( Class<?> role, String hint )
572     {
573         // TODO Auto-generated method stub
574         return false;
575     }
576 
577     @Override
578     public boolean hasComponent( Class<?> type, String role, String hint )
579     {
580         // TODO Auto-generated method stub
581         return false;
582     }
583 
584     @Override
585     public void addComponent( Object component, String role )
586     {
587         // TODO Auto-generated method stub
588         
589     }
590 
591     @Override
592     public <T> void addComponent( T component, Class<?> role, String hint )
593     {
594         // TODO Auto-generated method stub
595         
596     }
597 
598     @Override
599     public ComponentDescriptor<?> getComponentDescriptor( String role, String hint )
600     {
601         // TODO Auto-generated method stub
602         return null;
603     }
604 
605     @Override
606     public <T> ComponentDescriptor<T> getComponentDescriptor( Class<T> type, String role, String hint )
607     {
608         // TODO Auto-generated method stub
609         return null;
610     }
611 
612     @Override
613     public <T> List<ComponentDescriptor<T>> getComponentDescriptorList( Class<T> type, String role )
614     {
615         // TODO Auto-generated method stub
616         return null;
617     }
618 
619     @Override
620     public <T> Map<String, ComponentDescriptor<T>> getComponentDescriptorMap( Class<T> type, String role )
621     {
622         // TODO Auto-generated method stub
623         return null;
624     }
625 
626     @Override
627     public List<ComponentDescriptor<?>> discoverComponents( org.codehaus.plexus.classworlds.realm.ClassRealm classRealm )
628         throws PlexusConfigurationException
629     {
630         // TODO Auto-generated method stub
631         return null;
632     }
633 
634     @Override
635     public org.codehaus.plexus.classworlds.realm.ClassRealm getContainerRealm()
636     {
637         // TODO Auto-generated method stub
638         return null;
639     }
640 
641     @Override
642     public org.codehaus.plexus.classworlds.realm.ClassRealm setLookupRealm( org.codehaus.plexus.classworlds.realm.ClassRealm realm )
643     {
644         // TODO Auto-generated method stub
645         return null;
646     }
647 
648     @Override
649     public org.codehaus.plexus.classworlds.realm.ClassRealm getLookupRealm()
650     {
651         // TODO Auto-generated method stub
652         return null;
653     }
654 
655     @Override
656     public org.codehaus.plexus.classworlds.realm.ClassRealm createChildRealm( String id )
657     {
658         // TODO Auto-generated method stub
659         return null;
660     }
661 
662 }