KML 2.2 Conformance Test Suite


This test suite validates KML 2.2 documents according to the following specifications:

Three conformance levels are defined, where each level builds upon the lower level by adding additional constraints. Level 2 extends Level 1, and Level 3 is based on Level 2. A conforming implementation must produce documents that validate at level 1 in order to obtain an OGC compliance certificate.

  • Level 1 - includes test cases covering requirements that must be satisfied by a minimally conformant document;
  • Level 2 - as for Level 1, plus test cases addressing recommended constraints;
  • Level 3 - as for Level 2, plus test cases covering suggested constraints that are informative in nature.

Organization of the test suite

The test suite implements the test cases defined in the abstract test suite (ATS). The Java implementation classes generally correspond to a logical theme. For example the TemporalElementTests class realizes the following test cases:

All of the test cases are described in the ATS. More details about the implementation are explained in the next section.

Structure of the source code

The TestNG suite definition file (testng.xml) is located in the root package, org.opengis.cite.kml22. A conformance class corresponds to a <test> element; each test element includes a set of test classes that contain the actual test methods. The essential structure of the test suite is shown in Table 1.

Table 1 - Test suite structure
Conformance class Test classes
Level 1
  • org.opengis.cite.kml22.level1.KmlDocumentTests
  • org.opengis.cite.kml22.level1.SpatialTests
  • org.opengis.cite.kml22.level1.StyleTests
  • org.opengis.cite.kml22.level1.TemporalElementTests
  • org.opengis.cite.kml22.level1.LinkTests
  • org.opengis.cite.kml22.level1.FeatureTests
  • org.opengis.cite.kml22.level1.UserDefinedDataTests
  • org.opengis.cite.kml22.level1.ViewTests
Level 2
  • org.opengis.cite.kml22.level2.Level2Tests
  • org.opengis.cite.kml22.level2.Recommendations
  • org.opengis.cite.kml22.level2.StyleRecommendations
Level 3
  • org.opengis.cite.kml22.level3.Level3Tests
  • org.opengis.cite.kml22.level3.Options

The Javadoc documentation provides more detailed information about the test classes and test methods that comprise the suite.

How to run the tests

The test suite may be run in any of the following environments:

  • TEAM-Engine in a web application environment
  • TEAM-Engine in a command-line environment: Run the CTL script located in the /src/main/ctl/ directory.
  • Integrated development environment (IDE): The main Java class is TestNGController.
  • REST API: Submit a request that includes the necessary arguments to the test run controller (/rest/suites/kml22/1.12/run).

The test run arguments are summarized in Table 2. The value domain is expressed in terms of XML Schema datatypes for convenience. The Obligation descriptor can have the following values: M (mandatory), O (optional), or C (conditional).

Table 2 - Test run arguments
Name Value domain Obligation Description
iut anyURI M A URI that refers to the instance document under test. Ampersand ('&') characters must be percent-encoded as '%26'.
ics positiveInteger O Indicates which conformance level (1-3) will be used to validate the instance document. If not specified, the lowest conformance level will be checked (ics=1).

Reference implementation and sample files

The reference implementation is the LIBKML Driver in the GDAL (Geospatial Data Abstraction Library ) 1.11.0 library. Sample files created using the driver are available in a zip file here.


Feedback and suggestions are very welcome. Please use the GitHub issue tracker. More general questions about any aspect of OGC conformance testing should be directed to the CITE Forum.