public class ETSAssert extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
assertQualifiedName(Document document,
String namespaceUri,
String localName)
Asserts that the qualified name of a Document root node matches the expected value.
|
static void |
assertQualifiedName(Node node,
String namespaceUri,
String localName)
Asserts that the qualified name of a DOM Node matches the expected value.
|
static void |
assertSchemaValid(Validator validator,
Source source)
Asserts that an XML resource is schema-valid.
|
static void |
assertStatusCode(int statusCode,
int expectedStatusCode)
Asserts that the status code matches the expected status code.
|
static void |
assertTrue(boolean valueToAssert,
String failureMsg) |
static void |
assertXmlContentType(javax.ws.rs.core.MultivaluedMap<String,String> headers)
Asserts that the header "Content-Type" contains a value with 'xml'.
|
static void |
assertXPath(Node context,
String expr)
Asserts that an XPath 1.0 expression holds true for the given evaluation context.
|
static void |
assertXPath(Node context,
String expr,
Map<String,String> namespaceBindings)
Asserts that an XPath 1.0 expression holds true for the given evaluation context.
|
static void |
assertXPath(Node context,
String expr,
Map<String,String> namespaceBindings,
String assertionErrorMessage)
Asserts that an XPath 1.0 expression holds true for the given evaluation context.
|
public static void assertStatusCode(int statusCode,
int expectedStatusCode)
statusCode - the status codeexpectedStatusCode - the expected status codepublic static void assertXmlContentType(javax.ws.rs.core.MultivaluedMap<String,String> headers)
headers - the available headerspublic static void assertTrue(boolean valueToAssert,
String failureMsg)
valueToAssert - the boolean to assert to be truefailureMsg - the message to throw in case of a failure, should not be nullpublic static void assertQualifiedName(Document document, String namespaceUri, String localName)
document - The document to check the root node.namespaceUri - the expected namespace uri.localName - the expected local name.public static void assertQualifiedName(Node node, String namespaceUri, String localName)
node - The Node to check.namespaceUri - the expected namespace uri.localName - the expected local name.public static void assertXPath(Node context, String expr)
context - The context node.expr - A valid XPath 1.0 expression.public static void assertXPath(Node context, String expr, Map<String,String> namespaceBindings)
context - The context node.expr - A valid XPath 1.0 expression.namespaceBindings - A collection of namespace bindings for the XPath expression, where each entry maps a namespace URI
(key) to a prefix (value). It may be null.public static void assertXPath(Node context, String expr, Map<String,String> namespaceBindings, String assertionErrorMessage)
context - The context node.expr - A valid XPath 1.0 expression.namespaceBindings - A collection of namespace bindings for the XPath expression, where each entry maps a namespace URI
(key) to a prefix (value). It may be null.assertionErrorMessage - message to throw if assertion failed, should not be nullCopyright © 2019 Open Geospatial Consortium. All rights reserved.