|
Version 4.10.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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 :
DateTime.now(TimeZone)
- returns the current date-time
ShowDate
- displays the current date-time
LoggingConfigImpl
- both the name of the logging
file and the date-time attached to each logging record are affected
TroubleTicket
- uses the current date-time
Controller
- upon startup, it places the current date-time in application scope
Method Summary | |
---|---|
long |
currentTimeMillis()
Return the possibly-fake system time, in milliseconds. |
Method Detail |
---|
long currentTimeMillis()
|
Version 4.10.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |