mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-15 13:02:19 +00:00
Merge pull request #1672 from productsupcom/JENKINS-9283
[JENKINS-9283] Timezone Support for Scheduling
This commit is contained in:
commit
73e151f3d1
3 files changed
+84
-8
No files matched your search
@@ -27,6 +27,7 @@ import antlr.ANTLRException;
|
||||
import java.text.DateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.TimeZone;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.Locale;
|
||||
|
||||
@@ -301,4 +302,17 @@ public class CronTabTest {
|
||||
// ok
|
||||
}
|
||||
}
|
||||
|
||||
@Issue("JENKINS-9283")
|
||||
@Test public void testTimezone() throws Exception {
|
||||
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))) {
|
||||
times.add(i);
|
||||
}
|
||||
}
|
||||
assertEquals("[35, 56]", times.toString());
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user