o Decoupled it0056 from Compiler Plugin

git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@699097 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2008-09-25 21:30:23 +00:00
parent b355beba79
commit c567d3d042
9 changed files with 48 additions and 131 deletions

View File

@ -29,24 +29,19 @@ public class MavenIT0056Test
{
/**
* Test that multiple executions of the compile goal with different
* includes/excludes will succeed.
* Test that multiple executions of a goal with different
* parameter values will succeed.
*/
public void testit0056()
throws Exception
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0056" );
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
verifier.executeGoal( "test-compile" );
verifier.assertFilePresent( "target/classes/org/apache/maven/it0056/Person.class" );
verifier.assertFilePresent( "target/classes/org/apache/maven/it0056/PersonTwo.class" );
verifier.assertFilePresent( "target/classes/org/apache/maven/it0056/PersonThree.class" );
verifier.assertFilePresent( "target/test-classes/org/apache/maven/it0056/PersonTest.class" );
verifier.assertFilePresent( "target/test-classes/org/apache/maven/it0056/PersonTwoTest.class" );
verifier.assertFilePresent( "target/test-classes/org/apache/maven/it0056/PersonThreeTest.class" );
verifier.executeGoal( "initialize" );
verifier.assertFilePresent( "target/first-exec.txt" );
verifier.assertFilePresent( "target/file.txt" );
verifier.verifyErrorFreeLog();
verifier.resetStreams();
}
}
}

View File

@ -1,43 +1,62 @@
<?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>
<modelVersion>4.0.0</modelVersion>
<name>Maven Integration Test :: it0056</name>
<groupId>org.apache.maven.its.it0056</groupId>
<artifactId>maven-it-it0056</artifactId>
<description>Test that multiple executions of the compile goal with different
includes/excludes will succeed.</description>
<packaging>jar</packaging>
<version>1.0</version>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<type>jar</type>
<scope>test</scope>
</dependency>
</dependencies>
<packaging>jar</packaging>
<name>Maven Integration Test :: it0056</name>
<description>
Test that multiple executions of a goal with different
parameter values will succeed.
</description>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<groupId>org.apache.maven.its.plugins</groupId>
<artifactId>maven-it-plugin-file</artifactId>
<executions>
<execution>
<id>validation-phase-execution</id>
<id>first-exec</id>
<phase>validate</phase>
<goals>
<goal>compile</goal>
<goal>file</goal>
</goals>
<configuration>
<excludes>
<exclude implementation="java.lang.String">**/PersonTwo.java</exclude>
</excludes>
<testExcludes>
<testExclude implementation="java.lang.String">**/PersonTwoTest.java</testExclude>
</testExcludes>
<pathname>target/first-exec.txt</pathname>
</configuration>
</execution>
<execution>
<id>second-exec</id>
<phase>initialize</phase>
<goals>
<goal>file</goal>
</goals>
<!-- just use default values here -->
</execution>
</executions>
</plugin>
</plugins>

View File

@ -1,16 +0,0 @@
package org.apache.maven.it0056;
public class Person
{
private String name;
public void setName( String name )
{
this.name = name;
}
public String getName()
{
return name;
}
}

View File

@ -1,16 +0,0 @@
package org.apache.maven.it0056;
public class PersonThree
{
private String name;
public void setName( String name )
{
this.name = name;
}
public String getName()
{
return name;
}
}

View File

@ -1,16 +0,0 @@
package org.apache.maven.it0056;
public class PersonTwo
{
private String name;
public void setName( String name )
{
this.name = name;
}
public String getName()
{
return name;
}
}

View File

@ -1,16 +0,0 @@
package org.apache.maven.it0056;
import junit.framework.TestCase;
public class PersonTest
extends TestCase
{
public void testPerson()
{
Person person = new Person();
person.setName( "foo" );
assertEquals( "foo", person.getName() );
}
}

View File

@ -1,16 +0,0 @@
package org.apache.maven.it0056;
import junit.framework.TestCase;
public class PersonThreeTest
extends TestCase
{
public void testPerson()
{
Person person = new Person();
person.setName( "foo" );
assertEquals( "foo", person.getName() );
}
}

View File

@ -1,16 +0,0 @@
package org.apache.maven.it0056;
import junit.framework.TestCase;
public class PersonTwoTest
extends TestCase
{
public void testPerson()
{
Person person = new Person();
person.setName( "foo" );
assertEquals( "foo", person.getName() );
}
}