Version 4.10.0

hirondelle.web4j.util
Interface TimeSource

All Known Implementing Classes:
TimeSourceImpl

public interface TimeSource

Return a possibly-fake value for the system clock.

When testing, it is often useful to use a fake system clock, in order to exercise code that uses date logic. When you implement this interface, you are instructing WEB4J classes on what time value they should use as the system clock. This allows your application to share its fake system clock with the framework, so that they can both use the exact same clock.

See BuildImpl for instructions on how to configure an implementation of this interface.

The following WEB4J framework classes use TimeSource :


Method Summary
 long currentTimeMillis()
          Return the possibly-fake system time, in milliseconds.
 

Method Detail

currentTimeMillis

long currentTimeMillis()
Return the possibly-fake system time, in milliseconds.


Version 4.10.0

Copyright Hirondelle Systems. Published October 19, 2013 - User Guide - All Docs.