public final class SmithyTestCase
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
SmithyTestCase.Error
Thrown when errors are encountered while unwrapping a test case.
|
static class |
SmithyTestCase.Result
Output of validating a model against a test case.
|
Constructor and Description |
---|
SmithyTestCase(java.lang.String modelLocation,
java.util.List<ValidationEvent> expectedEvents) |
Modifier and Type | Method and Description |
---|---|
SmithyTestCase.Result |
createResult(ValidatedResult<Model> validatedResult)
Creates a test case result from a test case and validated model.
|
static SmithyTestCase |
fromModelFile(java.lang.String modelLocation)
Creates a test case from a model file.
|
java.util.List<ValidationEvent> |
getExpectedEvents()
Gets the expected validation events.
|
java.lang.String |
getModelLocation()
Gets the location of the model file.
|
public SmithyTestCase(java.lang.String modelLocation, java.util.List<ValidationEvent> expectedEvents)
modelLocation
- Location of where the model is stored.expectedEvents
- The expected validation events to encounter.public static SmithyTestCase fromModelFile(java.lang.String modelLocation)
The error file is expected to be stored in the same directory as the model file and is assumed to be named the same as the file with the file extension replaced with ".errors".
The accompanying error file is a newline separated list of error
strings, where each error is defined in the following format:
[SEVERITY] shapeId message | EventId filename:line:column
.
A shapeId of "-" means that a specific shape is not targeted.
modelLocation
- File location of the model.java.lang.IllegalArgumentException
- if the file does not contain an extension.public java.util.List<ValidationEvent> getExpectedEvents()
public java.lang.String getModelLocation()
public SmithyTestCase.Result createResult(ValidatedResult<Model> validatedResult)
The validation events encountered while validating a model are compared against the expected validation events. An actual event (A) is considered a match with an expected event (E) if A and E target the same shape, use the same validation event ID, have the same severity, and the message of E starts with the suppression reason or message of A.
validatedResult
- Result of creating and validating the model.