[MNG-4292] Support Enum-type parameters in mojos

o Added IT

git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@812261 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2009-09-07 19:18:13 +00:00
parent 7479590472
commit b11388fdca
3 changed files with 123 additions and 0 deletions

View File

@ -101,6 +101,7 @@ public class IntegrationTestSuite
suite.addTestSuite( MavenITmng4305LocalRepoBasedirTest.class );
suite.addTestSuite( MavenITmng4304ProjectDependencyArtifactsTest.class );
suite.addTestSuite( MavenITmng4293RequiresCompilePlusRuntimeScopeTest.class );
suite.addTestSuite( MavenITmng4292EnumTypeMojoParametersTest.class );
suite.addTestSuite( MavenITmng4291MojoRequiresOnlineModeTest.class );
suite.addTestSuite( MavenITmng4283ParentPomPackagingTest.class );
suite.addTestSuite( MavenITmng4281PreferLocalSnapshotTest.class );

View File

@ -0,0 +1,62 @@
package org.apache.maven.it;
/*
* 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 org.apache.maven.it.Verifier;
import org.apache.maven.it.util.ResourceExtractor;
import java.io.File;
import java.util.Properties;
/**
* This is a test set for <a href="http://jira.codehaus.org/browse/MNG-4292">MNG-4292</a>.
*
* @author Benjamin Bentmann
*/
public class MavenITmng4292EnumTypeMojoParametersTest
extends AbstractMavenIntegrationTestCase
{
public MavenITmng4292EnumTypeMojoParametersTest()
{
super( "[3.0-alpha-3,)" );
}
/**
* Test that mojo parameters can be configured with enums.
*/
public void testit()
throws Exception
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4292" );
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
verifier.setAutoclean( false );
verifier.deleteDirectory( "target" );
verifier.executeGoal( "validate" );
verifier.verifyErrorFreeLog();
verifier.resetStreams();
Properties props = verifier.loadProperties( "target/config.properties" );
assertEquals( "HALF_EVEN", props.getProperty( "listParam.0" ) );
assertEquals( "RUNNABLE", props.getProperty( "listParam.1" ) );
}
}

View File

@ -0,0 +1,60 @@
<?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>
<groupId>org.apache.maven.its.mng4292</groupId>
<artifactId>test</artifactId>
<version>0.1</version>
<packaging>jar</packaging>
<name>Maven Integration Test :: MNG-4292</name>
<description>
Test that mojo parameters can be configured with enums.
</description>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.its.plugins</groupId>
<artifactId>maven-it-plugin-configuration</artifactId>
<version>2.1-SNAPSHOT</version>
<configuration>
<propertiesFile>target/config.properties</propertiesFile>
<listParam>
<listParam implementation="java.math.RoundingMode">HALF_EVEN</listParam>
<listParam implementation="java.lang.Thread$State">RUNNABLE</listParam>
</listParam>
</configuration>
<executions>
<execution>
<id>test</id>
<phase>validate</phase>
<goals>
<goal>config</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>