aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2012-07-06 14:00:00 +0000
committerOlivier Lamy <olamy@apache.org>2012-07-06 14:00:00 +0000
commit968ab1e0348b14878b1e44c1da9bd7fc5d514aad (patch)
tree9b10c175eeb54ce7e465c1db963600fc721a23b9
parentdbe5a525d6172c0669c4b5e6d3b3b9f50ed4b9dd (diff)
downloadarchiva-968ab1e0348b14878b1e44c1da9bd7fc5d514aad.tar.gz
archiva-968ab1e0348b14878b1e44c1da9bd7fc5d514aad.zip
[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
-rw-r--r--archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/scheduler/repository/TestRepositoryStatisticsManager.java1
-rw-r--r--archiva-modules/plugins/repository-statistics/src/test/java/org/apache/archiva/metadata/repository/stats/JcrRepositoryStatisticsGatheringTest.java9
-rw-r--r--archiva-modules/plugins/repository-statistics/src/test/java/org/apache/archiva/metadata/repository/stats/RepositoryStatisticsManagerTest.java1
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 );