You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by og...@apache.org on 2009/01/27 04:17:18 UTC

svn commit: r737985 - in /maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it: IntegrationTestSuite.java MavenITmng0553SettingsAuthzEncryptionTest.java

Author: ogusakov
Date: Tue Jan 27 03:17:18 2009
New Revision: 737985

URL: http://svn.apache.org/viewvc?rev=737985&view=rev
Log:
[MNG-553] added IT for testing password encryption. Encryption code is in 2.1.x trunk

Added:
    maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0553SettingsAuthzEncryptionTest.java   (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=737985&r1=737984&r2=737985&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 Jan 27 03:17:18 2009
@@ -269,6 +269,7 @@
         suite.addTestSuite( MavenITmng0674PluginParameterAliasTest.class );
         suite.addTestSuite( MavenITmng0666IgnoreLegacyPomTest.class );
         suite.addTestSuite( MavenITmng0557UserSettingsCliOptionTest.class );
+        suite.addTestSuite( MavenITmng0553SettingsAuthzEncryptionTest.class );
         suite.addTestSuite( MavenITmng0522PluginMgmtConfigTest.class );
         suite.addTestSuite( MavenITmng0507ArtifactRelocationTest.class );
         suite.addTestSuite( MavenITmng0505VersionRangeTest.class );

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0553SettingsAuthzEncryptionTest.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0553SettingsAuthzEncryptionTest.java?rev=737985&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0553SettingsAuthzEncryptionTest.java (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0553SettingsAuthzEncryptionTest.java Tue Jan 27 03:17:18 2009
@@ -0,0 +1,63 @@
+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.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+public class MavenITmng0553SettingsAuthzEncryptionTest
+    extends AbstractMavenIntegrationTestCase
+{
+    public MavenITmng0553SettingsAuthzEncryptionTest()
+    {
+        super( "(2.0.9,2.1.0-M1),(2.1.0-M1,2.1.99)" ); // 2.0.10+, excluding 2.1.0-M1
+    }
+
+    /**
+     * Test that the encrypted auth infos given in the settings.xml are decrypted.
+     */
+    public void testit0553()
+        throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0553" );
+
+        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
+        verifier.setAutoclean( false );
+        verifier.deleteDirectory( "target" );
+        List cliOptions = new ArrayList();
+        cliOptions.add( "--settings" );
+        cliOptions.add( "settings.xml" );
+        cliOptions.add( "-Dmaven.sec.path=sec.xml" );
+        verifier.setCliOptions( cliOptions );
+        verifier.executeGoal( "validate" );
+        verifier.verifyErrorFreeLog();
+        verifier.resetStreams();
+
+        Properties props = verifier.loadProperties( "target/auth.properties" );
+        assertEquals( "testuser", props.getProperty( "test.username" ) );
+        assertEquals( "testtest", props.getProperty( "test.password" ) );
+    }
+
+}

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0553SettingsAuthzEncryptionTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0553SettingsAuthzEncryptionTest.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision