|
Copyright 2008 - 2009 Tony Morris, Runar Bjarnason, Tom Adams, Brad Clow, Ricky Clarkson, Nick Partridge, Jason Zaugg This software is released under an open source BSD licence. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfj.test.CheckResult
public final class CheckResult
An enumeration of the possible results after checking a property. A CheckResult
may
be in one of six states:
Field Summary | |
---|---|
static Show<CheckResult> |
summary
A rendering of a check result that summarises in one line. |
static Show<CheckResult> |
summaryEx
A rendering of a check result that summarises in one line but throws an exception in the result is a failure (falsified, property exception or generator exception). |
Method Summary | |
---|---|
Option<List<Arg<?>>> |
args()
Returns the arguments if the result is one of; proven, falsified or exception during property execution, otherwise, no arguments are returned. |
int |
discarded()
Returns the number of discarded checks of the property in this result. |
Option<Throwable> |
exception()
Returns the execption if the result is one of; exception during property execution or exception during argument value generation, otherwise, no exception are returned. |
static CheckResult |
exhausted(int succeeded,
int discarded)
Returns a result that the property been exhausted in checking. |
static CheckResult |
falsified(List<Arg<?>> args,
int succeeded,
int discarded)
Returns a result that the property has been falsified. |
static CheckResult |
genException(Throwable ex,
int succeeded,
int discarded)
Returns a result that generating values to check the property threw an exception. |
boolean |
isExhausted()
Returns true if this result is exhausted, false otherwise. |
boolean |
isFalsified()
Returns true if this result is falsified, false otherwise. |
boolean |
isGenException()
Returns true if this result is an exception during generating of values for
property checking, false otherwise. |
boolean |
isPassed()
Returns true if this result is passed, false otherwise. |
boolean |
isPropException()
Returns true if this result is an exception during property execution,
false otherwise. |
boolean |
isProven()
Returns true if this result is proven, false otherwise. |
static CheckResult |
passed(int succeeded,
int discarded)
Returns a result that the property has passed. |
static CheckResult |
propException(List<Arg<?>> args,
Throwable ex,
int succeeded,
int discarded)
Returns a result that checking the property threw an exception. |
static CheckResult |
proven(List<Arg<?>> args,
int succeeded,
int discarded)
Returns a result that the property has been proven. |
int |
succeeded()
Returns the number of succeeded checks of the property in this result. |
static Show<CheckResult> |
summary(Show<Arg<?>> sa)
A rendering of a check result that summarises in one line. |
static Show<CheckResult> |
summaryEx(Show<Arg<?>> sa)
A rendering of a check result that summarises in one line but throws an exception in the result is a failure (falsified, property exception or generator exception). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Show<CheckResult> summary
public static final Show<CheckResult> summaryEx
Method Detail |
---|
public static CheckResult passed(int succeeded, int discarded)
succeeded
- The number of checks that succeeded.discarded
- The number of checks that were discarded.
public static CheckResult proven(List<Arg<?>> args, int succeeded, int discarded)
args
- The arguments used to prove the property.succeeded
- The number of checks that succeeded.discarded
- The number of checks that were discarded.
public static CheckResult falsified(List<Arg<?>> args, int succeeded, int discarded)
args
- The arguments used to falsify the property.succeeded
- The number of checks that succeeded.discarded
- The number of checks that were discarded.
public static CheckResult exhausted(int succeeded, int discarded)
succeeded
- The number of checks that succeeded.discarded
- The number of checks that were discarded.
public static CheckResult propException(List<Arg<?>> args, Throwable ex, int succeeded, int discarded)
args
- The arguments used when the exception was thrown.ex
- The exception that was thrown.succeeded
- The number of checks that succeeded.discarded
- The number of checks that were discarded.
public static CheckResult genException(Throwable ex, int succeeded, int discarded)
ex
- The exception that was thrown.succeeded
- The number of checks that succeeded.discarded
- The number of checks that were discarded.
public boolean isPassed()
true
if this result is passed, false
otherwise.
true
if this result is passed, false
otherwise.public boolean isProven()
true
if this result is proven, false
otherwise.
true
if this result is proven, false
otherwise.public boolean isFalsified()
true
if this result is falsified, false
otherwise.
true
if this result is falsified, false
otherwise.public boolean isExhausted()
true
if this result is exhausted, false
otherwise.
true
if this result is exhausted, false
otherwise.public boolean isPropException()
true
if this result is an exception during property execution,
false
otherwise.
true
if this result is an exception during property execution,
false
otherwise.public boolean isGenException()
true
if this result is an exception during generating of values for
property checking, false
otherwise.
true
if this result is an exception during generating of values for
property checking, false
otherwise.public Option<List<Arg<?>>> args()
public Option<Throwable> exception()
public int succeeded()
public int discarded()
public static Show<CheckResult> summary(Show<Arg<?>> sa)
sa
- The rendering of arguments.
public static Show<CheckResult> summaryEx(Show<Arg<?>> sa)
sa
- The rendering of arguments.
|
Copyright 2008 - 2009 Tony Morris, Runar Bjarnason, Tom Adams, Brad Clow, Ricky Clarkson, Nick Partridge, Jason Zaugg This software is released under an open source BSD licence. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |