Class StyleTests

java.lang.Object
org.opengis.cite.kml22.BaseFixture
org.opengis.cite.kml22.level1.StyleTests

public class StyleTests extends BaseFixture
Contains test methods that apply to style definitions.
See Also:
  • "OGC 07-134r2: OGC KML 2.2 - Abstract Test Suite"
  • Field Summary

    Fields inherited from class org.opengis.cite.kml22.BaseFixture

    NS_MAP, testSubject
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) void
    addError(Node node, String msgKey, org.opengis.cite.validation.ValidationErrorHandler errHandler)
     
    (package private) void
    checkFragmentIdentifier(Node styleUrl, org.opengis.cite.validation.ValidationErrorHandler errHandler)
    An error is produced if a kml:styleUrl does not contain fragment identifier ("#").
    (package private) void
    checkStyleTarget(Node styleUrl, org.opengis.cite.validation.ValidationErrorHandler errHandler)
    An error is produced if a kml:styleUrl does not refer to a valid style element (which substitutes for kml:AbstractStyleSelectorGroup).
    (package private) void
    checkUriScheme(Node styleUrl, org.opengis.cite.validation.ValidationErrorHandler errHandler)
    An error is produced if an absolute kml:styleUrl is not of a supported URI scheme (http).
    void
    [Test] Verifies that if a kml:ItemIcon element (with parent kml:ListStyle) is not a descendant of kml:Update, then it has a kml:href child element (that specifies the location of the image used in the list view).
    void
    [Test] Verifies that if a style element (any element that may substitute for kml:AbstractStyleSelectorGroup) has a parent kml:Document it is a 'shared' style.
    void
    [Test] Verifies that if a kml:StyleMap/kml:Pair element is not a descendant of kml:Update, then it contains (a) a kml:key element, and (b) at least one of kml:styleURL element or any element that substitutes for kml:AbstractStyleSelectorGroup (kml:Style, kml:StyleMap).
    void
    [Test] Verifies that a kml:styleUrl element satisfies all of the following constraints: its value is a valid relative or absolute URL that refers to a shared style definition (any element that substitutes for kml:AbstractStyleSelectorGroup); if the reference is an absolute URI, the value conforms to the 'http' or 'file' URI schemes; it includes a fragment identifier conforming to the shorthand pointer syntax as defined in the W3C XPointer framework. A relative URL is resolved according to the reference resolution algorithm described in section 5 of RFC 3986.

    Methods inherited from class org.opengis.cite.kml22.BaseFixture

    obtainTestSubject, setTestSubject, verifyElementNotEmpty

    Methods inherited from class java.lang.Object

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

    • StyleTests

      public StyleTests()
  • Method Details

    • verifyStyleReference

      public void verifyStyleReference()
      [Test] Verifies that a kml:styleUrl element satisfies all of the following constraints:
      1. its value is a valid relative or absolute URL that refers to a shared style definition (any element that substitutes for kml:AbstractStyleSelectorGroup);
      2. if the reference is an absolute URI, the value conforms to the 'http' or 'file' URI schemes;
      3. it includes a fragment identifier conforming to the shorthand pointer syntax as defined in the W3C XPointer framework.
      A relative URL is resolved according to the reference resolution algorithm described in section 5 of RFC 3986.
      See Also:
    • verifySharedStyleHasId

      public void verifySharedStyleHasId()
      [Test] Verifies that if a style element (any element that may substitute for kml:AbstractStyleSelectorGroup) has a parent kml:Document it is a 'shared' style. All shared styles must have the 'id' attribute present. Shared styles include kml:Style and kml:StyleMap elements.
      See Also:
      • "OGC 07-134r2, ATC 7: Shared style definition"
    • verifyStyleMap

      public void verifyStyleMap()
      [Test] Verifies that if a kml:StyleMap/kml:Pair element is not a descendant of kml:Update, then it contains (a) a kml:key element, and (b) at least one of kml:styleURL element or any element that substitutes for kml:AbstractStyleSelectorGroup (kml:Style, kml:StyleMap).
      See Also:
      • "OGC 07-134r2, ATC 36: Pair"
    • verifyItemIconURI

      public void verifyItemIconURI()
      [Test] Verifies that if a kml:ItemIcon element (with parent kml:ListStyle) is not a descendant of kml:Update, then it has a kml:href child element (that specifies the location of the image used in the list view).
      See Also:
      • "OGC 07-134r2, ATC 37: ItemIcon"
    • checkFragmentIdentifier

      void checkFragmentIdentifier(Node styleUrl, org.opengis.cite.validation.ValidationErrorHandler errHandler)
      An error is produced if a kml:styleUrl does not contain fragment identifier ("#").
      Parameters:
      styleUrl - A kml:styleUrl element.
      errHandler - The error handler that receives any errors that were detected.
    • checkUriScheme

      void checkUriScheme(Node styleUrl, org.opengis.cite.validation.ValidationErrorHandler errHandler)
      An error is produced if an absolute kml:styleUrl is not of a supported URI scheme (http).
      Parameters:
      styleUrl - A kml:styleUrl element.
      errHandler - The error handler that receives any errors that were detected.
    • checkStyleTarget

      void checkStyleTarget(Node styleUrl, org.opengis.cite.validation.ValidationErrorHandler errHandler)
      An error is produced if a kml:styleUrl does not refer to a valid style element (which substitutes for kml:AbstractStyleSelectorGroup).
      Parameters:
      styleUrl - A kml:styleUrl element.
      errHandler - The error handler that receives any errors that were detected.
    • addError

      void addError(Node node, String msgKey, org.opengis.cite.validation.ValidationErrorHandler errHandler)
      Parameters:
      node - node
      msgKey - msgKey
      errHandler - errHandler