From 098ffbc90a466752f64f5d8bca1300d81550c6f6 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Thu, 17 Nov 2011 21:01:33 +0000 Subject: [PATCH] make repository as a variable to be able to use an other on for testing git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1203363 13f79535-47bb-0310-9956-ffa450edef68 --- .../rest/services/SearchServiceTest.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/SearchServiceTest.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/SearchServiceTest.java index 11d461279..4b60ed0ae 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/SearchServiceTest.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/SearchServiceTest.java @@ -52,7 +52,7 @@ public class SearchServiceTest assertNotNull( getUserService( authorizationHeader ).createGuestUser() ); } - createAndIndexRepo( testRepoId ); + createAndIndexRepo( testRepoId, "src/test/repo-with-osgi" ); SearchService searchService = getSearchService( authorizationHeader ); @@ -82,7 +82,7 @@ public class SearchServiceTest assertNotNull( getUserService( authorizationHeader ).createGuestUser() ); } - createAndIndexRepo( testRepoId ); + createAndIndexRepo( testRepoId, "src/test/repo-with-osgi" ); // START SNIPPET: searchservice-artifact-versions SearchService searchService = getSearchService( authorizationHeader ); @@ -111,7 +111,7 @@ public class SearchServiceTest assertNotNull( getUserService( authorizationHeader ).createGuestUser() ); } - createAndIndexRepo( testRepoId ); + createAndIndexRepo( testRepoId, "src/test/repo-with-osgi" ); SearchService searchService = getSearchService( authorizationHeader ); @@ -144,7 +144,7 @@ public class SearchServiceTest assertNotNull( getUserService( authorizationHeader ).createGuestUser() ); } - createAndIndexRepo( testRepoId ); + createAndIndexRepo( testRepoId, "src/test/repo-with-osgi" ); SearchService searchService = getSearchService( authorizationHeader ); @@ -175,7 +175,7 @@ public class SearchServiceTest assertNotNull( getUserService( authorizationHeader ).createGuestUser() ); } - createAndIndexRepo( testRepoId ); + createAndIndexRepo( testRepoId, "src/test/repo-with-osgi" ); SearchService searchService = getSearchService( authorizationHeader ); @@ -204,7 +204,7 @@ public class SearchServiceTest assertNotNull( getUserService( authorizationHeader ).createGuestUser() ); } - createAndIndexRepo( testRepoId ); + createAndIndexRepo( testRepoId, "src/test/repo-with-osgi" ); SearchService searchService = getSearchService( authorizationHeader ); @@ -237,7 +237,7 @@ public class SearchServiceTest assertNotNull( getUserService( authorizationHeader ).createGuestUser() ); } - createAndIndexRepo( testRepoId ); + createAndIndexRepo( testRepoId, "src/test/repo-with-osgi" ); SearchService searchService = getSearchService( authorizationHeader ); @@ -269,7 +269,7 @@ public class SearchServiceTest assertNotNull( getUserService( authorizationHeader ).createGuestUser() ); } - createAndIndexRepo( testRepoId ); + createAndIndexRepo( testRepoId, "src/test/repo-with-osgi" ); SearchService searchService = getSearchService( authorizationHeader ); @@ -298,7 +298,7 @@ public class SearchServiceTest assertNotNull( getUserService( authorizationHeader ).createGuestUser() ); } - createAndIndexRepo( testRepoId ); + createAndIndexRepo( testRepoId, "src/test/repo-with-osgi" ); SearchService searchService = getSearchService( authorizationHeader ); @@ -310,7 +310,7 @@ public class SearchServiceTest deleteTestRepo( testRepoId ); } - private void createAndIndexRepo( String testRepoId ) + private void createAndIndexRepo( String testRepoId, String repoPath ) throws Exception { if ( getManagedRepositoriesService( authorizationHeader ).getManagedRepository( testRepoId ) != null ) @@ -329,7 +329,7 @@ public class SearchServiceTest managedRepository.setId( testRepoId ); managedRepository.setName( "test repo" ); - managedRepository.setLocation( new File( "src/test/repo-with-osgi" ).getPath() ); + managedRepository.setLocation( new File( repoPath ).getPath() ); managedRepository.setIndexDirectory( "target/.index-" + Long.toString( new Date().getTime() ) ); ManagedRepositoriesService service = getManagedRepositoriesService( authorizationHeader );