public class ETSAssert extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
assertDescendantElementCount(Node node,
QName elementName,
int expectedCount)
Asserts that the given DOM node contains the expected number of
descendant elements having the specified name.
|
static void |
assertQualifiedName(Node node,
QName... expectedNames)
Asserts that the qualified name of a DOM node matches one of the expected
values.
|
static void |
assertReferentExists(URI uri,
javax.ws.rs.core.MediaType... acceptableTypes)
Asserts that the resource referenced by the given URI exists and is
compatible with one of the acceptable media types.
|
static void |
assertSchematronValid(URL schemaRef,
Source xmlSource)
Asserts that an XML resource satisfies all applicable constraints
specified in a Schematron (ISO 19757-3) schema.
|
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 |
assertValidAltitudeMode(Element kmlElement)
Asserts that the value of the child element kml:altitudeMode is correct
according to the values of the kml:tessellate and kml:extrude elements.
|
static void |
assertValidEmailAddress(String emailAddr)
Asserts that a given email address conforms to the "addr-spec" production
in RFC 5322.
|
static void |
assertValidIRI(String id)
Asserts that a resource identifier is a valid internationalized resource
identifier (IRI).
|
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... expectedNames)
node - The Node to check.expectedNames - A collection of QName objects.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)
schemaRef - A URL that denotes the location of a Schematron schema.xmlSource - 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(Node node, QName elementName, int expectedCount)
node - A Document or Element node.elementName - The qualified name of the element.expectedCount - The expected number of occurrences.public static void assertValidAltitudeMode(Element kmlElement)
kmlElement - A KML (geometry) element.public static void assertReferentExists(URI uri, javax.ws.rs.core.MediaType... acceptableTypes)
uri - An absolute URI based on the 'file' or 'http(s)' schemes.acceptableTypes - A list of acceptable media types; if empty the media range is
unconstrained (any type).public static void assertValidEmailAddress(String emailAddr)
emailAddr - A String denoting an email address.public static void assertValidIRI(String id)
id - A String representing a resource identifier.Copyright © 2016 Open Geospatial Consortium. All rights reserved.