[MRM-546] re-enable tests that are passing

git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@587070 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Porter 2007-10-22 12:36:50 +00:00
parent d2ceac7b0b
commit 858f0283d1
1 changed files with 23 additions and 33 deletions

View File

@ -20,9 +20,9 @@ package org.apache.maven.archiva.configuration;
*/
import org.codehaus.plexus.PlexusTestCase;
import org.codehaus.plexus.registry.Registry;
import org.codehaus.plexus.registry.RegistryException;
import org.codehaus.plexus.util.FileUtils;
import org.custommonkey.xmlunit.XMLAssert;
import org.easymock.MockControl;
import java.io.File;
@ -37,17 +37,6 @@ import java.util.Map;
public class ArchivaConfigurationTest
extends PlexusTestCase
{
@SuppressWarnings("unused")
private Registry registry;
protected void setUp()
throws Exception
{
super.setUp();
registry = (Registry) lookup( Registry.ROLE, "commons-configuration" );
}
public void testGetConfigurationFromRegistryWithASingleNamedConfigurationResource()
throws Exception
{
@ -220,8 +209,7 @@ public class ArchivaConfigurationTest
private static MockControl createConfigurationListenerMockControl()
{
MockControl control = MockControl.createControl( ConfigurationListener.class );
return control;
return MockControl.createControl( ConfigurationListener.class );
}
public void testStoreConfigurationUser()
@ -458,10 +446,11 @@ public class ArchivaConfigurationTest
}
}
public void testLoadConfigurationFromInvalidBothLocationsOnDisk() throws Exception
public void testLoadConfigurationFromInvalidBothLocationsOnDisk()
throws Exception
{
ArchivaConfiguration archivaConfiguration = (ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(),
"test-not-allowed-to-write-to-both" );
ArchivaConfiguration archivaConfiguration =
(ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-not-allowed-to-write-to-both" );
Configuration config = archivaConfiguration.getConfiguration();
try
@ -475,13 +464,14 @@ public class ArchivaConfigurationTest
}
}
public void testLoadConfigurationFromInvalidUserLocationOnDisk() throws Exception
public void testLoadConfigurationFromInvalidUserLocationOnDisk()
throws Exception
{
File testConfDir = getTestFile( "target/test-appserver-base/conf/" );
testConfDir.mkdirs();
ArchivaConfiguration archivaConfiguration = (ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(),
"test-not-allowed-to-write-to-user" );
ArchivaConfiguration archivaConfiguration =
(ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-not-allowed-to-write-to-user" );
Configuration config = archivaConfiguration.getConfiguration();
archivaConfiguration.save( config );
// No Exception == test passes.
@ -553,6 +543,7 @@ public class ArchivaConfigurationTest
// Reload.
archivaConfiguration =
(ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-autodetect-v1" );
configuration = archivaConfiguration.getConfiguration();
// Test that only 1 set of repositories exist.
assertEquals( "check managed repositories size.", 2, configuration.getManagedRepositories().size() );
@ -561,11 +552,9 @@ public class ArchivaConfigurationTest
assertEquals( "check remote repositories size.", 2, configuration.getRemoteRepositoriesAsMap().size() );
assertEquals( "check v1 repositories size.", 0, configuration.getRepositories().size() );
/* FIXME: can't get rid of old v1 <repositories> section programatically.
String actualXML = FileUtils.fileRead( userFile );
XMLAssert.assertXpathNotExists( "//configuration/repositories/repository", actualXML );
XMLAssert.assertXpathNotExists( "//configuration/repositories", actualXML );
*/
}
public void testArchivaV1()
@ -579,6 +568,7 @@ public class ArchivaConfigurationTest
assertEquals( "check network proxies", 1, configuration.getNetworkProxies().size() );
assertEquals( "check managed repositories", 2, configuration.getManagedRepositories().size() );
assertEquals( "check v1 repositories size.", 0, configuration.getRepositories().size() );
Map<String, ManagedRepositoryConfiguration> map = configuration.getManagedRepositoriesAsMap();