jenkins the definitive guide

(Jeff_L) #1

Jenkins displays a host of information about the failed test in a very readable form, including the error
message the test produced, the stack trace, how long the test has been broken, and how long it took to
run. Often, this in itself is enough to put a developer on the right track towards fixing the issue.


Now let’s fix the build. To make things simple, we’ll just back out our changes and recommit the code
in its original state (the end users just changed their mind about the asterisks, anyway). So just undo the
changes you made to the Cell class (again, the changes are highlighted in bold):


package com.wakaleo.gameoflife.domain;

public enum Cell {
LIVE_CELL("*"), DEAD_CELL(".");

private String symbol;

private Cell(String symbol) {
this.symbol = symbol;
}

@Override
public String toString() {
return symbol;
}

static Cell fromSymbol(String symbol) {
Cell cellRepresentedBySymbol = null;
for (Cell cell : Cell.values()) {
if (cell.symbol.equals(symbol)) {
cellRepresentedBySymbol = cell;
break;
}
}
return cellRepresentedBySymbol;
}

public String getSymbol() {
return symbol;
}
}

When you’ve done this, commit your changes again:


$ git commit -a -m "Restored the star"
[master bc924be] Restored the star
1 files changed, 1 insertions(+), 1 deletions(-)
$ git push
Counting objects: 21, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (7/7), done.
Writing objects: 100% (11/11), 752 bytes, done.
Total 11 (delta 4), reused 6 (delta 0)
To [email protected]:john-smart/game-of-life.git
61ce946..bc924be master -> master
Free download pdf