Package net.officefloor.jdbc.test
Class AbstractJdbcTestCase
- java.lang.Object
-
- net.officefloor.jdbc.test.AbstractJdbcTestCase
-
public abstract class AbstractJdbcTestCase extends java.lang.ObjectAbstract tests for an JDBC vendor implementation.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractJdbcTestCase.ConnectionDecoratorSectionstatic classAbstractJdbcTestCase.ConnectivitySectionstatic interfaceAbstractJdbcTestCase.Flowsstatic classAbstractJdbcTestCase.InsertSectionstatic classAbstractJdbcTestCase.NewThreadstatic classAbstractJdbcTestCase.SelectParameterstatic classAbstractJdbcTestCase.SelectSection
-
Field Summary
Fields Modifier and Type Field Description protected java.sql.ConnectionconnectionConnection.
-
Constructor Summary
Constructors Constructor Description AbstractJdbcTestCase()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voidcleanDatabase(java.sql.Connection connection)Cleans the database.protected abstract java.lang.Class<? extends DataSourceManagedObjectSource>getDataSourceManagedObjectSourceClass()Obtains theDataSourceManagedObjectSourceClassbeing tested.protected abstract java.lang.Class<? extends ReadOnlyConnectionManagedObjectSource>getReadOnlyConnectionManagedObjectSourceClass()Obtains theReadOnlyConnectionManagedObjectSourceClassbeing tested.protected abstract voidloadConnectionProperties(PropertyConfigurable mos)Loads the properties for theReadOnlyConnectionManagedObjectSource.protected abstract voidloadDataSourceProperties(PropertyConfigurable mos)Loads the properties for theDataSourceManagedObjectSource.protected voidloadOptionalConnectionSpecification(java.util.Properties properties)Enables adding additionalConnectionproperties to specification.protected voidloadOptionalDataSourceSpecification(java.util.Properties properties)Enables adding additionalDataSourceproperties to specification.protected voidsetUp()protected voidtearDown()voidtestDataSourceConnectionManagement()Ensure connection management forDataSource.voidtestDataSourceConnectionManagementViaProxy()Ensure connection management forDataSource.voidtestDataSourceConnectivity()EnsureDataSourceconnectivity.voidtestDataSourceSelectStress(org.junit.jupiter.api.TestInfo testInfo)Undertakes select stress forDataSource.voidtestDataSourceSelectStressWithDynamicProxy(org.junit.jupiter.api.TestInfo testInfo)Undertakes select stress for writableConnectionwithProxy.voidtestDataSourceSpecification()Ensure correct specification forDataSource.voidtestDataSourceType()Ensure correct type forDataSource.voidtestDataSourceValidateConnectivity()Ensure 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.voidtestReadOnlyConnectionManagement()Ensure connection management for read-onlyConnection.voidtestReadOnlyConnectionManagementViaProxy()Ensure connection management for read-onlyConnection.voidtestReadOnlyConnectionSpecification()Ensure correct specification for read-onlyConnection.voidtestReadOnlyConnectivity()Ensure 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.voidtestReadOnlyType()Ensure correct type for read-onlyConnection.voidtestReadOnlyValidateConnectivity()Ensure correct type for read-onlyConnection.
-
-
-
Method Detail
-
getReadOnlyConnectionManagedObjectSourceClass
protected abstract java.lang.Class<? extends ReadOnlyConnectionManagedObjectSource> getReadOnlyConnectionManagedObjectSourceClass()
Obtains theReadOnlyConnectionManagedObjectSourceClassbeing tested.- Returns:
ReadOnlyConnectionManagedObjectSourceClassbeing tested.
-
getDataSourceManagedObjectSourceClass
protected abstract java.lang.Class<? extends DataSourceManagedObjectSource> getDataSourceManagedObjectSourceClass()
Obtains theDataSourceManagedObjectSourceClassbeing tested.- Returns:
DataSourceManagedObjectSourceClassbeing tested.
-
loadConnectionProperties
protected abstract void loadConnectionProperties(PropertyConfigurable mos)
Loads the properties for theReadOnlyConnectionManagedObjectSource.- Parameters:
mos-PropertyConfigurable.
-
loadDataSourceProperties
protected abstract void loadDataSourceProperties(PropertyConfigurable mos)
Loads the properties for theDataSourceManagedObjectSource.- Parameters:
mos-PropertyConfigurable.
-
cleanDatabase
protected abstract void cleanDatabase(java.sql.Connection connection) throws java.sql.SQLExceptionCleans the database.- Parameters:
connection-Connection.- Throws:
java.sql.SQLException- On failure to clean up the database.
-
setUp
@BeforeEach protected void setUp() throws java.lang.Exception- Throws:
java.lang.Exception
-
tearDown
@AfterEach protected void tearDown() throws java.lang.Exception- Throws:
java.lang.Exception
-
loadOptionalConnectionSpecification
protected void loadOptionalConnectionSpecification(java.util.Properties properties)
Enables adding additionalConnectionproperties to specification.- Parameters:
properties-Propertiesto be loaded with additional specification.
-
loadOptionalDataSourceSpecification
protected void loadOptionalDataSourceSpecification(java.util.Properties properties)
Enables adding additionalDataSourceproperties to specification.- Parameters:
properties-Propertiesto be loaded with additional specification.
-
testReadOnlyConnectionSpecification
@Test public void testReadOnlyConnectionSpecification() throws java.lang.ExceptionEnsure correct specification for read-onlyConnection.- Throws:
java.lang.Exception- On test failure.
-
testDataSourceSpecification
@Test public void testDataSourceSpecification() throws java.lang.ExceptionEnsure correct specification forDataSource.- Throws:
java.lang.Exception- On test failure.
-
testReadOnlyType
@Test public void testReadOnlyType() throws java.lang.ExceptionEnsure correct type for read-onlyConnection.- Throws:
java.lang.Exception- On test failure.
-
testDataSourceType
@Test public void testDataSourceType() throws java.lang.ExceptionEnsure correct type forDataSource.- Throws:
java.lang.Exception- On test failure.
-
testReadOnlyConnectivity
@Test public void testReadOnlyConnectivity() throws java.lang.ThrowableEnsure read-only connectivity.- Throws:
java.lang.Throwable
-
testDataSourceConnectivity
@Test public void testDataSourceConnectivity() throws java.lang.ThrowableEnsureDataSourceconnectivity.- Throws:
java.lang.Throwable
-
testReadOnlyConnectionManagement
@Test public void testReadOnlyConnectionManagement() throws java.lang.ThrowableEnsure connection management for read-onlyConnection.- Throws:
java.lang.Exception- On test failure.java.lang.Throwable
-
testReadOnlyConnectionManagementViaProxy
@Test public void testReadOnlyConnectionManagementViaProxy() throws java.lang.ThrowableEnsure connection management for read-onlyConnection.- Throws:
java.lang.Exception- On test failure.java.lang.Throwable
-
testDataSourceConnectionManagement
@Test public void testDataSourceConnectionManagement() throws java.lang.ThrowableEnsure connection management forDataSource.- Throws:
java.lang.Exception- On test failure.java.lang.Throwable
-
testDataSourceConnectionManagementViaProxy
@Test public void testDataSourceConnectionManagementViaProxy() throws java.lang.ThrowableEnsure connection management forDataSource.- Throws:
java.lang.Exception- On test failure.java.lang.Throwable
-
testReadOnlyValidateConnectivity
@Test public void testReadOnlyValidateConnectivity() throws java.lang.ExceptionEnsure correct type for read-onlyConnection.- Throws:
java.lang.Exception- On test failure.
-
testDataSourceValidateConnectivity
@Test public void testDataSourceValidateConnectivity() throws java.lang.ExceptionEnsure correct type forDataSource.- Throws:
java.lang.Exception- On test failure.
-
testInsertConnectionStressWithCompiler
public void testInsertConnectionStressWithCompiler(org.junit.jupiter.api.TestInfo testInfo) throws java.lang.ThrowableEnsure can stress test against the database with compiled wrappers.- Throws:
java.lang.Throwable- On test failure.
-
testInsertConnectionStressWithDynamicProxy
public void testInsertConnectionStressWithDynamicProxy(org.junit.jupiter.api.TestInfo testInfo) throws java.lang.ThrowableEnsure can stress test against the database withProxy.- Throws:
java.lang.Throwable- On test failure.
-
testInsertConnectionTransactionStressWithCompiler
public void testInsertConnectionTransactionStressWithCompiler(org.junit.jupiter.api.TestInfo testInfo) throws java.lang.ThrowableEnsure can stress test against the database with transactions with compiled wrappers.- Throws:
java.lang.Throwable- On test failure.
-
testInsertConnectionTransactionStressWithDynamicProxy
public void testInsertConnectionTransactionStressWithDynamicProxy(org.junit.jupiter.api.TestInfo testInfo) throws java.lang.ThrowableEnsure can stress test against the database with transactions.- Throws:
java.lang.Throwable- On test failure.
-
testReadOnlySelectStressWithCompiler
public void testReadOnlySelectStressWithCompiler(org.junit.jupiter.api.TestInfo testInfo) throws java.lang.ThrowableUndertakes select stress for read-onlyConnectionwith compiled wrappers.- Throws:
java.lang.Throwable- On test failure.
-
testReadOnlySelectStressWithDynamicProxy
public void testReadOnlySelectStressWithDynamicProxy(org.junit.jupiter.api.TestInfo testInfo) throws java.lang.ThrowableUndertakes select stress for read-onlyConnectionwithProxy.- Throws:
java.lang.Throwable- On test failure.
-
testDataSourceSelectStress
public void testDataSourceSelectStress(org.junit.jupiter.api.TestInfo testInfo) throws java.lang.ThrowableUndertakes select stress forDataSource.- Throws:
java.lang.Throwable- On test failure.
-
testDataSourceSelectStressWithDynamicProxy
public void testDataSourceSelectStressWithDynamicProxy(org.junit.jupiter.api.TestInfo testInfo) throws java.lang.ThrowableUndertakes select stress for writableConnectionwithProxy.- Throws:
java.lang.Throwable- On test failure.
-
-