Search code examples
timerjava-ee-6ejb-3.1

How to test Timer Service (EJBTimer) in JavaEE6 that runs every end of month


I was just wondering, what's the best way to test a JavaEE6 timer? For example, I have a job that runs every end of the month, or end of week :-?

Thanks.


Solution

  • The same way you would test anything time-based: adjust your system clock, or test that the expected timeout looks reasonable (e.g., check that getNextTimeout returns a reasonable value).