Wayne Warren ddb2b9c01c Simplify 'update and delete old jobs' test
Previously this test was bound too tightly to implementation details
of jenkins_jobs.builder.Builder and jenkins_jobs.parser.YamlParser;
specifically, it was enforcing the relationship between these two
objects by accessing the Builder's instance of the YamlParser. In
order to proceed with the JJB 2.0 API refactoring, one of the goals of
which is to disentangle YamlParser from Builder, this had to be
rewritten.

The rewrite aims to instead test at the boundaries of the JJB
application --specifically by mocking out various methods in the
jenkins.Jenkins class upon which JJB is built then making a command
line call to jenkins-jobs using the jenkins_jobs.cli.entry.JenkinsJobs
tool.

The one remaining piece of questionable implementation detail binding
in this test is the mocking of jenkins_jobs.builder.Jenkins.is_managed
which I think is unavoidable without mocking return values on
jenkins.Jenkins.get_job_config, which would be tedius and probably
more effort than it's worth since deconstructing the relationship
between jenkins_jobs.builder.Builder and jenkins_jobs.builder.Jenkins
is not necessary for JJB 2.0 (actually, these two classes should
probably just be combined into one)

Change-Id: Ia0e07097e6596be2ac13140668480cefcec8334b
2016-07-22 17:34:15 +01:00
..
2014-07-09 08:55:10 -07:00
2016-07-22 17:33:25 +01:00