1 package org.apache.maven.plugin.lifecycle;
2
3 /*
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
19 * under the License.
20 */
21
22 import java.io.IOException;
23
24 import junit.framework.TestCase;
25
26 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
27
28 /**
29 * Test the lifecycle reader.
30 *
31 * @author <a href="mailto:brett@apache.org">Brett Porter</a>
32 * @version $Id: LifecycleXpp3ReaderTest.java 770390 2009-04-30 18:49:42Z jvanzyl $
33 */
34 public class LifecycleXpp3ReaderTest
35 extends TestCase
36 {
37 public void testLifecycleReader()
38 throws IOException, XmlPullParserException
39 {/*
40 LifecycleMappingsXpp3Reader reader = new LifecycleMappingsXpp3Reader();
41 LifecycleConfiguration config = reader.read( new InputStreamReader( getClass().getResourceAsStream( "/lifecycle.xml" ) ) );
42 assertEquals( "check number of lifecycles", 1, config.getLifecycles().size() );
43 Lifecycle l = (Lifecycle) config.getLifecycles().iterator().next();
44 assertEquals( "check id", "clover", l.getId() );
45 assertEquals( "check number of phases", 1, l.getPhases().size() );
46 Phase p = (Phase) l.getPhases().iterator().next();
47 assertEquals( "check id", "generate-sources", p.getId() );
48 assertEquals( "check number of executions", 1, p.getExecutions().size() );
49 Execution e = (Execution) p.getExecutions().iterator().next();
50 assertEquals( "check configuration", "true", ((Xpp3Dom) e.getConfiguration()).getChild( "debug" ).getValue() );
51 assertEquals( "check number of goals", 1, e.getGoals().size() );
52 String g = (String) e.getGoals().iterator().next();
53 assertEquals( "check goal", "clover:compiler", g );
54 */
55 }
56 }