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 */ 33 public class LifecycleXpp3ReaderTest 34 extends TestCase 35 { 36 public void testLifecycleReader() 37 throws IOException, XmlPullParserException 38 {/* 39 LifecycleMappingsXpp3Reader reader = new LifecycleMappingsXpp3Reader(); 40 LifecycleConfiguration config = reader.read( new InputStreamReader( getClass().getResourceAsStream( "/lifecycle.xml" ) ) ); 41 assertEquals( "check number of lifecycles", 1, config.getLifecycles().size() ); 42 Lifecycle l = (Lifecycle) config.getLifecycles().iterator().next(); 43 assertEquals( "check id", "clover", l.getId() ); 44 assertEquals( "check number of phases", 1, l.getPhases().size() ); 45 Phase p = (Phase) l.getPhases().iterator().next(); 46 assertEquals( "check id", "generate-sources", p.getId() ); 47 assertEquals( "check number of executions", 1, p.getExecutions().size() ); 48 Execution e = (Execution) p.getExecutions().iterator().next(); 49 assertEquals( "check configuration", "true", ((Xpp3Dom) e.getConfiguration()).getChild( "debug" ).getValue() ); 50 assertEquals( "check number of goals", 1, e.getGoals().size() ); 51 String g = (String) e.getGoals().iterator().next(); 52 assertEquals( "check goal", "clover:compiler", g ); 53 */ 54 } 55 }