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   */
38  class LifecycleExecutorSubModulesTest extends AbstractCoreMavenComponentTestCase {
39      @Inject
40      private DefaultLifecycles defaultLifeCycles;
41  
42      @Inject
43      private MojoExecutor mojoExecutor;
44  
45      @Inject
46      private LifecycleModuleBuilder lifeCycleBuilder;
47  
48      @Inject
49      private LifecycleDependencyResolver lifeCycleDependencyResolver;
50  
51      @Inject
52      private LifecycleExecutionPlanCalculator lifeCycleExecutionPlanCalculator;
53  
54      @Inject
55      private LifeCyclePluginAnalyzer lifeCyclePluginAnalyzer;
56  
57      @Inject
58      private LifecycleTaskSegmentCalculator lifeCycleTaskSegmentCalculator;
59  
60      @Inject
61      private ExceptionHandler exceptionHandler;
62  
63      protected String getProjectsDirectory() {
64          return "src/test/projects/lifecycle-executor";
65      }
66  
67      @Test
68      void testCreation() throws Exception {
69          assertNotNull(defaultLifeCycles);
70          assertNotNull(mojoExecutor);
71          assertNotNull(lifeCycleBuilder);
72          assertNotNull(lifeCycleDependencyResolver);
73          assertNotNull(lifeCycleExecutionPlanCalculator);
74          assertNotNull(lifeCyclePluginAnalyzer);
75          assertNotNull(lifeCycleTaskSegmentCalculator);
76          assertNotNull(exceptionHandler);
77      }
78  }