assertBuildStatusSuccess(build2);
assertFalse("scm polling should not detect any more changes after build", project.pollSCMChanges(listener));
}
public void testBasicExcludedUser() throws Exception {
FreeStyleProject project = setupProject("master", false, null, null, "Jane Doe");
// create initial commit and then run the build against it:
final String commitFile1 = "commitFile1";
commit(commitFile1, johnDoe, "Commit number 1");
build(project, Result.SUCCESS, commitFile1);
assertFalse("scm polling should not detect any more changes after build", project.pollSCMChanges(listener));
final String commitFile2 = "commitFile2";
commit(commitFile2, janeDoe, "Commit number 2");
assertFalse("scm polling detected commit2 change, which should have been excluded",
project.pollSCMChanges(listener));
final String commitFile3 = "commitFile3";
commit(commitFile3, johnDoe, "Commit number 3");
assertTrue("scm polling did not detect commit3 change", project.pollSCMChanges(listener));
//... and build it...
final FreeStyleBuild build2 = build(project, Result.SUCCESS, commitFile2, commitFile3);
final Set<User> culprits = build2.getCulprits();
assertEquals("The build should have two culprit", 2, culprits.size());
assertTrue("User janeDoe is absent in culprits", doesCulpritsContainUser(culprits, janeDoe.getName()));
assertTrue("User johnDoe is absent in culprits", doesCulpritsContainUser(culprits, johnDoe.getName()));
assertTrue(build2.getWorkspace().child(commitFile2).exists());
assertTrue(build2.getWorkspace().child(commitFile3).exists());
assertBuildStatusSuccess(build2);
assertFalse("scm polling should not detect any more changes after build", project.pollSCMChanges(listener));
}