mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
AuditService delete by ID: Added bulk-delete perf. test
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@22983 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -606,32 +606,30 @@ public class AuditComponentTest extends TestCase
|
|||||||
|
|
||||||
// Clear everything and check that unsuccessful authentication was audited
|
// Clear everything and check that unsuccessful authentication was audited
|
||||||
clearAuditLog(APPLICATION_API_TEST);
|
clearAuditLog(APPLICATION_API_TEST);
|
||||||
try
|
int iterations = 1000;
|
||||||
|
for (int i = 0; i < iterations; i++)
|
||||||
{
|
{
|
||||||
authenticationService.authenticate("banana", "****".toCharArray());
|
try
|
||||||
fail("Invalid authentication attempt should fail");
|
{
|
||||||
}
|
authenticationService.authenticate("banana", "****".toCharArray());
|
||||||
catch (AuthenticationException e)
|
fail("Invalid authentication attempt should fail");
|
||||||
{
|
}
|
||||||
// Expected
|
catch (AuthenticationException e)
|
||||||
}
|
{
|
||||||
try
|
// Expected
|
||||||
{
|
}
|
||||||
authenticationService.authenticate("banana", "****".toCharArray());
|
|
||||||
fail("Invalid authentication attempt should fail");
|
|
||||||
}
|
|
||||||
catch (AuthenticationException e)
|
|
||||||
{
|
|
||||||
// Expected
|
|
||||||
}
|
}
|
||||||
results.clear();
|
results.clear();
|
||||||
sb.delete(0, sb.length());
|
sb.delete(0, sb.length());
|
||||||
queryAuditLog(auditQueryCallback, params, -1);
|
queryAuditLog(auditQueryCallback, params, -1);
|
||||||
logger.debug(sb.toString());
|
logger.debug(sb.toString());
|
||||||
assertEquals("Incorrect number of audit entries after failed login", 2, results.size());
|
assertEquals("Incorrect number of audit entries after failed login", iterations, results.size());
|
||||||
|
|
||||||
// Check that we can delete explicit entries
|
// Check that we can delete explicit entries
|
||||||
|
long before = System.currentTimeMillis();
|
||||||
deleteAuditEntries(results);
|
deleteAuditEntries(results);
|
||||||
|
System.out.println(
|
||||||
|
"Clearing " + results.size() + " entries by ID took " + (System.currentTimeMillis() - before) + "ms.");
|
||||||
results.clear();
|
results.clear();
|
||||||
sb.delete(0, sb.length());
|
sb.delete(0, sb.length());
|
||||||
queryAuditLog(auditQueryCallback, params, -1);
|
queryAuditLog(auditQueryCallback, params, -1);
|
||||||
|
Reference in New Issue
Block a user