-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from MarkEWaite/fix-JCasC-defaultTime
[JENKINS-66939] - Allow JCasC schedule time setting
- Loading branch information
Showing
4 changed files
with
37 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
src/test/java/org/jenkinsci/plugins/schedulebuild/JCasCGlobalAllFields.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package org.jenkinsci.plugins.schedulebuild; | ||
|
||
import io.jenkins.plugins.casc.misc.RoundTripAbstractTest; | ||
import java.util.TimeZone; | ||
import jenkins.model.GlobalConfiguration; | ||
import org.jvnet.hudson.test.RestartableJenkinsRule; | ||
|
||
import static org.hamcrest.CoreMatchers.is; | ||
import static org.hamcrest.CoreMatchers.not; | ||
import static org.hamcrest.CoreMatchers.nullValue; | ||
import static org.hamcrest.MatcherAssert.assertThat; | ||
|
||
public class JCasCGlobalAllFields extends RoundTripAbstractTest { | ||
|
||
@Override | ||
protected void assertConfiguredAsExpected(RestartableJenkinsRule j, String configContent) { | ||
ScheduleBuildGlobalConfiguration globalConfig = GlobalConfiguration.all().getInstance(ScheduleBuildGlobalConfiguration.class); | ||
assertThat(globalConfig, is(not(nullValue()))); | ||
assertThat(globalConfig.getDefaultScheduleTime(), is("12:34:56 AM")); | ||
assertThat(globalConfig.getTimeZone(), is("Europe/Rome")); | ||
} | ||
|
||
@Override | ||
protected String stringInLogExpected() { | ||
return "timeZone = Europe/Rome"; | ||
} | ||
|
||
@Override | ||
protected String configResource() { | ||
return "scheduleBuild-all-fields.yaml"; | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
src/test/resources/org/jenkinsci/plugins/schedulebuild/scheduleBuild-all-fields.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
unclassified: | ||
scheduleBuild: | ||
defaultScheduleTime: "12:34:56 AM" | ||
timeZone: "Europe/Rome" |
3 changes: 0 additions & 3 deletions
3
src/test/resources/org/jenkinsci/plugins/schedulebuild/scheduleBuild-default-time-zone.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
unclassified: | ||
scheduleBuild: | ||
# defaultScheduleTime is not currently supported in JCasC | ||
# See JENKINS-66939 for more details | ||
# defaultScheduleTime: "11:00:00 PM" | ||
timeZone: "Europe/Paris" |