public abstract class AbstractQueryTransactionTest extends org.teiid.jdbc.AbstractQueryTest implements TransactionQueryTestCase
TransactionQueryTestCase
. This provides the default logic for perform a testcase.
The only method to implement in order to perform a basic, single datasource, test
is the testCase()
method.
AbstractQueryTransactionTest is the class that should be extended when a
testcase is being created to validate certain behavior
getSource(String)
. getXASource(String)
Modifier and Type | Field and Description |
---|---|
protected ConnectionStrategy |
connStrategy |
protected int |
fetchSize |
protected int |
queryTimeout |
protected String |
testname |
Constructor and Description |
---|
AbstractQueryTransactionTest() |
AbstractQueryTransactionTest(String testname) |
Modifier and Type | Method and Description |
---|---|
void |
after()
Override
after if there is behavior that needs to be
performed after testCase() being called. |
protected void |
assignExecutionProperties(Statement stmt) |
void |
before()
Override
before if there is behavior that needs to be
performed prior to testCase() being called. |
void |
cleanup()
At end of each test, perform any cleanup that your test requires.
|
boolean |
exceptionOccurred() |
Throwable |
getApplicationException() |
ConnectionStrategy |
getConnectionStrategy()
Called to get the current connection strategy being used.
|
SQLException |
getLastException() |
Connection |
getSource(String identifier)
The source connection must be asked from the connection strategy because only here
is it known which model was mapped to which datasource.
|
String |
getTestName()
Returns the name of the test so that better tracing of what tests are
running/completing.
|
XAConnection |
getXAConnection() |
XAConnection |
getXASource(String identifier) |
boolean |
rollbackAllways()
Indicates what should be done when a failure occurs in
testCase() |
void |
setApplicationException(Throwable t) |
void |
setup()
Override
setupDataSource if there is different mechanism for
setting up the datasources for the testcase |
protected void |
setupDataStore() |
abstract void |
testCase()
Implement testCase(), it is the entry point to the execution of the test.
|
assertReaderEquals, assertResults, assertResultsSetEquals, assertResultsSetEquals, assertResultsSetEquals, assertResultsSetEquals, assertResultsSetEquals, assertResultsSetEquals, assertResultsSetMetadataEquals, assertResultsSetMetadataEquals, assertRowCount, assertUpdateCount, cancelQuery, closeConnection, closeResultSet, closeStatement, compareCaseSensitive, compareResults, createPrepareCallStatement, createPrepareStatement, createStatement, exceptionExpected, execute, execute, executeAndAssertResults, executeBatch, executeBatch, getConnection, getRowCount, print, print, printResults, printResults, printResults, read, setConnection, tearDown, walkResults
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
exceptionExpected, getConnection, setConnection
protected String testname
protected int fetchSize
protected int queryTimeout
protected ConnectionStrategy connStrategy
public AbstractQueryTransactionTest()
public AbstractQueryTransactionTest(String testname)
public String getTestName()
TransactionQueryTestCase
getTestName
in interface TransactionQueryTestCase
public ConnectionStrategy getConnectionStrategy()
TransactionQueryTestCase
getConnectionStrategy
in interface TransactionQueryTestCase
protected void assignExecutionProperties(Statement stmt)
assignExecutionProperties
in class org.teiid.jdbc.AbstractQueryTest
public void setup() throws QueryTestFailedException
setupDataSource
if there is different mechanism for
setting up the datasources for the testcasesetup
in interface TransactionQueryTestCase
QueryTestFailedException
QueryTestFailedException
protected void setupDataStore()
public Connection getSource(String identifier) throws QueryTestFailedException
identifier
- QueryTestFailedException
public XAConnection getXASource(String identifier) throws QueryTestFailedException
QueryTestFailedException
public abstract void testCase() throws Exception
testCase
in interface TransactionQueryTestCase
Exception
public boolean rollbackAllways()
testCase()
rollbackAllways
in interface TransactionQueryTestCase
public void before()
before
if there is behavior that needs to be
performed prior to testCase()
being called.before
in interface TransactionQueryTestCase
public void after()
after
if there is behavior that needs to be
performed after testCase()
being called.after
in interface TransactionQueryTestCase
public void cleanup()
ConnectionStrategy.shutdown()
.
That is performed by the
TransactionContainer.runTransaction(TransactionQueryTestCase)
at the
end of the test.cleanup
in interface TransactionQueryTestCase
public XAConnection getXAConnection()
getXAConnection
in interface TransactionQueryTestCase
public void setApplicationException(Throwable t)
setApplicationException
in interface TransactionQueryTestCase
public boolean exceptionOccurred()
exceptionOccurred
in interface TransactionQueryTestCase
exceptionOccurred
in class org.teiid.jdbc.AbstractQueryTest
public SQLException getLastException()
getLastException
in class org.teiid.jdbc.AbstractQueryTest
public Throwable getApplicationException()
getApplicationException
in interface TransactionQueryTestCase
Copyright © 2018 JBoss by Red Hat. All rights reserved.