[MRM-1583] tests modifications

Submitted by Adrien Lecharpentier

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1358215 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2012-07-06 14:00:00 +00:00
parent dbe5a525d6
commit 968ab1e034
3 changed files with 10 additions and 1 deletions

View File

@ -54,6 +54,7 @@ public class TestRepositoryStatisticsManager
repositoryStatistics.setScanEndTime( endTime );
repositoryStatistics.setNewFileCount( newFiles );
repositoryStatistics.setTotalFileCount( totalFiles );
repositoryStatistics.setRepositoryId( repositoryId );
stats.add( repositoryStatistics );
}

View File

@ -73,6 +73,9 @@ public class JcrRepositoryStatisticsGatheringTest
File dir = new File( "target/jcr" );
FileUtils.deleteDirectory( dir );
assertTrue( confFile.exists() );
assertFalse( dir.exists() );
TransientRepository repository = new TransientRepository( confFile, dir );
session = repository.login( new SimpleCredentials( "username", "password".toCharArray() ) );
@ -110,7 +113,10 @@ public class JcrRepositoryStatisticsGatheringTest
public void tearDown()
throws Exception
{
session.logout();
if ( session != null )
{
session.logout();
}
super.tearDown();
}
@ -146,6 +152,7 @@ public class JcrRepositoryStatisticsGatheringTest
expectedStatistics.setTotalCountForType( "xml", 3 );
expectedStatistics.setTotalCountForType( "war", 2 );
expectedStatistics.setTotalCountForType( "pom", 144 );
expectedStatistics.setRepositoryId( TEST_REPO );
verify( metadataRepository ).addMetadataFacet( TEST_REPO, expectedStatistics );
}

View File

@ -502,6 +502,7 @@ public class RepositoryStatisticsManagerTest
private RepositoryStatistics createTestStats( Date startTime, Date endTime )
{
RepositoryStatistics stats = new RepositoryStatistics();
stats.setRepositoryId( TEST_REPO_ID );
stats.setScanStartTime( startTime );
stats.setScanEndTime( endTime );
stats.setTotalArtifactFileSize( 20 * 12345L );