Author: bentmann Date: Sun Jan 4 12:27:36 2009 New Revision: 731354 URL: http://svn.apache.org/viewvc?rev=731354&view=rev Log: [MNG-3955] [regression] ${settings.localRepository} does not reflect actual repo path if maven.repo.local used
o Added IT Added: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3955EffectiveSettingsTest.java (with props) maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3955/ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3955/pom.xml (with props) maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3955/settings.xml (with props) Modified: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java Modified: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java?rev=731354&r1=731353&r2=731354&view=diff ============================================================================== --- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java (original) +++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java Sun Jan 4 12:27:36 2009 @@ -90,6 +90,7 @@ // 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 ); Added: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3955EffectiveSettingsTest.java URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3955EffectiveSettingsTest.java?rev=731354&view=auto ============================================================================== --- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3955EffectiveSettingsTest.java (added) +++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3955EffectiveSettingsTest.java Sun Jan 4 12:27:36 2009 @@ -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() ); + } + +} Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3955EffectiveSettingsTest.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3955EffectiveSettingsTest.java ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3955/pom.xml URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3955/pom.xml?rev=731354&view=auto ============================================================================== --- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3955/pom.xml (added) +++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3955/pom.xml Sun Jan 4 12:27:36 2009 @@ -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> Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3955/pom.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3955/pom.xml ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3955/settings.xml URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3955/settings.xml?rev=731354&view=auto ============================================================================== --- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3955/settings.xml (added) +++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3955/settings.xml Sun Jan 4 12:27:36 2009 @@ -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> Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3955/settings.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3955/settings.xml ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision