Package org.junit.runner
Class Result
- java.lang.Object
-
- org.junit.runner.Result
-
- All Implemented Interfaces:
java.io.Serializable
public class Result extends java.lang.Object implements java.io.SerializableAResultcollects and summarizes information from running multiple tests. All tests are counted -- additional information is collected from tests that fail.- Since:
- 4.0
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classResult.Listenerprivate static classResult.SerializedFormRepresents the serialized output ofResult.
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.atomic.AtomicIntegerassumptionFailureCountprivate java.util.concurrent.atomic.AtomicIntegercountprivate java.util.concurrent.CopyOnWriteArrayList<Failure>failuresprivate java.util.concurrent.atomic.AtomicIntegerignoreCountprivate java.util.concurrent.atomic.AtomicLongrunTimeprivate Result.SerializedFormserializedFormOnly set during deserialization process.private static java.io.ObjectStreamField[]serialPersistentFieldsprivate static longserialVersionUIDprivate java.util.concurrent.atomic.AtomicLongstartTime
-
Constructor Summary
Constructors Modifier Constructor Description Result()privateResult(Result.SerializedForm serializedForm)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RunListenercreateListener()Internal use only.intgetAssumptionFailureCount()Returns the number of tests skipped because of an assumption failureintgetFailureCount()Returns the number of tests that failed during the runjava.util.List<Failure>getFailures()Returns theFailures describing tests that failed and the problems they encounteredintgetIgnoreCount()intgetRunCount()Returns the number of tests runlonggetRunTime()Returns the number of milliseconds it took to run the entire suite to runprivate voidreadObject(java.io.ObjectInputStream s)private java.lang.ObjectreadResolve()booleanwasSuccessful()private voidwriteObject(java.io.ObjectOutputStream s)
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
serialPersistentFields
private static final java.io.ObjectStreamField[] serialPersistentFields
-
count
private final java.util.concurrent.atomic.AtomicInteger count
-
ignoreCount
private final java.util.concurrent.atomic.AtomicInteger ignoreCount
-
assumptionFailureCount
private final java.util.concurrent.atomic.AtomicInteger assumptionFailureCount
-
failures
private final java.util.concurrent.CopyOnWriteArrayList<Failure> failures
-
runTime
private final java.util.concurrent.atomic.AtomicLong runTime
-
startTime
private final java.util.concurrent.atomic.AtomicLong startTime
-
serializedForm
private Result.SerializedForm serializedForm
Only set during deserialization process.
-
-
Constructor Detail
-
Result
public Result()
-
Result
private Result(Result.SerializedForm serializedForm)
-
-
Method Detail
-
getRunCount
public int getRunCount()
Returns the number of tests run
-
getFailureCount
public int getFailureCount()
Returns the number of tests that failed during the run
-
getRunTime
public long getRunTime()
Returns the number of milliseconds it took to run the entire suite to run
-
getFailures
public java.util.List<Failure> getFailures()
Returns theFailures describing tests that failed and the problems they encountered
-
getIgnoreCount
public int getIgnoreCount()
- Returns:
- the number of tests ignored during the run
-
getAssumptionFailureCount
public int getAssumptionFailureCount()
Returns the number of tests skipped because of an assumption failure- Throws:
java.lang.UnsupportedOperationException- if the result was serialized in a version before JUnit 4.13- Since:
- 4.13
-
wasSuccessful
public boolean wasSuccessful()
- Returns:
trueif all tests succeeded
-
writeObject
private void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException- Throws:
java.io.IOException
-
readObject
private void readObject(java.io.ObjectInputStream s) throws java.lang.ClassNotFoundException, java.io.IOException- Throws:
java.lang.ClassNotFoundExceptionjava.io.IOException
-
readResolve
private java.lang.Object readResolve()
-
createListener
public RunListener createListener()
Internal use only.
-
-