o Decoupled it0102 from production plugins

git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@701511 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2008-10-03 19:44:17 +00:00
parent ddf26754a8
commit 4ceb08bc18
3 changed files with 42 additions and 68 deletions

View File

@ -23,8 +23,7 @@ import org.apache.maven.it.Verifier;
import org.apache.maven.it.util.ResourceExtractor;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
public class MavenIT0102Test
extends AbstractMavenIntegrationTestCase
@ -41,18 +40,18 @@ public class MavenIT0102Test
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
List options = new ArrayList();
options.add( "-Doutput=" + new File( testDir, "target/effective-pom.txt" ).getAbsolutePath() );
verifier.setCliOptions( options );
List goals = new ArrayList();
goals.add( "org.apache.maven.plugins:maven-help-plugin:2.0.2:effective-pom" );
goals.add( "verify" );
Properties systemProperties = new Properties();
systemProperties.put( "expression.expressions", "project/properties" );
verifier.setSystemProperties( systemProperties );
verifier.executeGoal( "org.apache.maven.its.plugins:maven-it-plugin-expression::eval" );
verifier.verifyErrorFreeLog();
verifier.resetStreams();
verifier.assertFilePresent( "target/expression.properties" );
Properties props = verifier.loadProperties( "target/expression.properties" );
assertNull( props.getProperty( "project.properties.it0102.testOutput" ) );
assertEquals( "Success", props.getProperty( "project.properties.testOutput" ) );
assertEquals( "Present", props.getProperty( "project.properties.profilesXmlValue" ) );
}
}
}

View File

@ -1,51 +1,37 @@
<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>
<modelVersion>4.0.0</modelVersion>
<name>Maven Integration Test :: it0102</name>
<groupId>org.apache.maven.its.it0102</groupId>
<artifactId>maven-it-it0102</artifactId>
<description>Test that &lt;activeByDefault/&gt; calculations for profile activation only
use profiles defined in the POM. [MNG-2136]</description>
<packaging>pom</packaging>
<version>1.0</version>
<build>
<plugins>
<!--
<plugin>
<artifactId>maven-help-plugin</artifactId>
<executions>
<execution>
<id>output-pom</id>
<phase>generate-resources</phase>
<configuration>
<output>target/effective-pom.txt</output>
</configuration>
<goals>
<goal>effective-pom</goal>
</goals>
</execution>
</executions>
</plugin>
-->
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>validate</phase>
<configuration>
<tasks>
<echo>value from external profile: ${profilesXmlValue}</echo>
<echo>test output: ${testOutput}</echo>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<packaging>pom</packaging>
<name>Maven Integration Test :: it0102</name>
<description>
Test that &lt;activeByDefault/&gt; calculations for profile activation only
use profiles defined in the POM. [MNG-2136]
</description>
<profiles>
<profile>
@ -55,6 +41,7 @@
</activation>
<properties>
<testOutput>Failure</testOutput>
<it0102.testOutput>Failure</it0102.testOutput>
</properties>
</profile>
<profile>

View File

@ -1,12 +0,0 @@
<verifications>
<files>
<file>
<location>target/effective-pom.txt</location>
<contains>value from external profile: Present</contains>
</file>
<file>
<location>target/effective-pom.txt</location>
<contains>test output: Success</contains>
</file>
</files>
</verifications>