use of hudson.model.Result in project hudson-2.x by hudson.
the class MatrixProjectTest method testSetTouchStoneResultConditionDifferentValues.
@Test
public void testSetTouchStoneResultConditionDifferentValues() throws IOException {
Result parentResultCondition = Result.SUCCESS;
Result childResultCondition = Result.FAILURE;
MatrixProject parentProject = new MatrixProjectMock("parent");
parentProject.setTouchStoneResultCondition(parentResultCondition);
MatrixProject childProject1 = new MatrixProjectMock("child1");
childProject1.setCascadingProject(parentProject);
childProject1.setTouchStoneResultCondition(childResultCondition);
assertEquals(childProject1.getTouchStoneResultCondition(), childResultCondition);
}
use of hudson.model.Result in project hudson-2.x by hudson.
the class ArtifactArchiver method prebuild.
@Override
public boolean prebuild(AbstractBuild<?, ?> build, BuildListener listener) {
if (latestOnly) {
AbstractBuild<?, ?> b = build.getProject().getLastCompletedBuild();
Result bestResultSoFar = Result.NOT_BUILT;
while (b != null) {
if (b.getResult().isBetterThan(bestResultSoFar)) {
bestResultSoFar = b.getResult();
} else {
// remove old artifacts
File ad = b.getArtifactsDir();
if (ad.exists()) {
listener.getLogger().println(Messages.ArtifactArchiver_DeletingOld(b.getDisplayName()));
try {
Util.deleteRecursive(ad);
} catch (IOException e) {
e.printStackTrace(listener.error(e.getMessage()));
}
}
}
b = b.getPreviousBuild();
}
}
return true;
}
use of hudson.model.Result in project hudson-2.x by hudson.
the class MatrixProjectTest method testGetTouchStoneResultConditionParentValue.
@Test
public void testGetTouchStoneResultConditionParentValue() throws IOException {
Result parentResultCondition = Result.SUCCESS;
MatrixProject parentProject = new MatrixProjectMock("parent");
parentProject.setTouchStoneResultCondition(parentResultCondition);
MatrixProject childProject1 = new MatrixProjectMock("child1");
childProject1.setCascadingProject(parentProject);
assertEquals(childProject1.getTouchStoneResultCondition(), parentResultCondition);
}
use of hudson.model.Result in project hudson-2.x by hudson.
the class MatrixProjectTest method testSetTouchStoneResultConditionParentNull.
@Test
public void testSetTouchStoneResultConditionParentNull() throws IOException {
Result childResultCondition = Result.FAILURE;
MatrixProject childProject1 = new MatrixProjectMock("child1");
childProject1.setTouchStoneResultCondition(childResultCondition);
assertEquals(childProject1.getTouchStoneResultCondition(), childResultCondition);
}
use of hudson.model.Result in project hudson-2.x by hudson.
the class MatrixProjectTest method testSetTouchStoneResultConditionTheSameValues.
@Test
public void testSetTouchStoneResultConditionTheSameValues() throws IOException {
Result parentResultCondition = Result.SUCCESS;
MatrixProject parentProject = new MatrixProjectMock("parent");
parentProject.setTouchStoneResultCondition(parentResultCondition);
MatrixProject childProject1 = new MatrixProjectMock("child1");
childProject1.setCascadingProject(parentProject);
childProject1.setTouchStoneResultCondition(parentResultCondition);
assertEquals(childProject1.getTouchStoneResultCondition(), parentResultCondition);
}
Aggregations