View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
3    * agreements. See the NOTICE file distributed with this work for additional information regarding
4    * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
5    * "License"); you may not use this file except in compliance with the License. You may obtain a
6    * copy of the License at
7    *
8    * http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software distributed under the License
11   * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12   * or implied. See the License for the specific language governing permissions and limitations under
13   * the License.
14   */
15  
16  
17  package org.apache.maven.lifecycle;
18  
19  import org.apache.maven.AbstractCoreMavenComponentTestCase;
20  import org.apache.maven.exception.ExceptionHandler;
21  import org.apache.maven.lifecycle.internal.LifecycleDependencyResolver;
22  import org.apache.maven.lifecycle.internal.LifecycleExecutionPlanCalculator;
23  import org.apache.maven.lifecycle.internal.LifecycleModuleBuilder;
24  import org.apache.maven.lifecycle.internal.LifecycleTaskSegmentCalculator;
25  import org.apache.maven.lifecycle.internal.MojoExecutor;
26  import org.codehaus.plexus.component.annotations.Requirement;
27  
28  /**
29   * Just asserts that it's able to create those components. Handy when plexus gets a nervous breakdown.
30   *
31   * @author Kristian Rosenvold
32   */
33  
34  public class LifecycleExecutorSubModulesTest
35      extends AbstractCoreMavenComponentTestCase
36  {
37      @Requirement
38      private DefaultLifecycles defaultLifeCycles;
39  
40      @Requirement
41      private MojoExecutor mojoExecutor;
42  
43      @Requirement
44      private LifecycleModuleBuilder lifeCycleBuilder;
45  
46      @Requirement
47      private LifecycleDependencyResolver lifeCycleDependencyResolver;
48  
49      @Requirement
50      private LifecycleExecutionPlanCalculator lifeCycleExecutionPlanCalculator;
51  
52      @Requirement
53      private LifeCyclePluginAnalyzer lifeCyclePluginAnalyzer;
54  
55      @Requirement
56      private LifecycleTaskSegmentCalculator lifeCycleTaskSegmentCalculator;
57  
58  
59      protected void setUp()
60          throws Exception
61      {
62          super.setUp();
63          defaultLifeCycles = lookup( DefaultLifecycles.class );
64          mojoExecutor = lookup( MojoExecutor.class );
65          lifeCycleBuilder = lookup( LifecycleModuleBuilder.class );
66          lifeCycleDependencyResolver = lookup( LifecycleDependencyResolver.class );
67          lifeCycleExecutionPlanCalculator = lookup( LifecycleExecutionPlanCalculator.class );
68          lifeCyclePluginAnalyzer = lookup( LifeCyclePluginAnalyzer.class );
69          lifeCycleTaskSegmentCalculator = lookup( LifecycleTaskSegmentCalculator.class );
70          lookup( ExceptionHandler.class );
71      }
72  
73      @Override
74      protected void tearDown()
75          throws Exception
76      {
77          defaultLifeCycles = null;
78          super.tearDown();
79      }
80  
81      protected String getProjectsDirectory()
82      {
83          return "src/test/projects/lifecycle-executor";
84      }
85  
86      public void testCreation()
87          throws Exception
88      {
89          assertNotNull( defaultLifeCycles );
90          assertNotNull( mojoExecutor );
91          assertNotNull( lifeCycleBuilder );
92          assertNotNull( lifeCycleDependencyResolver );
93          assertNotNull( lifeCycleExecutionPlanCalculator );
94          assertNotNull( lifeCyclePluginAnalyzer );
95          assertNotNull( lifeCycleTaskSegmentCalculator );
96      }
97  
98  }