|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectjava.lang.Thread
patterntesting.runtime.log.AbstractLogger
patterntesting.runtime.log.ObjectRecorder
public class ObjectRecorder
This class allows you to record objects. Later you can replay the logged objects, e.g. to simulate external you can:
If you want a pure java solution you can try ThOR, the Java Test Object Recorder.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
Thread.State, Thread.UncaughtExceptionHandler |
| Field Summary |
|---|
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
ObjectRecorder()
Instantiates a new object recorder. |
|
ObjectRecorder(File logFile)
Instantiates a new object logger. |
|
ObjectRecorder(OutputStream ostream)
Instantiates a new object logger to the given stream. |
|
| Method Summary | |
|---|---|
void |
close()
Closes the stream with the logged objects. |
void |
log(JoinPoint joinPoint,
Object returnValue)
Both things are logged with this method: the call of a method (joinPoint) and the return value of this method. |
void |
run()
This method is called at shutdown to close the open stream. |
protected void |
save(String joinPoint,
Object returnValue)
Saves the given joinPoint / returnValue pair to the log stream. |
| Methods inherited from class patterntesting.runtime.log.AbstractLogger |
|---|
createTempLogFile, getLogStream, getStreamFor, toString |
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, yield |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ObjectRecorder()
public ObjectRecorder(File logFile)
logFile - the log filepublic ObjectRecorder(OutputStream ostream)
ostream - the ostream| Method Detail |
|---|
public void run()
run in interface Runnablerun in class AbstractLoggerThread.run()public void close()
close in class AbstractLogger
@NullArgsAllowed
public void log(JoinPoint joinPoint,
Object returnValue)
Because the given joinPoint cannot be used as key for a map in
ObjectPlayer it is saved as string. As a side effect this will
speedup the serialization stuff and shorten the generated record file.
joinPoint - the joinpointreturnValue - the return value
protected void save(String joinPoint,
Object returnValue)
throws IOException
joinPoint - the join pointreturnValue - the return value
IOException - Signals that an I/O exception has occurred.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||