diff options
author | Brett Porter <brett@apache.org> | 2010-02-16 06:17:00 +0000 |
---|---|---|
committer | Brett Porter <brett@apache.org> | 2010-02-16 06:17:00 +0000 |
commit | 38c8d861ea0bca7a36aa5b5fc615952b524c2f79 (patch) | |
tree | e59b2ce6a76228b82436d1610a7f4be3b2a3b703 /archiva-modules/plugins/audit | |
parent | 0db94985225bc67f7d80f5708b10e58d7e17efbb (diff) | |
download | archiva-38c8d861ea0bca7a36aa5b5fc615952b524c2f79.tar.gz archiva-38c8d861ea0bca7a36aa5b5fc615952b524c2f79.zip |
revert r910400, look for a simpler solution and unit test
git-svn-id: https://svn.apache.org/repos/asf/archiva/branches/MRM-1025@910410 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/plugins/audit')
-rw-r--r-- | archiva-modules/plugins/audit/src/test/java/org/apache/archiva/audit/AuditManagerTest.java | 11 |
1 files changed, 5 insertions, 6 deletions
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 28c62456a..2bb3399a8 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 @@ -138,16 +138,16 @@ public class AuditManagerTest return createTestEvent( TEST_REPO_ID, name ); } - private static AuditEvent createTestEvent( String repositoryId, String t ) + private static AuditEvent createTestEvent( String repositoryId, String name ) throws ParseException { AuditEvent event = new AuditEvent(); - event.setTimestamp( TIMESTAMP_FORMAT.parse( AUDIT_EVENT_BASE + t ) ); + event.setTimestamp( TIMESTAMP_FORMAT.parse( name ) ); event.setAction( AuditEvent.UPLOAD_FILE ); event.setRemoteIP( TEST_IP_ADDRESS ); event.setRepositoryId( repositoryId ); event.setUserId( TEST_USER ); - event.setResource( TEST_RESOURCE_BASE + "/" + t ); + event.setResource( TEST_RESOURCE_BASE + "/" + name.substring( AUDIT_EVENT_BASE.length() ) ); return event; } @@ -197,11 +197,10 @@ public class AuditManagerTest eventNames.put( TEST_REPO_ID_2, new ArrayList<String>() ); for ( int i = 0; i < numEvents; i++ ) { - String t = MILLIS_FORMAT.format( i ); - String name = AUDIT_EVENT_BASE + t + "/" + t; + String name = AUDIT_EVENT_BASE + MILLIS_FORMAT.format( i ); String repositoryId = i % 2 == 0 ? TEST_REPO_ID : TEST_REPO_ID_2; eventNames.get( repositoryId ).add( name ); - events.add( createTestEvent( repositoryId, t ) ); + events.add( createTestEvent( repositoryId, name ) ); } metadataRepositoryControl.expectAndReturn( |