You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by be...@apache.org on 2009/10/27 15:31:24 UTC
svn commit: r830203 - in
/maven/core-integration-testing/trunk/core-it-suite/src/test:
java/org/apache/maven/it/ resources/mng-4408/
Author: bentmann
Date: Tue Oct 27 14:31:24 2009
New Revision: 830203
URL: http://svn.apache.org/viewvc?rev=830203&view=rev
Log:
[MNG-4408] Missing settings.xml is silently ignores
o Added IT
Added:
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4408NonExistentSettingsFileTest.java (with props)
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4408/
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4408/pom.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=830203&r1=830202&r2=830203&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 Tue Oct 27 14:31:24 2009
@@ -87,6 +87,7 @@
suite.addTestSuite( MavenITmng4411VersionInfoTest.class );
suite.addTestSuite( MavenITmng4410UsageHelpTest.class );
+ suite.addTestSuite( MavenITmng4408NonExistentSettingsFileTest.class );
suite.addTestSuite( MavenITmng4405ValidPluginVersionTest.class );
suite.addTestSuite( MavenITmng4404UniqueProfileIdTest.class );
suite.addTestSuite( MavenITmng4403LenientDependencyPomParsingTest.class );
Added: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4408NonExistentSettingsFileTest.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4408NonExistentSettingsFileTest.java?rev=830203&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4408NonExistentSettingsFileTest.java (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4408NonExistentSettingsFileTest.java Tue Oct 27 14:31:24 2009
@@ -0,0 +1,100 @@
+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.List;
+
+/**
+ * This is a test set for <a href="http://jira.codehaus.org/browse/MNG-4408">MNG-4408</a>.
+ *
+ * @author Benjamin Bentmann
+ */
+public class MavenITmng4408NonExistentSettingsFileTest
+ extends AbstractMavenIntegrationTestCase
+{
+
+ public MavenITmng4408NonExistentSettingsFileTest()
+ {
+ super( "[3.0-alpha-3,)" );
+ }
+
+ /**
+ * Verify that the build fails when the user specifies a non-existing user settings file on the CLI.
+ */
+ public void testitUserSettings()
+ throws Exception
+ {
+ File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4408" );
+
+ Verifier verifier = new Verifier( testDir.getAbsolutePath() );
+ verifier.setAutoclean( false );
+ verifier.setLogFileName( "log-user.txt" );
+ verifier.getCliOptions().add( "--settings" );
+ verifier.getCliOptions().add( "non-existing-settings.xml" );
+ try
+ {
+ verifier.executeGoal( "validate" );
+ verifier.verifyErrorFreeLog();
+ fail( "Missing settings file did not cause build error" );
+ }
+ catch ( VerificationException e )
+ {
+ // expected
+ }
+ finally
+ {
+ verifier.resetStreams();
+ }
+ }
+
+ /**
+ * Verify that the build fails when the user specifies a non-existing global settings file on the CLI.
+ */
+ public void testitGlobalSettings()
+ throws Exception
+ {
+ File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4408" );
+
+ Verifier verifier = new Verifier( testDir.getAbsolutePath() );
+ verifier.setAutoclean( false );
+ verifier.setLogFileName( "log-global.txt" );
+ verifier.getCliOptions().add( "--global-settings" );
+ verifier.getCliOptions().add( "non-existing-settings.xml" );
+ try
+ {
+ verifier.executeGoal( "validate" );
+ verifier.verifyErrorFreeLog();
+ fail( "Missing settings file did not cause build error" );
+ }
+ catch ( VerificationException e )
+ {
+ // expected
+ }
+ finally
+ {
+ verifier.resetStreams();
+ }
+ }
+
+}
Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4408NonExistentSettingsFileTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4408NonExistentSettingsFileTest.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4408/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4408/pom.xml?rev=830203&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4408/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4408/pom.xml Tue Oct 27 14:31:24 2009
@@ -0,0 +1,34 @@
+<?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.mng4408</groupId>
+ <artifactId>test</artifactId>
+ <version>0.1</version>
+ <packaging>jar</packaging>
+
+ <name>Maven Integration Test :: MNG-4408</name>
+ <description>
+ Verify that the build fails when the user specifies a non-existing global/user settings file on the CLI.
+ </description>
+</project>
Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4408/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4408/pom.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision