final String commitFile2 = "commitFile2";
commit(commitFile2, janeDoe, "Commit number 2");
assertTrue("scm polling did not detect commit2 change", project.pollSCMChanges(listener));
//... and build it...
final FreeStyleBuild build2 = build(project, "subdir", Result.SUCCESS,
commitFile2);
final Set<User> culprits = build2.getCulprits();
assertEquals("The build should have only one culprit", 1, culprits.size());
assertEquals("", janeDoe.getName(), culprits.iterator().next().getFullName());
assertEquals("The workspace should have a 'subdir' subdirectory, but does not.", true,
build2.getWorkspace().child("subdir").exists());
assertEquals("The 'subdir' subdirectory should contain commitFile2, but does not.", true,
build2.getWorkspace().child("subdir").child(commitFile2).exists());
assertBuildStatusSuccess(build2);
assertFalse("scm polling should not detect any more changes after build", project.pollSCMChanges(listener));
}