Navigation Menu

Skip to content

Commit

Permalink
JobConfigHistory: Reproduce JENKINS-24410
Browse files Browse the repository at this point in the history
  • Loading branch information
olivergondza committed Aug 25, 2014
1 parent d31b188 commit 7db17dc
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions src/test/java/plugins/JobConfigHistoryPluginTest.java
Expand Up @@ -23,11 +23,17 @@
*/
package plugins;

import java.util.List;

import org.jenkinsci.test.acceptance.Matchers;
import org.jenkinsci.test.acceptance.junit.AbstractJUnitTest;
import org.jenkinsci.test.acceptance.junit.Bug;
import org.jenkinsci.test.acceptance.junit.WithPlugins;
import org.jenkinsci.test.acceptance.plugins.job_config_history.JobConfigHistory;
import org.jenkinsci.test.acceptance.plugins.job_config_history.JobConfigHistory.Change;
import org.jenkinsci.test.acceptance.plugins.maven.MavenModuleSet;
import org.jenkinsci.test.acceptance.po.FreeStyleJob;
import org.jenkinsci.test.acceptance.po.MatrixProject;
import org.jenkinsci.test.acceptance.po.ShellBuildStep;
import org.junit.Test;

Expand All @@ -51,6 +57,40 @@ public void show_simple_history() {
assertThat(all(by.xpath("//tr//a[contains(text(),'(RAW)')]")).size(), is(greaterThan(2)));
}

@Test @Bug("JENKINS-24410")
public void track_change_in_matrix_project() {
MatrixProject job = jenkins.jobs.create(MatrixProject.class);

JobConfigHistory history = job.action(JobConfigHistory.class);

List<Change> original = history.getChanges();

job.configure();
job.runSequentially.check();
job.save();

List<Change> newOnes = history.getChanges();

assertThat("New changes saved", newOnes.size(), greaterThan(original.size()));
}

@Test @Bug("JENKINS-24410")
public void track_change_in_maven_project() {
MavenModuleSet job = jenkins.jobs.create(MavenModuleSet.class);

JobConfigHistory history = job.action(JobConfigHistory.class);

List<Change> original = history.getChanges();

job.configure();
job.goals.set("clean");
job.save();

List<Change> newOnes = history.getChanges();

assertThat("New changes saved", newOnes.size(), greaterThan(original.size()));
}

@Test
public void show_difference_in_config_history() {
FreeStyleJob job = jenkins.jobs.create();
Expand Down

0 comments on commit 7db17dc

Please sign in to comment.