com.evolveum.midpoint.test
Class DummyAuditService

java.lang.Object
  extended by com.evolveum.midpoint.test.DummyAuditService
All Implemented Interfaces:
AuditService, DebugDumpable, Dumpable

public class DummyAuditService
extends Object
implements AuditService, Dumpable, DebugDumpable

Dummy audit service that only remembers the audit messages in runtime. Only for use in tests.

Author:
semancik

Field Summary
 
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
 
Constructor Summary
DummyAuditService()
           
 
Method Summary
 void asserHasDelta(ChangeType expectedChangeType, Class<?> expectedClass)
           
 void asserHasDelta(int index, ChangeType expectedChangeType, Class<?> expectedClass)
           
 void asserHasDelta(String message, int index, ChangeType expectedChangeType, Class<?> expectedClass)
           
 void assertAnyRequestDeltas()
           
 void assertExecutionDeltaAdd()
           
 void assertExecutionDeltas(int expectedNumber)
           
 void assertExecutionDeltas(int index, int expectedNumber)
           
 void assertExecutionOutcome(OperationResultStatus expectedStatus)
           
 void assertExecutionSuccess()
           
 void assertNoRecord()
           
 void assertRecords(int expectedNumber)
           
 void assertSimpleRecordSanity()
          Asserts that there is a request message followed by execution message.
 void audit(AuditEventRecord record, Task task)
           
 void clear()
           
 String debugDump()
          Show the content of the object intended for diagnostics by system administrator.
 String debugDump(int indent)
           
 String dump()
          Show the content of the object intended for diagnostics by developer.
 ObjectDeltaOperation<?> getExecutionDelta(int index)
           
 Collection<ObjectDeltaOperation<? extends ObjectType>> getExecutionDeltas()
           
 Collection<ObjectDeltaOperation<? extends ObjectType>> getExecutionDeltas(int index)
           
 AuditEventRecord getExecutionRecord(int index)
           
 List<AuditEventRecord> getExecutionRecords()
           
static DummyAuditService getInstance()
           
 List<AuditEventRecord> getRecords()
           
 AuditEventRecord getRequestRecord()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DummyAuditService

public DummyAuditService()
Method Detail

getInstance

public static DummyAuditService getInstance()

audit

public void audit(AuditEventRecord record,
                  Task task)
Specified by:
audit in interface AuditService

getRecords

public List<AuditEventRecord> getRecords()

clear

public void clear()

assertSimpleRecordSanity

public void assertSimpleRecordSanity()
Asserts that there is a request message followed by execution message.


assertRecords

public void assertRecords(int expectedNumber)

getRequestRecord

public AuditEventRecord getRequestRecord()

getExecutionRecord

public AuditEventRecord getExecutionRecord(int index)

getExecutionRecords

public List<AuditEventRecord> getExecutionRecords()

assertAnyRequestDeltas

public void assertAnyRequestDeltas()

getExecutionDeltas

public Collection<ObjectDeltaOperation<? extends ObjectType>> getExecutionDeltas()

getExecutionDeltas

public Collection<ObjectDeltaOperation<? extends ObjectType>> getExecutionDeltas(int index)

getExecutionDelta

public ObjectDeltaOperation<?> getExecutionDelta(int index)

assertExecutionDeltaAdd

public void assertExecutionDeltaAdd()

assertExecutionSuccess

public void assertExecutionSuccess()

assertExecutionOutcome

public void assertExecutionOutcome(OperationResultStatus expectedStatus)

assertNoRecord

public void assertNoRecord()

asserHasDelta

public void asserHasDelta(ChangeType expectedChangeType,
                          Class<?> expectedClass)

asserHasDelta

public void asserHasDelta(int index,
                          ChangeType expectedChangeType,
                          Class<?> expectedClass)

asserHasDelta

public void asserHasDelta(String message,
                          int index,
                          ChangeType expectedChangeType,
                          Class<?> expectedClass)

assertExecutionDeltas

public void assertExecutionDeltas(int expectedNumber)

assertExecutionDeltas

public void assertExecutionDeltas(int index,
                                  int expectedNumber)

toString

public String toString()
Overrides:
toString in class Object

debugDump

public String debugDump()
Description copied from interface: DebugDumpable
Show the content of the object intended for diagnostics by system administrator. The out put should be suitable to use in system logs at "debug" level. It may be multi-line, but in that case it should be well indented and quite terse. As it is intended to be used by system administrator, it should not use any developer terms such as class names, exceptions or stack traces.

Specified by:
debugDump in interface DebugDumpable
Returns:
content of the object intended for diagnostics by system administrator.

debugDump

public String debugDump(int indent)
Specified by:
debugDump in interface DebugDumpable

dump

public String dump()
Description copied from interface: Dumpable
Show the content of the object intended for diagnostics by developer. The content may be multi-line, in case of hierarchical objects it may be intended. The use of this method may not be efficient. It is not supposed to be used in normal operation. However, it is very useful in tests or in case of dumping objects in severe error situations.

Specified by:
dump in interface Dumpable
Returns:
content of the object intended for diagnostics.


Copyright © 2013 evolveum. All Rights Reserved.