|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.teiid.jdbc.AbstractQueryTest
org.teiid.test.framework.query.AbstractQueryTransactionTest
public abstract class AbstractQueryTransactionTest
The AbstractQueryTransactionTest is the base implementation for the
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
The following methods are useful when writing validation logic because they provide
a direct connection to the datasource that was used by the VDB. This enables data
validation of expected behavior of Teiid.
getSource(String)
. getXASource(String)
for use when direct queries to the source are used to
validate the results of the testcase.
Field Summary | |
---|---|
protected ConnectionStrategy |
connStrategy
|
protected int |
fetchSize
|
protected int |
queryTimeout
|
protected java.lang.String |
testname
|
Fields inherited from class org.teiid.jdbc.AbstractQueryTest |
---|
DELIMITER, internalConnection, internalResultSet, internalStatement, updateCount |
Constructor Summary | |
---|---|
AbstractQueryTransactionTest()
|
|
AbstractQueryTransactionTest(java.lang.String testname)
|
Method Summary | |
---|---|
void |
after()
Override after if there is behavior that needs to be
performed after testCase() being called. |
protected void |
assignExecutionProperties(java.sql.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()
|
java.lang.Throwable |
getApplicationException()
|
ConnectionStrategy |
getConnectionStrategy()
Called to get the current connection strategy being used. |
java.sql.SQLException |
getLastException()
|
java.sql.Connection |
getSource(java.lang.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. |
java.lang.String |
getTestName()
Returns the name of the test so that better tracing of what tests are running/completing. |
javax.sql.XAConnection |
getXAConnection()
|
javax.sql.XAConnection |
getXASource(java.lang.String identifier)
|
boolean |
rollbackAllways()
Indicates what should be done when a failure occurs in testCase() |
void |
setApplicationException(java.lang.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. |
Methods inherited from class org.teiid.jdbc.AbstractQueryTest |
---|
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.teiid.test.framework.TransactionQueryTestCase |
---|
exceptionExpected, getConnection, setConnection |
Field Detail |
---|
protected java.lang.String testname
protected int fetchSize
protected int queryTimeout
protected ConnectionStrategy connStrategy
Constructor Detail |
---|
public AbstractQueryTransactionTest()
public AbstractQueryTransactionTest(java.lang.String testname)
Method Detail |
---|
public java.lang.String getTestName()
TransactionQueryTestCase
getTestName
in interface TransactionQueryTestCase
public ConnectionStrategy getConnectionStrategy()
TransactionQueryTestCase
getConnectionStrategy
in interface TransactionQueryTestCase
protected void assignExecutionProperties(java.sql.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 testcase
setup
in interface TransactionQueryTestCase
QueryTestFailedException
QueryTestFailedException
protected void setupDataStore()
public java.sql.Connection getSource(java.lang.String identifier) throws QueryTestFailedException
identifier
-
QueryTestFailedException
public javax.sql.XAConnection getXASource(java.lang.String identifier) throws QueryTestFailedException
QueryTestFailedException
public abstract void testCase() throws java.lang.Exception
testCase
in interface TransactionQueryTestCase
java.lang.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 javax.sql.XAConnection getXAConnection()
getXAConnection
in interface TransactionQueryTestCase
public void setApplicationException(java.lang.Throwable t)
setApplicationException
in interface TransactionQueryTestCase
public boolean exceptionOccurred()
exceptionOccurred
in interface TransactionQueryTestCase
exceptionOccurred
in class org.teiid.jdbc.AbstractQueryTest
public java.sql.SQLException getLastException()
getLastException
in class org.teiid.jdbc.AbstractQueryTest
public java.lang.Throwable getApplicationException()
getApplicationException
in interface TransactionQueryTestCase
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |