aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules/plugins/repository-statistics/src
diff options
context:
space:
mode:
Diffstat (limited to 'archiva-modules/plugins/repository-statistics/src')
-rw-r--r--archiva-modules/plugins/repository-statistics/src/test/java/org/apache/archiva/metadata/repository/stats/JcrRepositoryStatisticsGatheringTest.java14
-rw-r--r--archiva-modules/plugins/repository-statistics/src/test/java/org/apache/archiva/metadata/repository/stats/RepositoryStatisticsManagerTest.java18
2 files changed, 28 insertions, 4 deletions
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 b8105daec..9e51faeb9 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
@@ -39,9 +39,14 @@ import java.io.IOException;
import java.util.Calendar;
import java.util.Date;
import java.util.zip.GZIPInputStream;
+import org.apache.archiva.test.ArchivaBlockJUnit4ClassRunner;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
import static org.mockito.Mockito.*;
-
+@RunWith( ArchivaBlockJUnit4ClassRunner.class )
public class JcrRepositoryStatisticsGatheringTest
extends TestCase
{
@@ -58,7 +63,8 @@ public class JcrRepositoryStatisticsGatheringTest
private Session session;
@Override
- protected void setUp()
+ @Before
+ public void setUp()
throws Exception
{
super.setUp();
@@ -100,7 +106,8 @@ public class JcrRepositoryStatisticsGatheringTest
}
@Override
- protected void tearDown()
+ @After
+ public void tearDown()
throws Exception
{
session.logout();
@@ -108,6 +115,7 @@ public class JcrRepositoryStatisticsGatheringTest
super.tearDown();
}
+ @Test
public void testJcrStatisticsQuery()
throws Exception
{
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 b7e4fae0d..31903a6ca 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
@@ -35,7 +35,12 @@ import java.util.List;
import java.util.Map;
import java.util.TimeZone;
import javax.jcr.Session;
+import org.apache.archiva.test.ArchivaBlockJUnit4ClassRunner;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+@RunWith( ArchivaBlockJUnit4ClassRunner.class )
public class RepositoryStatisticsManagerTest
extends TestCase
{
@@ -63,7 +68,8 @@ public class RepositoryStatisticsManagerTest
}
@Override
- protected void setUp()
+ @Before
+ public void setUp()
throws Exception
{
super.setUp();
@@ -74,6 +80,7 @@ public class RepositoryStatisticsManagerTest
metadataRepository = (MetadataRepository) metadataRepositoryControl.getMock();
}
+ @Test
public void testGetLatestStats()
throws Exception
{
@@ -113,6 +120,7 @@ public class RepositoryStatisticsManagerTest
metadataRepositoryControl.verify();
}
+ @Test
public void testGetLatestStatsWhenEmpty()
throws Exception
{
@@ -127,6 +135,7 @@ public class RepositoryStatisticsManagerTest
metadataRepositoryControl.verify();
}
+ @Test
public void testAddNewStats()
throws Exception
{
@@ -165,6 +174,7 @@ public class RepositoryStatisticsManagerTest
metadataRepositoryControl.verify();
}
+ @Test
public void testDeleteStats()
throws Exception
{
@@ -210,6 +220,7 @@ public class RepositoryStatisticsManagerTest
metadataRepositoryControl.verify();
}
+ @Test
public void testDeleteStatsWhenEmpty()
throws Exception
{
@@ -229,6 +240,7 @@ public class RepositoryStatisticsManagerTest
metadataRepositoryControl.verify();
}
+ @Test
public void testGetStatsRangeInside()
throws Exception
{
@@ -272,6 +284,7 @@ public class RepositoryStatisticsManagerTest
metadataRepositoryControl.verify();
}
+ @Test
public void testGetStatsRangeUpperOutside()
throws Exception
{
@@ -320,6 +333,7 @@ public class RepositoryStatisticsManagerTest
metadataRepositoryControl.verify();
}
+ @Test
public void testGetStatsRangeLowerOutside()
throws Exception
{
@@ -368,6 +382,7 @@ public class RepositoryStatisticsManagerTest
metadataRepositoryControl.verify();
}
+ @Test
public void testGetStatsRangeLowerAndUpperOutside()
throws Exception
{
@@ -422,6 +437,7 @@ public class RepositoryStatisticsManagerTest
metadataRepositoryControl.verify();
}
+ @Test
public void testGetStatsRangeNotInside()
throws Exception
{