Hi,

I do not think there is any systematic way of doing this as the groovy 
scripts are evaluated in GroovyShell configured by the plugins. Each plugin 
configure variable binding on its own. Object passed might be both 
difficult to mock and available only under some circumstances.

What can help you here is using jenkins-test-harness[1] or 
acceptance-test-harness[2] to launch Jenkins instance, configure what you 
need, put in the script, trigger it and assert results. Both allow you 
writing such a tests using JUnit. See [3] as an example.

[1] https://wiki.jenkins-ci.org/display/JENKINS/Unit+Test

[2] https://github.com/jenkinsci/acceptance-test-harness

[3] 
https://github.com/jenkinsci/acceptance-test-harness/blob/master/src/test/java/plugins/ScriptlerPluginTest.java


HTH

--

oliver

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to