mirror of https://github.com/apache/maven.git
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:
parent
ddf26754a8
commit
4ceb08bc18
|
@ -23,8 +23,7 @@ import org.apache.maven.it.Verifier;
|
||||||
import org.apache.maven.it.util.ResourceExtractor;
|
import org.apache.maven.it.util.ResourceExtractor;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.Properties;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class MavenIT0102Test
|
public class MavenIT0102Test
|
||||||
extends AbstractMavenIntegrationTestCase
|
extends AbstractMavenIntegrationTestCase
|
||||||
|
@ -41,18 +40,18 @@ public class MavenIT0102Test
|
||||||
|
|
||||||
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
|
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
|
||||||
|
|
||||||
List options = new ArrayList();
|
Properties systemProperties = new Properties();
|
||||||
options.add( "-Doutput=" + new File( testDir, "target/effective-pom.txt" ).getAbsolutePath() );
|
systemProperties.put( "expression.expressions", "project/properties" );
|
||||||
|
verifier.setSystemProperties( systemProperties );
|
||||||
verifier.setCliOptions( options );
|
verifier.executeGoal( "org.apache.maven.its.plugins:maven-it-plugin-expression::eval" );
|
||||||
|
|
||||||
List goals = new ArrayList();
|
|
||||||
goals.add( "org.apache.maven.plugins:maven-help-plugin:2.0.2:effective-pom" );
|
|
||||||
goals.add( "verify" );
|
|
||||||
|
|
||||||
verifier.verifyErrorFreeLog();
|
verifier.verifyErrorFreeLog();
|
||||||
verifier.resetStreams();
|
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" ) );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -1,51 +1,37 @@
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
|
||||||
|
<!--
|
||||||
|
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>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<name>Maven Integration Test :: it0102</name>
|
|
||||||
<groupId>org.apache.maven.its.it0102</groupId>
|
<groupId>org.apache.maven.its.it0102</groupId>
|
||||||
<artifactId>maven-it-it0102</artifactId>
|
<artifactId>maven-it-it0102</artifactId>
|
||||||
<description>Test that <activeByDefault/> calculations for profile activation only
|
|
||||||
use profiles defined in the POM. [MNG-2136]</description>
|
|
||||||
<packaging>pom</packaging>
|
|
||||||
<version>1.0</version>
|
<version>1.0</version>
|
||||||
<build>
|
<packaging>pom</packaging>
|
||||||
<plugins>
|
|
||||||
<!--
|
<name>Maven Integration Test :: it0102</name>
|
||||||
<plugin>
|
<description>
|
||||||
<artifactId>maven-help-plugin</artifactId>
|
Test that <activeByDefault/> calculations for profile activation only
|
||||||
<executions>
|
use profiles defined in the POM. [MNG-2136]
|
||||||
<execution>
|
</description>
|
||||||
<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>
|
|
||||||
|
|
||||||
<profiles>
|
<profiles>
|
||||||
<profile>
|
<profile>
|
||||||
|
@ -55,6 +41,7 @@
|
||||||
</activation>
|
</activation>
|
||||||
<properties>
|
<properties>
|
||||||
<testOutput>Failure</testOutput>
|
<testOutput>Failure</testOutput>
|
||||||
|
<it0102.testOutput>Failure</it0102.testOutput>
|
||||||
</properties>
|
</properties>
|
||||||
</profile>
|
</profile>
|
||||||
<profile>
|
<profile>
|
||||||
|
|
|
@ -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>
|
|
Loading…
Reference in New Issue