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