mirror of
https://github.com/frode-carlsen/cron.git
synced 2025-12-06 05:50:54 +03:00
Revert timezone to the default after the test
This commit is contained in:
@@ -25,6 +25,7 @@ import org.joda.time.DateTime;
|
||||
import org.joda.time.DateTimeZone;
|
||||
import org.joda.time.Hours;
|
||||
import org.joda.time.LocalDate;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -34,10 +35,17 @@ import fc.cron.CronExpression.DayOfWeekField;
|
||||
import fc.cron.CronExpression.SimpleField;
|
||||
|
||||
public class CronExpressionTest {
|
||||
DateTimeZone original;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
DateTimeZone myZone = DateTimeZone.forID("Europe/Oslo");
|
||||
DateTimeZone.setDefault(myZone);
|
||||
original = DateTimeZone.getDefault();
|
||||
DateTimeZone.setDefault(DateTimeZone.forID("Europe/Oslo"));
|
||||
}
|
||||
|
||||
@After
|
||||
public void tearDown() {
|
||||
DateTimeZone.setDefault(original);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user