File tree Expand file tree Collapse file tree 3 files changed +57
-0
lines changed
main/groovy/javaposse/jobdsl/dsl/views
test/groovy/javaposse/jobdsl/dsl/views Expand file tree Collapse file tree 3 files changed +57
-0
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,9 @@ Browse the Jenkins issue tracker to see any [open issues](https://issues.jenkins
3232 ([ JENKINS-38637] ( https://issues.jenkins-ci.org/browse/JENKINS-38637 ) )
3333 * Fixed a problem with relative job names
3434 ([ JENKINS-39137] ( https://issues.jenkins-ci.org/browse/JENKINS-39137 ) )
35+ * Added "Next Launch" and "Next Possible Launch" columns for
36+ [ Next Executions Plugin] ( https://wiki.jenkins-ci.org/display/JENKINS/Next+Executions )
37+ ([ #940 ] ( https://github.com/jenkinsci/job-dsl-plugin/pull/940 ) )
3538* 1.52 (October 17 2016)
3639 * Increased the minimum supported Jenkins version to 1.642
3740 * Enhanced support for the [ Exclusion Plugin] ( https://wiki.jenkins-ci.org/display/JENKINS/Exclusion-Plugin )
Original file line number Diff line number Diff line change @@ -253,4 +253,28 @@ class ColumnsContext extends AbstractExtensibleContext {
253253 useIcon(icon)
254254 }
255255 }
256+
257+ /**
258+ * Adds a column showing job's next launch.
259+ *
260+ * @since 1.53
261+ */
262+ @RequiresPlugin (id = ' next-executions' , minimumVersion = ' 1.0.12' )
263+ void nextLaunch () {
264+ columnNodes << new NodeBuilder (). ' hudson.plugins.nextexecutions.columns.NextExecutionColumn' {
265+ triggerClass(' hudson.triggers.TimerTrigger' )
266+ }
267+ }
268+
269+ /**
270+ * Adds a column showing job's next possible launch.
271+ *
272+ * @since 1.53
273+ */
274+ @RequiresPlugin (id = ' next-executions' , minimumVersion = ' 1.0.12' )
275+ void nextPossibleLaunch () {
276+ columnNodes << new NodeBuilder (). ' hudson.plugins.nextexecutions.columns.PossibleNextExecutionColumn' {
277+ triggerClass(' hudson.triggers.SCMTrigger' )
278+ }
279+ }
256280}
Original file line number Diff line number Diff line change @@ -783,6 +783,36 @@ class ListViewSpec<T extends ListView> extends Specification {
783783 1 * jobManagement. requireMinimumPluginVersion(' extra-columns' , ' 1.6' )
784784 }
785785
786+ def ' next launch column' () {
787+ when :
788+ view. columns {
789+ nextLaunch()
790+ }
791+
792+ then :
793+ Node root = view. node
794+ root. columns. size() == 1
795+ root. columns[0 ]. value(). size() == 1
796+ root. columns[0 ]. value()[0 ]. name() == ' hudson.plugins.nextexecutions.columns.NextExecutionColumn'
797+ root. columns[0 ]. value(). triggerClass[0 ]. value() == ' hudson.triggers.TimerTrigger'
798+ 1 * jobManagement. requireMinimumPluginVersion(' next-executions' , ' 1.0.12' )
799+ }
800+
801+ def ' next possible launch column' () {
802+ when :
803+ view. columns {
804+ nextPossibleLaunch()
805+ }
806+
807+ then :
808+ Node root = view. node
809+ root. columns. size() == 1
810+ root. columns[0 ]. value(). size() == 1
811+ root. columns[0 ]. value()[0 ]. name() == ' hudson.plugins.nextexecutions.columns.PossibleNextExecutionColumn'
812+ root. columns[0 ]. value(). triggerClass[0 ]. value() == ' hudson.triggers.SCMTrigger'
813+ 1 * jobManagement. requireMinimumPluginVersion(' next-executions' , ' 1.0.12' )
814+ }
815+
786816 protected String getDefaultXml () {
787817 ''' <?xml version='1.0' encoding='UTF-8'?>
788818<hudson.model.ListView>
You can’t perform that action at this time.
0 commit comments