Class SQLiteContainerTests

java.lang.Object
org.opengis.cite.gpkg12.CommonFixture
org.opengis.cite.gpkg12.core.SQLiteContainerTests

public class SQLiteContainerTests extends CommonFixture
Defines test methods that apply to an SQLite database file. The GeoPackage standard defines a SQL database schema designed for use with the SQLite software library.

Sources

Author:
Richard Martell, Luke Lambert
  • Constructor Details

    • SQLiteContainerTests

      public SQLiteContainerTests()
  • Method Details

    • fileHeaderString

      public void fileHeaderString() throws IOException
      A GeoPackage shall be a SQLite database file using version 3 of the SQLite file format. The first 16 bytes of a GeoPackage must contain the (UTF-8/ASCII) string "SQLite format 3", including the terminating NULL character.
      Throws:
      IOException - If an I/O error occurs while trying to read the data file.
      See Also:
    • applicationID

      public void applicationID() throws SQLException, IOException
      A GeoPackage SHALL contain a value of 0x47504B47 ("GPKG" in ASCII) in the "application_id" field of the SQLite database header to indicate that it is a GeoPackage. A GeoPackage SHALL contain an appropriate value in "user_version" field of the SQLite database header to indicate its version. The value SHALL be in integer with a major version, two-digit minor version, and two-digit bug-fix. For GeoPackage Version 1.2 this value is 0x000027D8 (the hexadecimal value for 10200).
      Throws:
      IOException - If an I/O error occurs while trying to read the data file.
      SQLException - If an SQL query causes an error
      See Also:
    • filenameExtension

      public void filenameExtension()
      A GeoPackage shall have the file extension name ".gpkg".
      See Also:
    • fileContents

      public void fileContents() throws SQLException
      A GeoPackage shall only contain data elements, SQL constructs and GeoPackage extensions with the "gpkg" author name specified in this encoding standard.
      Throws:
      SQLException - on any error
      See Also:
    • pragmaIntegrityCheck

      public void pragmaIntegrityCheck() throws SQLException
      The SQLite PRAGMA integrity_check SQL command SHALL return "ok" for a GeoPackage file.
      Throws:
      SQLException - If an SQL query causes an error
      See Also:
    • foreignKeyCheck

      public void foreignKeyCheck() throws SQLException
      The SQLite PRAGMA foreign_key_check SQL with no parameter value SHALL return an empty result set indicating no invalid foreign key values for a GeoPackage file.
      Throws:
      SQLException - If an SQL query causes an error
      See Also:
    • sqlCheck

      public void sqlCheck() throws SQLException
      A GeoPackage SQLite Configuration SHALL provide SQL access to GeoPackage contents via software APIs.
      Throws:
      SQLException - If an SQL query causes an error
      See Also: