On 25.05.2013 12:14, Emmanuel Lécharny wrote:
> The PasswordPolicy tests are expensive because they need to sleep to
> check some time condition. At this point, I'm wondering if it would not
> worth creating a separate module for it.

Hm, maybe we can avoid using the "real" time (via
System.currentTimeMillis) and use a "time provider" instead. By default
it obtails the system time. But for tests the returned time can be
modified according to the test needs. JodaTime for example has a
DateTimeUtils class with static accessors for getting and setting the
time. In other projects we used a TimeProvider interface with different
implementations for production and tests.

Kind Regards,
Stefan

Reply via email to