I’ve got a set of tests that test some timzeone related functionality
I have a Before method that sets the default timezone to one of my choosing, and an after method that restores whatever the default was before the tests.
So I basically want to do
Set timezone to UTC
Run tests
Restore timezone
Set timezone to EST
Run tests
Restore timezone
Set timezone to JST
Run tests
Restore timezone
The tests are identical in each case.
Is there an easy way to do this?
I solved the problem by using the Parameterized and RunWith notations:
See: http://ourcraft.wordpress.com/2008/08/27/writing-a-parameterized-junit-test/