From af94415b0e46ce0dda775b45b414f61044e319f6 Mon Sep 17 00:00:00 2001 From: Brett Porter Date: Fri, 3 Aug 2007 07:36:53 +0000 Subject: [PATCH] [MRM-347] prevent creating /${appserver.home} directory which is not populated under the appserver for some reason. The base directory is the appropriate location for data anyway - so these are the values that should have been used. git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@562369 13f79535-47bb-0310-9956-ffa450edef68 --- .../archiva/configuration/default-archiva.xml | 8 ++--- .../src/test/conf/repository-manager.xml | 8 ++--- .../ArchivaConfigurationTest.java | 34 ++++++++++++------- 3 files changed, 29 insertions(+), 21 deletions(-) diff --git a/archiva-base/archiva-configuration/src/main/resources/org/apache/maven/archiva/configuration/default-archiva.xml b/archiva-base/archiva-configuration/src/main/resources/org/apache/maven/archiva/configuration/default-archiva.xml index 99308d4d3..d4b17fc3e 100644 --- a/archiva-base/archiva-configuration/src/main/resources/org/apache/maven/archiva/configuration/default-archiva.xml +++ b/archiva-base/archiva-configuration/src/main/resources/org/apache/maven/archiva/configuration/default-archiva.xml @@ -5,7 +5,7 @@ internal Archiva Managed Internal Repository - file://${appserver.home}/repositories/internal + file://${appserver.base}/repositories/internal default true false @@ -15,7 +15,7 @@ snapshots Archiva Managed Snapshot Repository - file://${appserver.home}/repositories/snapshots + file://${appserver.base}/repositories/snapshots default false true @@ -46,7 +46,7 @@ internal central - + disabled once @@ -60,7 +60,7 @@ internal maven2-repository.dev.java.net - + disabled once diff --git a/archiva-base/archiva-configuration/src/test/conf/repository-manager.xml b/archiva-base/archiva-configuration/src/test/conf/repository-manager.xml index 5cb654aec..5f35f5d37 100644 --- a/archiva-base/archiva-configuration/src/test/conf/repository-manager.xml +++ b/archiva-base/archiva-configuration/src/test/conf/repository-manager.xml @@ -23,7 +23,7 @@ internal Archiva Managed Internal Repository - file://${appserver.home}/repositories/internal + file://${appserver.base}/repositories/internal default true false @@ -33,7 +33,7 @@ snapshots Archiva Managed Snapshot Repository - file://${appserver.home}/repositories/internal + file://${appserver.base}/repositories/internal default false true @@ -64,7 +64,7 @@ internal central - + disabled never not-found @@ -72,7 +72,7 @@ internal maven2-repository.dev.java.net - + disabled never not-found diff --git a/archiva-base/archiva-configuration/src/test/java/org/apache/maven/archiva/configuration/ArchivaConfigurationTest.java b/archiva-base/archiva-configuration/src/test/java/org/apache/maven/archiva/configuration/ArchivaConfigurationTest.java index 968166745..21aaf1b59 100644 --- a/archiva-base/archiva-configuration/src/test/java/org/apache/maven/archiva/configuration/ArchivaConfigurationTest.java +++ b/archiva-base/archiva-configuration/src/test/java/org/apache/maven/archiva/configuration/ArchivaConfigurationTest.java @@ -30,13 +30,15 @@ import java.util.List; * * @author Brett Porter */ -public class ArchivaConfigurationTest extends PlexusTestCase +public class ArchivaConfigurationTest + extends PlexusTestCase { - public void testDefaults() throws Exception + public void testDefaults() + throws Exception { ArchivaConfiguration archivaConfiguration = (ArchivaConfiguration) lookup( ArchivaConfiguration.class, "test-defaults" ); - + Configuration configuration = archivaConfiguration.getConfiguration(); // check default configuration @@ -44,7 +46,8 @@ public class ArchivaConfigurationTest extends PlexusTestCase assertTrue( "check configuration has default elements", configuration.getRepositories().isEmpty() ); } - public void testGetConfiguration() throws Exception + public void testGetConfiguration() + throws Exception { ArchivaConfiguration archivaConfiguration = (ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-configuration" ); @@ -75,23 +78,24 @@ public class ArchivaConfigurationTest extends PlexusTestCase RepositoryConfiguration repository = (RepositoryConfiguration) configuration.getRepositories().iterator().next(); - assertEquals( "check managed repositories", "file://${appserver.home}/repositories/internal", + assertEquals( "check managed repositories", "file://${appserver.base}/repositories/internal", repository.getUrl() ); assertEquals( "check managed repositories", "Archiva Managed Internal Repository", repository.getName() ); assertEquals( "check managed repositories", "internal", repository.getId() ); assertEquals( "check managed repositories", "default", repository.getLayout() ); assertTrue( "check managed repositories", repository.isIndexed() ); - + WebappConfiguration webapp = (WebappConfiguration) configuration.getWebapp(); assertNotNull( "check webapp", webapp ); - + UserInterfaceOptions ui = (UserInterfaceOptions) webapp.getUi(); - assertNotNull( "check webapp ui", ui ); + assertNotNull( "check webapp ui", ui ); assertTrue( "check showFindArtifacts", ui.isShowFindArtifacts() ); assertTrue( "check appletFindEnabled", ui.isAppletFindEnabled() ); } - public void testGetConfigurationSystemOverride() throws Exception + public void testGetConfigurationSystemOverride() + throws Exception { ArchivaConfiguration archivaConfiguration = (ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-configuration" ); @@ -104,7 +108,8 @@ public class ArchivaConfigurationTest extends PlexusTestCase // assertEquals( "check indexPath", ".index", configuration.getIndexPath() ); } - public void testStoreConfiguration() throws Exception + public void testStoreConfiguration() + throws Exception { File file = getTestFile( "target/test/test-file.xml" ); file.delete(); @@ -134,7 +139,8 @@ public class ArchivaConfigurationTest extends PlexusTestCase // assertEquals( "check value", "index-path", configuration.getIndexPath() ); } - public void testStoreConfigurationUser() throws Exception + public void testStoreConfigurationUser() + throws Exception { File baseFile = getTestFile( "target/test/test-file.xml" ); baseFile.delete(); @@ -164,7 +170,8 @@ public class ArchivaConfigurationTest extends PlexusTestCase // assertEquals( "check value", "index-path", configuration.getIndexPath() ); } - public void testStoreConfigurationFallback() throws Exception + public void testStoreConfigurationFallback() + throws Exception { File baseFile = getTestFile( "target/test/test-file.xml" ); baseFile.delete(); @@ -194,7 +201,8 @@ public class ArchivaConfigurationTest extends PlexusTestCase // assertEquals( "check value", "index-path", configuration.getIndexPath() ); } - public void testRemoveProxiedRepositoryAndStoreConfiguration() throws Exception + public void testRemoveProxiedRepositoryAndStoreConfiguration() + throws Exception { // MRM-300