[MNG-553] added IT for testing password encryption. Encryption code is in 2.1.x trunk

git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@737985 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Oleg Gusakov 2009-01-27 03:17:18 +00:00
parent 53593bae23
commit 752d0c13a5
2 changed files with 64 additions and 0 deletions

View File

@ -269,6 +269,7 @@ public class IntegrationTestSuite
suite.addTestSuite( MavenITmng0674PluginParameterAliasTest.class ); suite.addTestSuite( MavenITmng0674PluginParameterAliasTest.class );
suite.addTestSuite( MavenITmng0666IgnoreLegacyPomTest.class ); suite.addTestSuite( MavenITmng0666IgnoreLegacyPomTest.class );
suite.addTestSuite( MavenITmng0557UserSettingsCliOptionTest.class ); suite.addTestSuite( MavenITmng0557UserSettingsCliOptionTest.class );
suite.addTestSuite( MavenITmng0553SettingsAuthzEncryptionTest.class );
suite.addTestSuite( MavenITmng0522PluginMgmtConfigTest.class ); suite.addTestSuite( MavenITmng0522PluginMgmtConfigTest.class );
suite.addTestSuite( MavenITmng0507ArtifactRelocationTest.class ); suite.addTestSuite( MavenITmng0507ArtifactRelocationTest.class );
suite.addTestSuite( MavenITmng0505VersionRangeTest.class ); suite.addTestSuite( MavenITmng0505VersionRangeTest.class );

View File

@ -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" ) );
}
}