Search in sources :

Example 1 with SqaleAuditService

use of com.evolveum.midpoint.repo.sqale.audit.SqaleAuditService in project midpoint by Evolveum.

the class SqaleAuditSearchIterativeTest method initObjects.

@BeforeClass
public void initObjects() throws Exception {
    sqaleAuditService = ((AuditServiceProxy) auditService).getImplementation(SqaleAuditService.class);
    performanceMonitor = sqaleAuditService.getPerformanceMonitor();
    aer = QAuditEventRecordMapping.get().defaultAlias();
    clearAudit();
    OperationResult result = createOperationResult();
    long timestamp = startTimestamp;
    Random random = new Random();
    // we will create two full "pages" of data
    for (int i = 1; i <= ITERATION_PAGE_SIZE * 2; i++) {
        AuditEventRecord record = new AuditEventRecord();
        record.setParameter(paramString(i));
        record.setTimestamp(timestamp);
        auditService.audit(record, NullTaskImpl.INSTANCE, result);
        // 50% chance to change the timestamp by up to a second
        timestamp += random.nextInt(2) * random.nextInt(1000);
    }
}
Also used : SqaleAuditService(com.evolveum.midpoint.repo.sqale.audit.SqaleAuditService) Random(java.util.Random) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) QAuditEventRecord(com.evolveum.midpoint.repo.sqale.audit.qmodel.QAuditEventRecord) AuditEventRecord(com.evolveum.midpoint.audit.api.AuditEventRecord) BeforeClass(org.testng.annotations.BeforeClass)

Aggregations

AuditEventRecord (com.evolveum.midpoint.audit.api.AuditEventRecord)1 SqaleAuditService (com.evolveum.midpoint.repo.sqale.audit.SqaleAuditService)1 QAuditEventRecord (com.evolveum.midpoint.repo.sqale.audit.qmodel.QAuditEventRecord)1 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)1 Random (java.util.Random)1 BeforeClass (org.testng.annotations.BeforeClass)1