package org.apache.maven.its; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.File; import java.util.ArrayList; import java.util.List; import java.util.Properties; import org.apache.maven.it.AbstractMavenIntegrationTestCase; import org.apache.maven.it.Verifier; import org.apache.maven.it.util.ResourceExtractor; /** * This is a sample integration test. The IT tests typically * operate by having a sample project in the * /src/test/resources folder along with a junit test like * this one. The junit test uses the verifier (which uses * the invoker) to invoke a new instance of Maven on the * project in the resources folder. It then checks the * results. This is a non-trivial example that shows two * phases. See more information inline in the code. * * @author Brian Fox * @version $Id: MavenITmngXXXXDescriptionOfProblemTest.java 707999 2008-10-26 14:42:38Z bentmann $ */ public class MavenITmng0000ProfilesXmlWorksInMultimoduleThroughInheritanceTest extends AbstractMavenIntegrationTestCase { public MavenITmng0000ProfilesXmlWorksInMultimoduleThroughInheritanceTest() { super( "[2.1.0,)" ); } public void testitMNG0000 () throws Exception { File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0000/parent" ); Verifier verifier = new Verifier( testDir.getAbsolutePath() ); List cliOptions = new ArrayList(); verifier.setCliOptions( cliOptions ); verifier.executeGoal( "package" ); verifier.verifyErrorFreeLog(); Properties props = verifier.loadProperties("../child/target/classes/child.properties"); String value = props.getProperty("some.useful.property"); assertNotNull(value); assertEquals("test-property-value", value); verifier.resetStreams(); } }