diff options
3 files changed, 10 insertions, 1 deletions
diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/scheduler/repository/TestRepositoryStatisticsManager.java b/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/scheduler/repository/TestRepositoryStatisticsManager.java index ba1fb931b..950f47789 100644 --- a/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/scheduler/repository/TestRepositoryStatisticsManager.java +++ b/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/scheduler/repository/TestRepositoryStatisticsManager.java @@ -54,6 +54,7 @@ public class TestRepositoryStatisticsManager repositoryStatistics.setScanEndTime( endTime ); repositoryStatistics.setNewFileCount( newFiles ); repositoryStatistics.setTotalFileCount( totalFiles ); + repositoryStatistics.setRepositoryId( repositoryId ); stats.add( repositoryStatistics ); } diff --git a/archiva-modules/plugins/repository-statistics/src/test/java/org/apache/archiva/metadata/repository/stats/JcrRepositoryStatisticsGatheringTest.java b/archiva-modules/plugins/repository-statistics/src/test/java/org/apache/archiva/metadata/repository/stats/JcrRepositoryStatisticsGatheringTest.java index 5babb1625..189e2cf20 100644 --- a/archiva-modules/plugins/repository-statistics/src/test/java/org/apache/archiva/metadata/repository/stats/JcrRepositoryStatisticsGatheringTest.java +++ b/archiva-modules/plugins/repository-statistics/src/test/java/org/apache/archiva/metadata/repository/stats/JcrRepositoryStatisticsGatheringTest.java @@ -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 ); } diff --git a/archiva-modules/plugins/repository-statistics/src/test/java/org/apache/archiva/metadata/repository/stats/RepositoryStatisticsManagerTest.java b/archiva-modules/plugins/repository-statistics/src/test/java/org/apache/archiva/metadata/repository/stats/RepositoryStatisticsManagerTest.java index 18760d262..1367562a6 100644 --- a/archiva-modules/plugins/repository-statistics/src/test/java/org/apache/archiva/metadata/repository/stats/RepositoryStatisticsManagerTest.java +++ b/archiva-modules/plugins/repository-statistics/src/test/java/org/apache/archiva/metadata/repository/stats/RepositoryStatisticsManagerTest.java @@ -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 ); |