org.apache.sling.commons.testing.sling
Class MockRequestProgressTracker

java.lang.Object
  extended by org.apache.sling.commons.testing.sling.MockRequestProgressTracker
All Implemented Interfaces:
RequestProgressTracker

public class MockRequestProgressTracker
extends java.lang.Object
implements RequestProgressTracker


Constructor Summary
MockRequestProgressTracker()
           
 
Method Summary
 void done()
          Call this when done processing the request - all calls except the first one are ignored
 void dump(java.io.PrintWriter writer)
          Dumps the process timer entries to the given writer, one entry per line.
 java.util.Iterator<java.lang.String> getMessages()
          Returns an Iterator of tracking entries.
 void log(java.lang.String message)
          Creates an entry with the given message
 void log(java.lang.String format, java.lang.Object... args)
          Creates an entry with a message constructed from the given MessageFormat format evaluated using the given formatting arguments.
 void logTimer(java.lang.String timerName)
          Logs an entry with the message set to the name of the timer and the number of milliseconds elapsed since the timer start.
 void logTimer(java.lang.String timerName, java.lang.String format, java.lang.Object... args)
          Logs an entry with the message constructed from the given MessageFormat pattern evaluated using the given arguments and the number of milliseconds elapsed since the timer start.
 void startTimer(java.lang.String timerName)
          Starts a named timer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockRequestProgressTracker

public MockRequestProgressTracker()
Method Detail

dump

public void dump(java.io.PrintWriter writer)
Description copied from interface: RequestProgressTracker
Dumps the process timer entries to the given writer, one entry per line.

Specified by:
dump in interface RequestProgressTracker

getMessages

public java.util.Iterator<java.lang.String> getMessages()
Description copied from interface: RequestProgressTracker
Returns an Iterator of tracking entries. If there are no messages null is returned.

Specified by:
getMessages in interface RequestProgressTracker

log

public void log(java.lang.String message)
Description copied from interface: RequestProgressTracker
Creates an entry with the given message

Specified by:
log in interface RequestProgressTracker

log

public void log(java.lang.String format,
                java.lang.Object... args)
Description copied from interface: RequestProgressTracker
Creates an entry with a message constructed from the given MessageFormat format evaluated using the given formatting arguments.

Specified by:
log in interface RequestProgressTracker

logTimer

public void logTimer(java.lang.String timerName)
Description copied from interface: RequestProgressTracker
Logs an entry with the message set to the name of the timer and the number of milliseconds elapsed since the timer start.

Specified by:
logTimer in interface RequestProgressTracker

logTimer

public void logTimer(java.lang.String timerName,
                     java.lang.String format,
                     java.lang.Object... args)
Description copied from interface: RequestProgressTracker
Logs an entry with the message constructed from the given MessageFormat pattern evaluated using the given arguments and the number of milliseconds elapsed since the timer start.

Specified by:
logTimer in interface RequestProgressTracker

startTimer

public void startTimer(java.lang.String timerName)
Description copied from interface: RequestProgressTracker
Starts a named timer. If a timer of the same name already exists, it is reset to the current time.

Specified by:
startTimer in interface RequestProgressTracker

done

public void done()
Description copied from interface: RequestProgressTracker
Call this when done processing the request - all calls except the first one are ignored

Specified by:
done in interface RequestProgressTracker


Copyright © 2007-2009. All Rights Reserved.