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 */
015package org.apache.maven.lifecycle;
016
017import org.codehaus.plexus.PlexusTestCase;
018import org.codehaus.plexus.component.annotations.Requirement;
019
020import java.util.List;
021
022/**
023 * @author Kristian Rosenvold
024 */
025
026public class DefaultLifecyclesTest
027    extends PlexusTestCase
028{
029    @Requirement
030    private DefaultLifecycles defaultLifeCycles;
031
032
033    protected void setUp()
034        throws Exception
035    {
036        super.setUp();
037        defaultLifeCycles = lookup( DefaultLifecycles.class );
038    }
039
040    @Override
041    protected void tearDown()
042        throws Exception
043    {
044        defaultLifeCycles = null;
045        super.tearDown();
046    }
047
048    public void testLifecycle()
049        throws Exception
050    {
051        final List<Lifecycle> cycles = defaultLifeCycles.getLifeCycles();
052        assertNotNull( cycles );
053        final Lifecycle lifecycle = cycles.get( 0 );
054        assertEquals( "default", lifecycle.getId() );
055        assertEquals( 23, lifecycle.getPhases().size() );
056
057    }
058
059}