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
This commit is contained in:
Olivier Lamy 2012-09-22 09:09:52 +00:00
parent eaa790d728
commit fe6bbb72e8
1 changed files with 11 additions and 0 deletions

View File

@ -139,9 +139,20 @@ public class ManagedRepositoriesServiceTest
assertNotNull( getUserService( authorizationHeader ).createGuestUser() ); assertNotNull( getUserService( authorizationHeader ).createGuestUser() );
} }
RepositoriesService repositoriesService = getRepositoriesService( authorizationHeader );
createAndIndexRepo( testRepoId, createAndIndexRepo( testRepoId,
new File( System.getProperty( "basedir" ), "src/test/repo-with-osgi" ).getAbsolutePath() ); 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 ); ManagedRepositoriesService service = getManagedRepositoriesService( authorizationHeader );
ArchivaRepositoryStatistics archivaRepositoryStatistics = ArchivaRepositoryStatistics archivaRepositoryStatistics =