Sergeus / AcmeTelecomSoftEngCW

Software Engineering for Industry Coursework 2 - Acme Telecom
0 stars 0 forks source link

Uses Current Time #1

Closed Sergeus closed 11 years ago

Sergeus commented 11 years ago

Time should be generated by the test to switch between peak and non peak.

Sergeus commented 11 years ago

Another reason not to use system time is testing takes fuck age.

ChrisSSocha commented 11 years ago

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)