Skip to content

Commit

Permalink
Merge pull request jenkinsci#3820 from AbhyudayaSharma/windows-build-fix
Browse files Browse the repository at this point in the history
[JENKINS-29150] - Fix the CronTabTest.testTimezone test
  • Loading branch information
batmat authored Jan 4, 2019
2 parents e7d4f4f + 756ce57 commit 9ce4c4c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions core/src/test/java/hudson/scheduler/CronTabTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.Locale;
import java.util.TimeZone;

import static org.junit.Assert.*;
import org.junit.Test;
Expand Down Expand Up @@ -199,7 +200,7 @@ public void testFloor4() throws Exception {
}

/**
* Humans can't easily see difference in two {@link Calendar}s, do help the diagnosis by using {@link DateFormat}.
* Humans can't easily see difference in two {@link Calendar}s, do help the diagnosis by using {@link DateFormat}.
*/
private void compare(Calendar expected, Calendar actual) {
DateFormat f = DateFormat.getDateTimeInstance();
Expand Down Expand Up @@ -307,7 +308,9 @@ public int next(int n) {
CronTabList tabs = CronTabList.create("TZ=Australia/Sydney\nH * * * *\nH * * * *", Hash.from("seed"));
List<Integer> times = new ArrayList<Integer>();
for (int i = 0; i < 60; i++) {
if (tabs.check(new GregorianCalendar(2013, 3, 3, 11, i, 0))) {
GregorianCalendar calendar = new GregorianCalendar(TimeZone.getTimeZone("UTC"));
calendar.set(2013, Calendar.APRIL, 3, 11, i, 0);
if (tabs.check(calendar)) {
times.add(i);
}
}
Expand Down

0 comments on commit 9ce4c4c

Please sign in to comment.