use of org.hamcrest.BaseDescription in project junit4 by junit-team.
the class Guesser method reguesses.
@Override
public List<ReguessableValue> reguesses(AssumptionViolatedException e) {
final ArrayList<ReguessableValue> returnThis = new ArrayList<ReguessableValue>();
e.describeTo(new BaseDescription() {
@Override
protected void append(char arg0) {
}
boolean expectedSeen = false;
Object expected = null;
@Override
public Description appendValue(Object value) {
noteValue(value);
return super.appendValue(value);
}
private void noteValue(Object value) {
if (!expectedSeen) {
expected = value;
expectedSeen = true;
return;
}
GuessMap newGuesses = guesses.replaceGuess(expected, value);
returnThis.add(new Guesser<T>(getType(), newGuesses));
}
});
return returnThis;
}
Aggregations