Search in sources :

Example 1 with MatrixRun

use of hudson.matrix.MatrixRun in project hudson-2.x by hudson.

the class HudsonTestCase method assertBuildStatus.

/**
     * Asserts that the outcome of the build is a specific outcome.
     */
public <R extends Run> R assertBuildStatus(Result status, R r) throws Exception {
    if (status == r.getResult())
        return r;
    // dump the build output in failure message
    String msg = "unexpected build status; build log was:\n------\n" + getLog(r) + "\n------\n";
    if (r instanceof MatrixBuild) {
        MatrixBuild mb = (MatrixBuild) r;
        for (MatrixRun mr : mb.getRuns()) {
            msg += "--- " + mr.getParent().getCombination() + " ---\n" + getLog(mr) + "\n------\n";
        }
    }
    assertEquals(msg, status, r.getResult());
    return r;
}
Also used : MatrixRun(hudson.matrix.MatrixRun) MatrixBuild(hudson.matrix.MatrixBuild)

Aggregations

MatrixBuild (hudson.matrix.MatrixBuild)1 MatrixRun (hudson.matrix.MatrixRun)1