diff options
author | Olivier Lamy <olamy@apache.org> | 2013-04-22 12:46:13 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2013-04-22 12:46:13 +0000 |
commit | 97f22cd13c13ded508bb957b4fe7e206df6e6728 (patch) | |
tree | 65096ec1cffbc4cad01b0501a10661ca934a9ed6 /archiva-modules | |
parent | cd7372298d0f6fee64a92c50522bcb0144c0d722 (diff) | |
download | archiva-97f22cd13c13ded508bb957b4fe7e206df6e6728.tar.gz archiva-97f22cd13c13ded508bb957b4fe7e206df6e6728.zip |
fix issues downloading merged index path (thanks to unit tests) and add an other with non default mergedindex path
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1470481 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules')
2 files changed, 11 insertions, 4 deletions
diff --git a/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/DownloadMergedIndexTest.java b/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/DownloadMergedIndexTest.java index 68c82de07..10bbc7181 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/DownloadMergedIndexTest.java +++ b/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/DownloadMergedIndexTest.java @@ -123,8 +123,15 @@ public class DownloadMergedIndexTest RepositoryGroupService repositoryGroupService = getRepositoryGroupService(); + String repoGroupId = "test-group"; + + if ( repositoryGroupService.getRepositoryGroup( repoGroupId ) != null ) + { + repositoryGroupService.deleteRepositoryGroup( repoGroupId ); + } + RepositoryGroup repositoryGroup = new RepositoryGroup(); - repositoryGroup.setId( "test-group" ); + repositoryGroup.setId( repoGroupId ); repositoryGroup.setRepositories( Arrays.asList( id ) ); repositoryGroupService.addRepositoryGroup( repositoryGroup ); @@ -134,7 +141,7 @@ public class DownloadMergedIndexTest managedRepository = new ManagedRepository(); managedRepository.setId( id ); managedRepository.setName( "name of " + id ); - managedRepository.setLocation(System.getProperty( "basedir" ) + "/src/test/repositories/test-repo" ); + managedRepository.setLocation( System.getProperty( "basedir" ) + "/src/test/repositories/test-repo" ); managedRepository.setIndexDirectory( System.getProperty( "java.io.tmpdir" ) + "/tmpIndex/" + id ); if ( managedRepositoriesService.getManagedRepository( id ) != null ) @@ -157,7 +164,7 @@ public class DownloadMergedIndexTest ProxyConnectorService proxyConnectorService = getProxyConnectorService(); ProxyConnector proxyConnector = new ProxyConnector(); - proxyConnector.setProxyId( "foo-bar" ); + proxyConnector.setProxyId( "foo-bar1" ); proxyConnector.setSourceRepoId( id ); proxyConnector.setTargetRepoId( "all-merged" ); proxyConnectorService.addProxyConnector( proxyConnector ); diff --git a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java index 79e2d4195..954e8039c 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java @@ -446,7 +446,7 @@ public class ArchivaDavResourceFactory String rootPath = StringUtils.substringBeforeLast( pathInfo, "/" ); - if ( StringUtils.endsWith( rootPath, "/" + repoGroupConfig.getMergedIndexPath() ) ) + if ( StringUtils.endsWith( rootPath, repoGroupConfig.getMergedIndexPath() ) ) { // we are in the case of index file request String requestedFileName = StringUtils.substringAfterLast( pathInfo, "/" ); |