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