public class ETSAssert extends Object
Modifier and Type | Method and Description |
---|---|
static void |
assertDescendantElementCount(Document xmlEntity,
QName elementName,
int expectedCount)
Asserts that the given XML entity contains the expected number of
descendant elements having the specified name.
|
static void |
assertExceptionReport(com.sun.jersey.api.client.ClientResponse rsp,
String exceptionCode,
String locator)
Asserts that the given response message contains an OGC exception report.
|
static void |
assertQualifiedName(Node node,
QName qName)
Asserts that the qualified name of a DOM Node matches the expected value.
|
static void |
assertSchematronValid(URL schemaRef,
Source xmlSource,
String activePhase)
Asserts that an XML resource satisfies all applicable constraints defined
for the specified phase in a Schematron (ISO 19757-3) schema.
|
static void |
assertSchemaValid(Validator validator,
Source source)
Asserts that an XML resource is schema-valid.
|
static void |
assertXPath(String expr,
Node context,
Map<String,String> namespaceBindings)
Asserts that an XPath 1.0 expression holds true for the given evaluation
context.
|
public static void assertQualifiedName(Node node, QName qName)
node
- The Node to check.qName
- A QName object containing a namespace name (URI) and a local
part.public static void assertXPath(String expr, Node context, Map<String,String> namespaceBindings)
expr
- A valid XPath 1.0 expression.context
- The context node.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 assertSchemaValid(Validator validator, Source source)
validator
- The Validator to use.source
- The XML Source to be validated.public static void assertSchematronValid(URL schemaRef, Source xmlSource, String activePhase)
schemaRef
- A URL that denotes the location of a Schematron schema.xmlSource
- The XML Source to be validated.activePhase
- The active phase (pattern set) whose patterns are used for
validation; this is set to "#ALL" if not specified.public static void assertDescendantElementCount(Document xmlEntity, QName elementName, int expectedCount)
xmlEntity
- A Document representing an XML entity.elementName
- The qualified name of the element.expectedCount
- The expected number of occurrences.public static void assertExceptionReport(com.sun.jersey.api.client.ClientResponse rsp, String exceptionCode, String locator)
rsp
- A ClientResponse object representing an HTTP response message.exceptionCode
- The expected OGC exception code.locator
- A case-insensitive string value expected to occur in the
locator attribute (e.g. a parameter name); the attribute value
will be ignored if the argument is null or empty.Copyright © 2022 Open Geospatial Consortium. All rights reserved.