public class MultiStatus
extends java.lang.Object
The rule for how MultiStatus calculates the overall Status of an array of Status objects is based on the following precedence:
If any of the test cases return a Status.FAILED, then the overall status is Status.FAILED.
If all test cases return Status.PASSED, then the overall status is Status.PASSED.
If at least one test case returns either a null Status or some other Status, the overall status is Status.FAILED.
For an example of how to use this library see the UmbrellaTest library or the JCK test case: tests/api/java_lang/Double/SerializeTests.html.
Constructor and Description |
---|
MultiStatus()
Create a MultiStatus object to accumulate individual Status objects.
|
MultiStatus(java.io.PrintWriter out)
Create a MultiStatus object to accumulate individual Status objects.
|
Modifier and Type | Method and Description |
---|---|
void |
add(java.lang.String testID,
Status status)
Add another test result into the set for consideration.
|
Status |
getStatus()
Get the aggregate outcome of all the outcomes passed to "add".
|
int |
getTestCount()
Get the number of individual test results that have been added.
|
static Status |
overallStatus(java.lang.String[] testIDs,
Status[] status)
Generates a Status object that reflects an array of Status objects.
|
static Status |
overallStatus(java.lang.String[] testIDs,
Status[] status,
java.io.PrintWriter out)
Generates a Status object that reflects an array of Status objects.
|
public MultiStatus()
public MultiStatus(java.io.PrintWriter out)
out
- A stream to which the report the outcome of the tests.
If the stream is null, no reporting is done.public int getTestCount()
public void add(java.lang.String testID, Status status)
testID
- A name for this test case. Should not be null.status
- The outcome of this test casepublic Status getStatus()
public static Status overallStatus(java.lang.String[] testIDs, Status[] status, java.io.PrintWriter out)
testIDs
- an array of names used to identify the individual test cases.status
- an array of Status objects giving the outcomes of the individual test cases.out
- a PrintWriter that can be used to output the individual test case
status values. If null, no output is generated.public static Status overallStatus(java.lang.String[] testIDs, Status[] status)
testIDs
- an array of names used to identify the individual test cases.status
- an array of Status objects giving the outcomes of the individual test cases.Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.