001    /*
002     * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
003     * agreements. See the NOTICE file distributed with this work for additional information regarding
004     * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
005     * "License"); you may not use this file except in compliance with the License. You may obtain a
006     * copy of the License at
007     *
008     * http://www.apache.org/licenses/LICENSE-2.0
009     *
010     * Unless required by applicable law or agreed to in writing, software distributed under the License
011     * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
012     * or implied. See the License for the specific language governing permissions and limitations under
013     * the License.
014     */
015    
016    
017    package org.apache.maven.lifecycle;
018    
019    import org.apache.maven.AbstractCoreMavenComponentTestCase;
020    import org.apache.maven.exception.ExceptionHandler;
021    import org.apache.maven.lifecycle.internal.LifecycleDependencyResolver;
022    import org.apache.maven.lifecycle.internal.LifecycleExecutionPlanCalculator;
023    import org.apache.maven.lifecycle.internal.LifecycleModuleBuilder;
024    import org.apache.maven.lifecycle.internal.LifecycleTaskSegmentCalculator;
025    import org.apache.maven.lifecycle.internal.MojoExecutor;
026    import org.codehaus.plexus.component.annotations.Requirement;
027    
028    /**
029     * Just asserts that it's able to create those components. Handy when plexus gets a nervous breakdown.
030     *
031     * @author Kristian Rosenvold
032     */
033    
034    public class LifecycleExecutorSubModulesTest
035        extends AbstractCoreMavenComponentTestCase
036    {
037        @Requirement
038        private DefaultLifecycles defaultLifeCycles;
039    
040        @Requirement
041        private MojoExecutor mojoExecutor;
042    
043        @Requirement
044        private LifecycleModuleBuilder lifeCycleBuilder;
045    
046        @Requirement
047        private LifecycleDependencyResolver lifeCycleDependencyResolver;
048    
049        @Requirement
050        private LifecycleExecutionPlanCalculator lifeCycleExecutionPlanCalculator;
051    
052        @Requirement
053        private LifeCyclePluginAnalyzer lifeCyclePluginAnalyzer;
054    
055        @Requirement
056        private LifecycleTaskSegmentCalculator lifeCycleTaskSegmentCalculator;
057    
058    
059        protected void setUp()
060            throws Exception
061        {
062            super.setUp();
063            defaultLifeCycles = lookup( DefaultLifecycles.class );
064            mojoExecutor = lookup( MojoExecutor.class );
065            lifeCycleBuilder = lookup( LifecycleModuleBuilder.class );
066            lifeCycleDependencyResolver = lookup( LifecycleDependencyResolver.class );
067            lifeCycleExecutionPlanCalculator = lookup( LifecycleExecutionPlanCalculator.class );
068            lifeCyclePluginAnalyzer = lookup( LifeCyclePluginAnalyzer.class );
069            lifeCycleTaskSegmentCalculator = lookup( LifecycleTaskSegmentCalculator.class );
070            lookup( ExceptionHandler.class );
071        }
072    
073        @Override
074        protected void tearDown()
075            throws Exception
076        {
077            defaultLifeCycles = null;
078            super.tearDown();
079        }
080    
081        protected String getProjectsDirectory()
082        {
083            return "src/test/projects/lifecycle-executor";
084        }
085    
086        public void testCrweation()
087            throws Exception
088        {
089            assertNotNull( defaultLifeCycles );
090            assertNotNull( mojoExecutor );
091            assertNotNull( lifeCycleBuilder );
092            assertNotNull( lifeCycleDependencyResolver );
093            assertNotNull( lifeCycleExecutionPlanCalculator );
094            assertNotNull( lifeCyclePluginAnalyzer );
095            assertNotNull( lifeCycleTaskSegmentCalculator );
096        }
097    
098    }