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 package org.apache.maven.lifecycle;
16
17 import org.codehaus.plexus.PlexusTestCase;
18 import org.codehaus.plexus.component.annotations.Requirement;
19
20 import java.util.List;
21
22 /**
23 * @author Kristian Rosenvold
24 */
25
26 public class DefaultLifecyclesTest
27 extends PlexusTestCase
28 {
29 @Requirement
30 private DefaultLifecycles defaultLifeCycles;
31
32
33 protected void setUp()
34 throws Exception
35 {
36 super.setUp();
37 defaultLifeCycles = lookup( DefaultLifecycles.class );
38 }
39
40 @Override
41 protected void tearDown()
42 throws Exception
43 {
44 defaultLifeCycles = null;
45 super.tearDown();
46 }
47
48 public void testLifecycle()
49 throws Exception
50 {
51 final List<Lifecycle> cycles = defaultLifeCycles.getLifeCycles();
52 assertNotNull( cycles );
53 final Lifecycle lifecycle = cycles.get( 0 );
54 assertEquals( "default", lifecycle.getId() );
55 assertEquals( 23, lifecycle.getPhases().size() );
56
57 }
58
59 }