[MNG-3955] [regression] ${settings.localRepository} does not reflect actual repo path if maven.repo.local used

o Added IT

git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@731354 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2009-01-04 20:27:36 +00:00
parent 4cdb501e61
commit 4d4d9984d1
4 changed files with 157 additions and 0 deletions

View File

@ -90,6 +90,7 @@ public class IntegrationTestSuite
// suite.addTestSuite( MavenIT0109ReleaseUpdateTest.class );
// suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137
suite.addTestSuite( MavenITmng3955EffectiveSettingsTest.class );
suite.addTestSuite( MavenITmng3953AuthenticatedDeploymentTest.class );
suite.addTestSuite( MavenITmng3948ParentResolutionFromProfileReposTest.class );
suite.addTestSuite( MavenITmng3947PluginDefaultExecutionConfigTest.class );

View File

@ -0,0 +1,69 @@
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 java.io.File;
import java.util.Properties;
import org.apache.maven.it.Verifier;
import org.apache.maven.it.util.ResourceExtractor;
/**
* This is a test set for <a href="http://jira.codehaus.org/browse/MNG-3955">MNG-3955</a>.
*
* @author Benjamin Bentmann
* @version $Id$
*/
public class MavenITmng3955EffectiveSettingsTest
extends AbstractMavenIntegrationTestCase
{
public MavenITmng3955EffectiveSettingsTest()
{
super();
}
/**
* Test that plugin parameter expressions referring to the settings reflect the actual core state, especially
* if settings have been overridden by CLI parameters.
*/
public void testitMNG3955()
throws Exception
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3955" );
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
verifier.setAutoclean( false );
verifier.getCliOptions().add( "--settings" );
verifier.getCliOptions().add( new File( testDir, "settings.xml" ).getAbsolutePath() );
verifier.getCliOptions().add( "--offline" );
verifier.getCliOptions().add( "--batch-mode" );
verifier.executeGoal( "validate" );
verifier.verifyErrorFreeLog();
verifier.resetStreams();
Properties props = verifier.loadProperties( "target/settings.properties" );
assertEquals( "true", props.getProperty( "settings.offline" ) );
assertEquals( "false", props.getProperty( "settings.interactiveMode" ) );
assertEquals( new File( verifier.localRepo ).getAbsoluteFile(),
new File( props.getProperty( "settings.localRepository" ) ).getAbsoluteFile() );
}
}

View File

@ -0,0 +1,61 @@
<?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.mng3955</groupId>
<artifactId>test</artifactId>
<version>0.1</version>
<name>Maven Integration Test :: MNG-3955</name>
<description>
Test that plugin parameter expressions referring to the settings reflect the actual core state, especially
if settings have been overridden by CLI parameters.
</description>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.its.plugins</groupId>
<artifactId>maven-it-plugin-expression</artifactId>
<version>2.1-SNAPSHOT</version>
<configuration>
<outputFile>target/settings.properties</outputFile>
<expressions>
<expression>settings/localRepository</expression>
<expression>settings/offline</expression>
<expression>settings/interactiveMode</expression>
</expressions>
</configuration>
<executions>
<execution>
<id>test</id>
<phase>validate</phase>
<goals>
<goal>eval</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,26 @@
<?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.
-->
<settings>
<localRepository>mng-3955</localRepository>
<offline>false</offline>
<interactiveMode>true</interactiveMode>
</settings>