Class BasicTestResult
- java.lang.Object
-
- gov.nist.secauto.decima.core.assessment.result.BasicTestResult
-
- All Implemented Interfaces:
TestResult
public class BasicTestResult extends Object implements TestResult
Describes aContextwithin a content instance where aDerivedRequirementwas tested and found to be evaluated to some status. This class supports a list of result values that are generated during the assessment evaluation that further provide context. These values are used in the formatting of result messages based on the format string of theDerivedRequirement.
-
-
Constructor Summary
Constructors Constructor Description BasicTestResult(String testId, TestStatus result, Context context)Construct a new test result.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddResultValue(String value)Adds a new result value to the ordered collection of result values.voidaddResultValues(Collection<String> values)Adds a number of new result value to the end of the ordered collection of result values.ContextgetContext()This is the location context of the test result within the tested content instance.List<String>getResultValues()A set of values passed back from a test result that can be used to format a message pertaining to the result of the assessment.TestStatusgetStatus()The outcome of the test.StringgetTestId()StringtoString()
-
-
-
Constructor Detail
-
BasicTestResult
public BasicTestResult(String testId, TestStatus result, Context context)
Construct a new test result.- Parameters:
testId- the identifier for the test performedresult- the result of the test performedcontext- the document context associated with the test result
-
-
Method Detail
-
getTestId
public String getTestId()
- Specified by:
getTestIdin interfaceTestResult
-
getStatus
public TestStatus getStatus()
Description copied from interface:TestResultThe outcome of the test.- Specified by:
getStatusin interfaceTestResult- Returns:
- the status
-
addResultValue
public void addResultValue(String value)
Adds a new result value to the ordered collection of result values. This value must benon-null.- Parameters:
value- the new result value to add
-
addResultValues
public void addResultValues(Collection<String> values)
Adds a number of new result value to the end of the ordered collection of result values. This value must benon-null.- Parameters:
values- the new result values to add
-
getResultValues
public List<String> getResultValues()
Description copied from interface:TestResultA set of values passed back from a test result that can be used to format a message pertaining to the result of the assessment.- Specified by:
getResultValuesin interfaceTestResult- Returns:
- a list of zero or more values
- See Also:
DerivedRequirement.getMessageText(String...)
-
getContext
public Context getContext()
Description copied from interface:TestResultThis is the location context of the test result within the tested content instance. Must be non-null. My trivially return the document root.- Specified by:
getContextin interfaceTestResult- Returns:
- a context sub-class
-
-