public class CommonFixture extends Object
| Modifier and Type | Field and Description |
|---|---|
protected Connection |
databaseConnection |
protected DataSource |
dataSource
A JDBC DataSource for accessing the SQLite database.
|
protected GeoPackageVersion |
geopackageVersion |
protected File |
gpkgFile
A SQLite database file containing a GeoPackage.
|
static String |
ROOT_PKG_PATH
Root test suite package (absolute path).
|
| Constructor and Description |
|---|
CommonFixture() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkPrimaryKey(String tableName,
String pkName,
boolean enforcePk)
This function checks to determine whether the primary key is valid.
|
void |
close() |
protected String |
getPrimaryKeyColumn(String tableName,
boolean enforcePk)
This function returns the name of a single primary key column for the given table
|
String |
getTestName() |
void |
initCommonFixture(ITestContext testContext)
Initializes the common test fixture.
|
protected boolean |
isExtendedType(String tableName,
String columnName)
This function accounts for extensions to Requirement 5 and 25
|
void |
setTestName(String testName) |
void |
validateClassEnabled(ITestContext testContext) |
public static final String ROOT_PKG_PATH
protected File gpkgFile
protected DataSource dataSource
protected Connection databaseConnection
protected GeoPackageVersion geopackageVersion
public void initCommonFixture(ITestContext testContext) throws SQLException, IOException
testContext - The test context that contains all the information for a test
run, including suite attributes.SQLException - If a database access error occurs.IOException - If attempts to detect the database version failpublic void close()
throws SQLException
SQLExceptionpublic void validateClassEnabled(ITestContext testContext) throws IOException
IOExceptionprotected String getPrimaryKeyColumn(String tableName, boolean enforcePk) throws SQLException
tableName - the name of the tableenforcePk - true: the column must be a primary key
false: default to the first column as long as it is an integerSQLException - on any errorprotected boolean isExtendedType(String tableName, String columnName) throws SQLException
tableName - the table name to inspectcolumnName - the column name to inspectSQLException - on any errorprotected void checkPrimaryKey(String tableName, String pkName, boolean enforcePk) throws SQLException
tableName - the name of the table (required)pkName - the name of the required primary key (may be null, in which case it is detected)enforcePk - true: the column must be a primary key, false: the column may be PK-like, an integer with unique valuesSQLException - on any errorpublic String getTestName()
public void setTestName(String testName)
Copyright © 2021 Open Geospatial Consortium. All rights reserved.