mirror of https://github.com/apache/archiva.git
wait end of first scan before deleting repo should prevent test failure
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1243016 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0182f1892b
commit
c8e8d8f95b
|
@ -50,6 +50,15 @@ public class ManagedRepositoriesServiceTest
|
|||
service.addManagedRepository( repo );
|
||||
assertNotNull( service.getManagedRepository( repo.getId() ) );
|
||||
|
||||
RepositoriesService repositoriesService = getRepositoriesService( authorizationHeader );
|
||||
|
||||
int timeout = 20000;
|
||||
while ( timeout > 0 && repositoriesService.alreadyScanning( repo.getId() ) )
|
||||
{
|
||||
Thread.sleep( 500 );
|
||||
timeout -= 500;
|
||||
}
|
||||
|
||||
service.deleteManagedRepository( repo.getId(), true );
|
||||
assertNull( service.getManagedRepository( repo.getId() ) );
|
||||
}
|
||||
|
@ -67,6 +76,16 @@ public class ManagedRepositoriesServiceTest
|
|||
assertNull( service.getManagedRepository( repo.getId() ) );
|
||||
}
|
||||
service.addManagedRepository( repo );
|
||||
|
||||
RepositoriesService repositoriesService = getRepositoriesService( authorizationHeader );
|
||||
|
||||
int timeout = 20000;
|
||||
while ( timeout > 0 && repositoriesService.alreadyScanning( repo.getId() ) )
|
||||
{
|
||||
Thread.sleep( 500 );
|
||||
timeout -= 500;
|
||||
}
|
||||
|
||||
repo = service.getManagedRepository( repo.getId() );
|
||||
assertNotNull( repo );
|
||||
assertEquals( "test", repo.getName() );
|
||||
|
@ -79,6 +98,13 @@ public class ManagedRepositoriesServiceTest
|
|||
assertNotNull( repo );
|
||||
assertEquals( "toto", repo.getName() );
|
||||
|
||||
timeout = 20000;
|
||||
while ( timeout > 0 && repositoriesService.alreadyScanning( repo.getId() ) )
|
||||
{
|
||||
Thread.sleep( 500 );
|
||||
timeout -= 500;
|
||||
}
|
||||
|
||||
service.deleteManagedRepository( repo.getId(), true );
|
||||
assertNull( service.getManagedRepository( repo.getId() ) );
|
||||
|
||||
|
|
Loading…
Reference in New Issue