Class WmtsAssertion
java.lang.Object
org.opengeospatial.cite.wmts10.ets.core.assertion.WmtsAssertion
Provides WMTS 1.0.0 specific test assertion methods
- Author:
- Lyn Goltz (original), Jim Beatty (modified/fixed May/Jun/Jul-2017 for WMS/WMTS)
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidassertContentType(jakarta.ws.rs.core.MultivaluedMap<String, Object> headers, String expectedContentType) Asserts that the actual content type matches the expected content type.static voidassertContentType(org.testng.asserts.SoftAssert sa, jakarta.ws.rs.core.MultivaluedMap<String, Object> headers, String expectedContentType) Asserts that the actual content type matches the expected content type.static voidAsserts that the given DOM document has the expected root element 'WMTS_Capabilities' in namespace {http://www.opengis.net/wmts}.static voidassertStatusCode(int actualCode, int... expectedCodes) Asserts that the actual HTTP status code matches one of the expected status codes.static voidassertStatusCode(org.testng.asserts.SoftAssert sa, int actualCode, int... expectedCodes) Asserts that the actual HTTP status code matches one of the expected status codes.static voidassertUriIsResolvable(org.testng.asserts.SoftAssert sa, String url) Asserts that the url is resolvable (status code is 200).static voidAsserts that the string is a valid url.static voidAsserts that the string is a valid url.static voidassertVersion100(Document response) Asserts that the actual content type matches the expected content type.static voidassertXPath(String expr, Node context, de.latlon.ets.core.util.NamespaceBindings nsBindings) Asserts that an XPath 1.0 expression holds true for the given evaluation context.static voidassertXPath(org.testng.asserts.SoftAssert sa, String expr, Node context, de.latlon.ets.core.util.NamespaceBindings nsBindings) Asserts that an XPath 1.0 expression holds true for the given evaluation context.
-
Method Details
-
assertSimpleWMTSCapabilities
Asserts that the given DOM document has the expected root element 'WMTS_Capabilities' in namespace {http://www.opengis.net/wmts}.- Parameters:
doc- A Document node having {http://www.opengis.net/wmts} "Capabilities" as the root element.
-
assertVersion100
Asserts that the actual content type matches the expected content type.- Parameters:
response- A Document node having {http://www.opengis.net/wmts} "Capabilities" as the root element.
-
assertStatusCode
public static void assertStatusCode(org.testng.asserts.SoftAssert sa, int actualCode, int... expectedCodes) Asserts that the actual HTTP status code matches one of the expected status codes.- Parameters:
sa- an optional assertion class to delay terminating test and handle in the calling routineactualCode- The actual status code.expectedCodes- An int[] array containing the expected status codes.
-
assertStatusCode
public static void assertStatusCode(int actualCode, int... expectedCodes) Asserts that the actual HTTP status code matches one of the expected status codes.- Parameters:
actualCode- The actual status code.expectedCodes- An int[] array containing the expected status codes.
-
assertContentType
public static void assertContentType(org.testng.asserts.SoftAssert sa, jakarta.ws.rs.core.MultivaluedMap<String, Object> headers, String expectedContentType) Asserts that the actual content type matches the expected content type.- Parameters:
sa- an optional assertion class to delay terminating test and handle in the calling routineheaders- The header of the response.expectedContentType- The expected content type, nevernull.
-
assertContentType
public static void assertContentType(jakarta.ws.rs.core.MultivaluedMap<String, Object> headers, String expectedContentType) Asserts that the actual content type matches the expected content type.- Parameters:
headers- The header of the response.expectedContentType- The expected content type, nevernull.
-
assertUrl
Asserts that the string is a valid url.- Parameters:
sa- an optional assertion class to delay terminating test and handle in the calling routineurl- The url to check.
-
assertUrl
Asserts that the string is a valid url.- Parameters:
url- The url to check.
-
assertUriIsResolvable
Asserts that the url is resolvable (status code is 200).- Parameters:
sa- an optional assertion class to delay terminating test and handle in the calling routineurl- The url to check.
-
assertXPath
public static void assertXPath(org.testng.asserts.SoftAssert sa, String expr, Node context, de.latlon.ets.core.util.NamespaceBindings nsBindings) Asserts that an XPath 1.0 expression holds true for the given evaluation context. The method arguments will be logged at level FINE or lower.- Parameters:
sa- an optional assertion class to delay terminating test and handle in the calling routineexpr- A valid XPath 1.0 expression.context- The context node.nsBindings- A collection of namespace bindings for the XPath expression, where each entry maps a namespace URI (key) to a prefix (value). Nevernull.
-
assertXPath
public static void assertXPath(String expr, Node context, de.latlon.ets.core.util.NamespaceBindings nsBindings) Asserts that an XPath 1.0 expression holds true for the given evaluation context. The method arguments will be logged at level FINE or lower.- Parameters:
expr- A valid XPath 1.0 expression.context- The context node.nsBindings- A collection of namespace bindings for the XPath expression, where each entry maps a namespace URI (key) to a prefix (value). Nevernull.
-