java.lang.Object
org.opengeospatial.cite.wmts10.ets.core.assertion.WmtsAssertion

public final class WmtsAssertion extends Object
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 Type
    Method
    Description
    static void
    assertContentType(jakarta.ws.rs.core.MultivaluedMap<String,Object> headers, String expectedContentType)
    Asserts that the actual content type matches the expected content type.
    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.
    static void
    Asserts that the given DOM document has the expected root element 'WMTS_Capabilities' in namespace {http://www.opengis.net/wmts}.
    static void
    assertStatusCode(int actualCode, int... expectedCodes)
    Asserts that the actual HTTP status code matches one of the expected status codes.
    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.
    static void
    assertUriIsResolvable(org.testng.asserts.SoftAssert sa, String url)
    Asserts that the url is resolvable (status code is 200).
    static void
    Asserts that the string is a valid url.
    static void
    assertUrl(org.testng.asserts.SoftAssert sa, String url)
    Asserts that the string is a valid url.
    static void
    Asserts that the actual content type matches the expected content type.
    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.
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • assertSimpleWMTSCapabilities

      public static void assertSimpleWMTSCapabilities(Document doc)
      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

      public static void assertVersion100(Document response)
      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 routine
      actualCode - 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 routine
      headers - The header of the response.
      expectedContentType - The expected content type, never null.
    • 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, never null.
    • assertUrl

      public static void assertUrl(org.testng.asserts.SoftAssert sa, String url)
      Asserts that the string is a valid url.
      Parameters:
      sa - an optional assertion class to delay terminating test and handle in the calling routine
      url - The url to check.
    • assertUrl

      public static void assertUrl(String url)
      Asserts that the string is a valid url.
      Parameters:
      url - The url to check.
    • assertUriIsResolvable

      public static void assertUriIsResolvable(org.testng.asserts.SoftAssert sa, String url)
      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 routine
      url - 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 routine
      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). Never null.
    • 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). Never null.