summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2012-09-22 09:09:52 +0000
committerOlivier Lamy <olamy@apache.org>2012-09-22 09:09:52 +0000
commitfe6bbb72e8b1e91aa576377c6432245156c9cd2a (patch)
tree90e1cafaac1adad4249e10e33faa0394e8a744cf
parenteaa790d7285cbca583e292a2ef89278cc3d68255 (diff)
downloadarchiva-fe6bbb72e8b1e91aa576377c6432245156c9cd2a.tar.gz
archiva-fe6bbb72e8b1e91aa576377c6432245156c9cd2a.zip
force a directory scan to prevent test failure
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1388755 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/ManagedRepositoriesServiceTest.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/ManagedRepositoriesServiceTest.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/ManagedRepositoriesServiceTest.java
index d173b8bf2..181514a1d 100644
--- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/ManagedRepositoriesServiceTest.java
+++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/ManagedRepositoriesServiceTest.java
@@ -139,9 +139,20 @@ public class ManagedRepositoriesServiceTest
assertNotNull( getUserService( authorizationHeader ).createGuestUser() );
}
+ RepositoriesService repositoriesService = getRepositoriesService( authorizationHeader );
+
createAndIndexRepo( testRepoId,
new File( System.getProperty( "basedir" ), "src/test/repo-with-osgi" ).getAbsolutePath() );
+ repositoriesService.scanRepositoryDirectoriesNow( testRepoId );
+
+ int timeout = 20000;
+ while ( timeout > 0 && repositoriesService.alreadyScanning( testRepoId ) )
+ {
+ Thread.sleep( 500 );
+ timeout -= 500;
+ }
+
ManagedRepositoriesService service = getManagedRepositoriesService( authorizationHeader );
ArchivaRepositoryStatistics archivaRepositoryStatistics =