|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
org.apache.derbyTesting.junit.BaseTestCase
org.apache.derbyTesting.junit.BaseJDBCTestCase
org.apache.derbyTesting.functionTests.tests.jdbcapi.XATransactionTest
public class XATransactionTest
The test of the properties of the XA transaction interface implementation.
| Field Summary |
|---|
| Fields inherited from class org.apache.derbyTesting.junit.BaseTestCase |
|---|
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE |
| Constructor Summary | |
|---|---|
XATransactionTest(java.lang.String name)
|
|
| Method Summary | |
|---|---|
(package private) static javax.transaction.xa.Xid |
createXid(int gtrid,
int bqual)
Create the Xid object for global transaction identification with the specified identification values. |
private static javax.transaction.xa.Xid |
parseXid(java.lang.String str)
Parses the xid value from the string. |
static junit.framework.Test |
suite()
|
void |
testGlobalXIDinTransactionTable()
Tests whether it is possible to reconstruct the original Xid value correctly from SYSCS_DIAG.TRANSACTION_TABLE. |
void |
testPendingLocalTranAndServerShutdown()
This test does following 1)Start the network server 2)Start a local xa transaction 3)Do not commit the local XA transaction 4)Shutdown the network server 5)Start the server again Before the fix for DERBY-4053 went in, step 4) would not shutdown the server properly because of the pending local XA transaction. |
void |
testTransactionTimeoutAndJoin()
DERBY-4232: Test that two branches can be joined after the timeout has been set. |
void |
testTransactionTimeoutAndSuspendResume()
DERBY-4232: Test that an XA transaction can be suspended and resumed when a timeout is in effect. |
void |
testXAExceptionErrorCodeOnSQLExceptionDerby4141()
DERBY-4141 XAExceptions caused by SQLExceptions should have a non-zero errorCode. |
void |
testXATransactionTimeout()
Tests the functionality of the XA transaction timeout. |
| Methods inherited from class org.apache.derbyTesting.junit.BaseTestCase |
|---|
alarm, assertEquals, assertEquals, assertEquals, assertExecJavaCmdAsExpected, assertSecurityManager, assertThrowableEquals, execJavaCmd, fail, getFailureFolder, getJavaExecutableName, getSystemProperty, getTestConfiguration, getTestResource, openTestResource, println, printStackTrace, readProcessOutput, removeDirectory, removeDirectory, removeSystemProperty, runBare, setSystemProperty, traceit |
| Methods inherited from class junit.framework.TestCase |
|---|
countTestCases, createResult, getName, run, run, runTest, setName, setUp, toString |
| Methods inherited from class junit.framework.Assert |
|---|
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public XATransactionTest(java.lang.String name)
| Method Detail |
|---|
public void testPendingLocalTranAndServerShutdown()
throws java.lang.Exception
java.lang.Exception
public void testGlobalXIDinTransactionTable()
throws java.lang.Exception
java.lang.Exception
public void testXATransactionTimeout()
throws java.lang.Exception
It executes 66 global transactions during the test. Everyone of them just inserts a row into XATT table. The rows inserted by the transactions are different. Some of these transactions are committed and some of them are left in different stages. The stage of the transaction in which it is left is chosed depending on division remainders.
After finishing these 1000 transactions a select statement is executed on that table. However, if there are still some unfinished transactions that were not aborted they will hold a lock on a XATT table until they will get rolled back by the transaction timeout. The number of rows in the XATT table is calculated. It is then compared with the excepted number of rows (the transaction we know we have committed).
The call to xaRes.setTransactionTimeout(5) before the call to xaRes.start() makes the transactions to be rolled back due to timeout.
java.lang.Exception
public void testTransactionTimeoutAndSuspendResume()
throws java.lang.Exception
java.lang.Exception
public void testTransactionTimeoutAndJoin()
throws java.lang.Exception
java.lang.Exception
public void testXAExceptionErrorCodeOnSQLExceptionDerby4141()
throws java.lang.Exception
java.lang.Exception
static javax.transaction.xa.Xid createXid(int gtrid,
int bqual)
throws javax.transaction.xa.XAException
gtrid - Global Transaction IDbqual - Branch Qualifier
javax.transaction.xa.XAExceptionprivate static javax.transaction.xa.Xid parseXid(java.lang.String str)
str - Global Transaction ID converted to a string.
public static junit.framework.Test suite()
|
Built on Sat 2009-11-28 18:44:18-0800, from revision 885187 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||