Closed Sergeus closed 11 years ago
Another reason not to use system time is testing takes fuck age.
This is fixed on the joda-time branch. We now use JodaTime (instead of the flakey time API it previously used).
CallStart.java
and CallEnd.Java
now have two constructors:
public CallStart(String caller, String callee) // uses current time
public CallStart(String caller, String callee, LocalDateTime timeStamp) // uses LocalDateTime
One other note: Since you can now specify time, there is no need to sleep when testing (eg in Runner.java
).
An example:
LocalDateTime time = LocalDateTime.now();
LocalDateTime timePlusTen = LocalDateTime.now().plusSeconds(10)
Time should be generated by the test to switch between peak and non peak.