diff options
author | Joakim Erdfelt <joakime@apache.org> | 2007-10-11 00:32:22 +0000 |
---|---|---|
committer | Joakim Erdfelt <joakime@apache.org> | 2007-10-11 00:32:22 +0000 |
commit | 46c2f650b344d06f813d1370ca4e5d702a4c75ee (patch) | |
tree | 18a34e334430bf5fad833f8f8e52aa4f436ddd6d /archiva-web | |
parent | 9aa41ce31bdb3161d0a60482e0a7148e57b74056 (diff) | |
download | archiva-46c2f650b344d06f813d1370ca4e5d702a4c75ee.tar.gz archiva-46c2f650b344d06f813d1370ca4e5d702a4c75ee.zip |
Fixing test case NPE wrt repo.location.
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@583652 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-web')
2 files changed, 7 insertions, 1 deletions
diff --git a/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/RepositoryServlet.java b/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/RepositoryServlet.java index 3ea6931b2..28856ef6f 100644 --- a/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/RepositoryServlet.java +++ b/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/RepositoryServlet.java @@ -111,7 +111,7 @@ public class RepositoryServlet { if ( repositoryMap.isEmpty() ) { - repositoryMap = configuration.getConfiguration().getManagedRepositoriesAsMap(); + repositoryMap.putAll( configuration.getConfiguration().getManagedRepositoriesAsMap() ); } return repositoryMap.get( prefix ); } diff --git a/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/repository/RepositoryServletTest.java b/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/repository/RepositoryServletTest.java index b9613f9ed..604e2b432 100644 --- a/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/repository/RepositoryServletTest.java +++ b/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/repository/RepositoryServletTest.java @@ -124,6 +124,12 @@ public class RepositoryServletTest ManagedRepositoryConfiguration repo = new ManagedRepositoryConfiguration(); repo.setId( NEW_REPOSITORY_ID ); repo.setName( NEW_REPOSITORY_NAME ); + File repoRoot = new File( getBasedir(), "target/test-repository-root" ); + if ( !repoRoot.exists() ) + { + repoRoot.mkdirs(); + } + repo.setLocation( repoRoot.getAbsolutePath() ); c.addManagedRepository( repo ); // TODO it would be better to use a mock configuration and "save" to more accurately reflect the calls made servlet.configurationEvent( new ConfigurationEvent( ConfigurationEvent.SAVED) ); |