Package net.officefloor.jdbc.test
Class AbstractJdbcTestCase
java.lang.Object
net.officefloor.jdbc.test.AbstractJdbcTestCase
Abstract tests for an JDBC vendor implementation.
- Author:
- Daniel Sagenschneider
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classTest fixture section for checking connection decoration.static classTest fixture section for checking connectivity.static interfaceFlow interface.static classTest fixture section for inserting rows.static classMarker for new thread.static classParameter holding the selected name value.static classTest fixture section for selecting rows. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidcleanDatabase(Connection connection) Cleans the database.protected abstract Class<? extends DataSourceManagedObjectSource>Obtains theDataSourceManagedObjectSourceClassbeing tested.protected abstract Class<? extends ReadOnlyConnectionManagedObjectSource>Obtains theReadOnlyConnectionManagedObjectSourceClassbeing tested.protected abstract voidLoads the properties for theReadOnlyConnectionManagedObjectSource.protected abstract voidLoads the properties for theDataSourceManagedObjectSource.protected voidloadOptionalConnectionSpecification(Properties properties) Enables adding additionalConnectionproperties to specification.protected voidloadOptionalDataSourceSpecification(Properties properties) Enables adding additionalDataSourceproperties to specification.protected voidsetUp()Sets up the test.protected voidtearDown()Tears down the test.voidEnsure connection management forDataSource.voidEnsure connection management forDataSource.voidEnsureDataSourceconnectivity.voidtestDataSourceSelectStress(org.junit.jupiter.api.TestInfo testInfo) Undertakes select stress forDataSource.voidtestDataSourceSelectStressWithDynamicProxy(org.junit.jupiter.api.TestInfo testInfo) Undertakes select stress for writableConnectionwithProxy.voidEnsure correct specification forDataSource.voidEnsure correct type forDataSource.voidEnsure correct type forDataSource.voidtestInsertConnectionStressWithCompiler(org.junit.jupiter.api.TestInfo testInfo) Ensure can stress test against the database with compiled wrappers.voidtestInsertConnectionStressWithDynamicProxy(org.junit.jupiter.api.TestInfo testInfo) Ensure can stress test against the database withProxy.voidtestInsertConnectionTransactionStressWithCompiler(org.junit.jupiter.api.TestInfo testInfo) Ensure can stress test against the database with transactions with compiled wrappers.voidtestInsertConnectionTransactionStressWithDynamicProxy(org.junit.jupiter.api.TestInfo testInfo) Ensure can stress test against the database with transactions.voidEnsure connection management for read-onlyConnection.voidEnsure connection management for read-onlyConnection.voidEnsure correct specification for read-onlyConnection.voidEnsure read-only connectivity.voidtestReadOnlySelectStressWithCompiler(org.junit.jupiter.api.TestInfo testInfo) Undertakes select stress for read-onlyConnectionwith compiled wrappers.voidtestReadOnlySelectStressWithDynamicProxy(org.junit.jupiter.api.TestInfo testInfo) Undertakes select stress for read-onlyConnectionwithProxy.voidEnsure correct type for read-onlyConnection.voidEnsure correct type for read-onlyConnection.
-
Field Details
-
connection
Connection. KeepConnectionto database for in memory databases to stay alive.
-
-
Constructor Details
-
AbstractJdbcTestCase
public AbstractJdbcTestCase()
-
-
Method Details
-
getReadOnlyConnectionManagedObjectSourceClass
protected abstract Class<? extends ReadOnlyConnectionManagedObjectSource> getReadOnlyConnectionManagedObjectSourceClass()Obtains theReadOnlyConnectionManagedObjectSourceClassbeing tested.- Returns:
ReadOnlyConnectionManagedObjectSourceClassbeing tested.
-
getDataSourceManagedObjectSourceClass
protected abstract Class<? extends DataSourceManagedObjectSource> getDataSourceManagedObjectSourceClass()Obtains theDataSourceManagedObjectSourceClassbeing tested.- Returns:
DataSourceManagedObjectSourceClassbeing tested.
-
loadConnectionProperties
Loads the properties for theReadOnlyConnectionManagedObjectSource.- Parameters:
mos-PropertyConfigurable.
-
loadDataSourceProperties
Loads the properties for theDataSourceManagedObjectSource.- Parameters:
mos-PropertyConfigurable.
-
cleanDatabase
Cleans the database.- Parameters:
connection-Connection.- Throws:
SQLException- On failure to clean up the database.
-
setUp
Sets up the test.- Throws:
Exception- On test failure.
-
tearDown
Tears down the test.- Throws:
Exception- On test failure.
-
loadOptionalConnectionSpecification
Enables adding additionalConnectionproperties to specification.- Parameters:
properties-Propertiesto be loaded with additional specification.
-
loadOptionalDataSourceSpecification
Enables adding additionalDataSourceproperties to specification.- Parameters:
properties-Propertiesto be loaded with additional specification.
-
testReadOnlyConnectionSpecification
Ensure correct specification for read-onlyConnection.- Throws:
Exception- On test failure.
-
testDataSourceSpecification
Ensure correct specification forDataSource.- Throws:
Exception- On test failure.
-
testReadOnlyType
Ensure correct type for read-onlyConnection.- Throws:
Exception- On test failure.
-
testDataSourceType
Ensure correct type forDataSource.- Throws:
Exception- On test failure.
-
testReadOnlyConnectivity
Ensure read-only connectivity.- Throws:
Throwable- On test failure.
-
testDataSourceConnectivity
EnsureDataSourceconnectivity.- Throws:
Throwable- On test failure.
-
testReadOnlyConnectionManagement
Ensure connection management for read-onlyConnection. -
testReadOnlyConnectionManagementViaProxy
Ensure connection management for read-onlyConnection. -
testDataSourceConnectionManagement
Ensure connection management forDataSource. -
testDataSourceConnectionManagementViaProxy
Ensure connection management forDataSource. -
testReadOnlyValidateConnectivity
Ensure correct type for read-onlyConnection.- Throws:
Exception- On test failure.
-
testDataSourceValidateConnectivity
Ensure correct type forDataSource.- Throws:
Exception- On test failure.
-
testInsertConnectionStressWithCompiler
public void testInsertConnectionStressWithCompiler(org.junit.jupiter.api.TestInfo testInfo) throws Throwable Ensure can stress test against the database with compiled wrappers.- Parameters:
testInfo-TestInfo.- Throws:
Throwable- On test failure.
-
testInsertConnectionStressWithDynamicProxy
public void testInsertConnectionStressWithDynamicProxy(org.junit.jupiter.api.TestInfo testInfo) throws Throwable Ensure can stress test against the database withProxy.- Parameters:
testInfo-TestInfo.- Throws:
Throwable- On test failure.
-
testInsertConnectionTransactionStressWithCompiler
public void testInsertConnectionTransactionStressWithCompiler(org.junit.jupiter.api.TestInfo testInfo) throws Throwable Ensure can stress test against the database with transactions with compiled wrappers.- Parameters:
testInfo-TestInfo.- Throws:
Throwable- On test failure.
-
testInsertConnectionTransactionStressWithDynamicProxy
public void testInsertConnectionTransactionStressWithDynamicProxy(org.junit.jupiter.api.TestInfo testInfo) throws Throwable Ensure can stress test against the database with transactions.- Parameters:
testInfo-TestInfo.- Throws:
Throwable- On test failure.
-
testReadOnlySelectStressWithCompiler
public void testReadOnlySelectStressWithCompiler(org.junit.jupiter.api.TestInfo testInfo) throws Throwable Undertakes select stress for read-onlyConnectionwith compiled wrappers.- Parameters:
testInfo-TestInfo.- Throws:
Throwable- On test failure.
-
testReadOnlySelectStressWithDynamicProxy
public void testReadOnlySelectStressWithDynamicProxy(org.junit.jupiter.api.TestInfo testInfo) throws Throwable Undertakes select stress for read-onlyConnectionwithProxy.- Parameters:
testInfo-TestInfo.- Throws:
Throwable- On test failure.
-
testDataSourceSelectStress
Undertakes select stress forDataSource.- Parameters:
testInfo-TestInfo.- Throws:
Throwable- On test failure.
-
testDataSourceSelectStressWithDynamicProxy
public void testDataSourceSelectStressWithDynamicProxy(org.junit.jupiter.api.TestInfo testInfo) throws Throwable Undertakes select stress for writableConnectionwithProxy.- Parameters:
testInfo-TestInfo.- Throws:
Throwable- On test failure.
-