From 1484a3316addf47d88f4f05191ae4e570871eda7 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Mon, 2 Jul 2012 07:36:23 +0000 Subject: [MRM-1638] Improve unit test for archiva build Based on patch provided by Eric Barboni. git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1356091 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/archiva/audit/AuditManagerTest.java | 25 ++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'archiva-modules/plugins/audit/src') diff --git a/archiva-modules/plugins/audit/src/test/java/org/apache/archiva/audit/AuditManagerTest.java b/archiva-modules/plugins/audit/src/test/java/org/apache/archiva/audit/AuditManagerTest.java index 0a39c7738..19333ee14 100644 --- a/archiva-modules/plugins/audit/src/test/java/org/apache/archiva/audit/AuditManagerTest.java +++ b/archiva-modules/plugins/audit/src/test/java/org/apache/archiva/audit/AuditManagerTest.java @@ -35,7 +35,12 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.TimeZone; +import org.apache.archiva.test.ArchivaBlockJUnit4ClassRunner; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +@RunWith( ArchivaBlockJUnit4ClassRunner.class ) public class AuditManagerTest extends TestCase { @@ -69,7 +74,8 @@ public class AuditManagerTest } @Override - protected void setUp() + @Before + public void setUp() throws Exception { super.setUp(); @@ -83,7 +89,8 @@ public class AuditManagerTest repository.setId( TEST_REPO_ID ); repository.setLocation( "" ); } - + + @Test public void testGetMostRecentEvents() throws Exception { @@ -122,6 +129,7 @@ public class AuditManagerTest metadataRepositoryControl.verify(); } + @Test public void testGetMostRecentEventsLessThan10() throws Exception { @@ -159,6 +167,7 @@ public class AuditManagerTest metadataRepositoryControl.verify(); } + @Test public void testGetMostRecentEventsInterleavedRepositories() throws Exception { @@ -207,6 +216,7 @@ public class AuditManagerTest metadataRepositoryControl.verify(); } + @Test public void testGetMostRecentEventsWhenEmpty() throws Exception @@ -222,6 +232,7 @@ public class AuditManagerTest metadataRepositoryControl.verify(); } + @Test public void testAddAuditEvent() throws Exception @@ -237,6 +248,7 @@ public class AuditManagerTest metadataRepositoryControl.verify(); } + @Test public void testAddAuditEventNoRepositoryId() throws Exception { @@ -252,6 +264,7 @@ public class AuditManagerTest metadataRepositoryControl.verify(); } + @Test public void testDeleteStats() throws Exception @@ -265,6 +278,7 @@ public class AuditManagerTest metadataRepositoryControl.verify(); } + @Test public void testGetEventsRangeInside() throws Exception @@ -298,6 +312,7 @@ public class AuditManagerTest metadataRepositoryControl.verify(); } + @Test public void testGetEventsRangeUpperOutside() throws Exception { @@ -335,6 +350,7 @@ public class AuditManagerTest metadataRepositoryControl.verify(); } + @Test public void testGetEventsRangeLowerOutside() throws Exception { @@ -372,6 +388,7 @@ public class AuditManagerTest metadataRepositoryControl.verify(); } + @Test public void testGetEventsRangeLowerAndUpperOutside() throws Exception { @@ -415,6 +432,7 @@ public class AuditManagerTest metadataRepositoryControl.verify(); } + @Test public void testGetEventsWithResource() throws Exception { @@ -458,6 +476,7 @@ public class AuditManagerTest metadataRepositoryControl.verify(); } + @Test public void testGetEventsWithNonExistantResource() throws Exception { @@ -497,6 +516,7 @@ public class AuditManagerTest metadataRepositoryControl.verify(); } + @Test public void testGetEventsRangeMultipleRepositories() throws Exception { @@ -546,6 +566,7 @@ public class AuditManagerTest metadataRepositoryControl.verify(); } + @Test public void testGetEventsRangeNotInside() throws Exception { -- cgit v1.2.3