o Fixed it0104 which previously didn't check the plugin configuration at all

git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@712531 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2008-11-09 18:47:18 +00:00
parent aef1cc35f5
commit d2cdff8db2
3 changed files with 49 additions and 51 deletions

View File

@ -23,6 +23,7 @@ import org.apache.maven.it.Verifier;
import org.apache.maven.it.util.ResourceExtractor;
import java.io.File;
import java.util.Properties;
public class MavenIT0104Test
extends AbstractMavenIntegrationTestCase
@ -36,10 +37,22 @@ public class MavenIT0104Test
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0104" );
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
verifier.executeGoal( "test" );
verifier.setAutoclean( false );
verifier.deleteDirectory( "target" );
verifier.executeGoal( "validate" );
verifier.verifyErrorFreeLog();
verifier.resetStreams();
Properties props = verifier.loadProperties( "target/config.properties" );
assertEquals( new File( testDir, "target" ), new File( props.getProperty( "stringParam" ) ) );
assertEquals( "4.0.0", props.getProperty( "domParam.children.modelVersion.0.value" ) );
assertEquals( "org.apache.maven.its.it0104", props.getProperty( "domParam.children.groupId.0.value" ) );
assertEquals( "1.0-SNAPSHOT", props.getProperty( "domParam.children.version.0.value" ) );
assertEquals( "jar", props.getProperty( "domParam.children.packaging.0.value" ) );
assertEquals( "http://maven.apache.org", props.getProperty( "domParam.children.url.0.value" ) );
assertEquals( "Apache", props.getProperty( "domParam.children.organization.0.children.name.0.value" ) );
assertEquals( new File( testDir, "target" ), new File( props.getProperty( "domParam.children.build.0.children.directory.0.value" ) ) );
assertEquals( new File( testDir, "target/classes" ), new File( props.getProperty( "domParam.children.build.0.children.outputDirectory.0.value" ) ) );
}
}
}

View File

@ -1,45 +1,42 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<name>Maven Integration Test :: it0104</name>
<groupId>org.apache.maven.its.it0104</groupId>
<artifactId>maven-it-it0104</artifactId>
<artifactId>test</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Maven Integration Test :: it0104</name>
<description>
Verify that plugin configurations are interpolated correctly.
</description>
<organization>
<name>Apache</name>
</organization>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<url>http://maven.apache.org</url>
<repositories>
<repository>
<id>test-plugins</id>
<url>http://people.apache.org/repo/m2-snapshot-repository/</url>
<releases><enabled>false</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>test-plugins</id>
<url>http://people.apache.org/repo/m2-snapshot-repository/</url>
<releases><enabled>false</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
@ -48,8 +45,9 @@
<artifactId>maven-it-plugin-configuration</artifactId>
<version>2.1-SNAPSHOT</version>
<configuration>
<directory>${project.build.directory}</directory>
<dom>
<propertiesFile>${project.build.directory}/config.properties</propertiesFile>
<stringParam>${project.build.directory}</stringParam>
<domParam>
<basedir>${basedir}</basedir>
<modelVersion>${project.modelVersion}</modelVersion>
<name>${project.name}</name>
@ -65,7 +63,7 @@
<directory>${project.build.directory}</directory>
<outputDirectory>${project.build.outputDirectory}</outputDirectory>
</build>
</dom>
</domParam>
</configuration>
<executions>
<execution>

View File

@ -1,13 +0,0 @@
package org.apache.maven.it;
/**
* Hello world!
*
*/
public class App
{
public static void main( String[] args )
{
System.out.println( "Hello World!" );
}
}