mirror of https://github.com/apache/archiva.git
[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:
parent
dbe5a525d6
commit
968ab1e034
|
@ -54,6 +54,7 @@ public class TestRepositoryStatisticsManager
|
|||
repositoryStatistics.setScanEndTime( endTime );
|
||||
repositoryStatistics.setNewFileCount( newFiles );
|
||||
repositoryStatistics.setTotalFileCount( totalFiles );
|
||||
repositoryStatistics.setRepositoryId( repositoryId );
|
||||
|
||||
stats.add( repositoryStatistics );
|
||||
}
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
|
|
|
@ -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 );
|
||||
|
|
Loading…
Reference in New Issue