org.bibalex.daf.handlers.dbhandler
Class DBConnectionTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.bibalex.daf.handlers.dbhandler.DBConnectionTest
All Implemented Interfaces:
junit.framework.Test

public class DBConnectionTest
extends junit.framework.TestCase

Test for DBConnection

Note: The method testStopTransaction_false_sp against stored procedures as follow:
1) Stored procedures that have Start transaction & Commit -> test case FAILED!
2) Stored procedures that have DON'T Start transaction & Commit -> test case PASSED.

Conclusion
For connection.stopTransaction(false) to work correctly, stored procedures shouldn't have neither STRAT TRANSACTION nor COMMIT statements.

Author:
Shehab.Kamal

Constructor Summary
DBConnectionTest()
           
 
Method Summary
 void setUp()
           
 void testLastInsertedID()
          This testcase shows that Last_Insert_ID works per connection.
 void testStopTransaction_false()
           
 void testStopTransaction_true()
           
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, tearDown, 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

DBConnectionTest

public DBConnectionTest()
Method Detail

setUp

public void setUp()
Overrides:
setUp in class junit.framework.TestCase

testLastInsertedID

public void testLastInsertedID()
This testcase shows that Last_Insert_ID works per connection.


testStopTransaction_true

public void testStopTransaction_true()
                              throws java.lang.Exception
Throws:
java.lang.Exception

testStopTransaction_false

public void testStopTransaction_false()
                               throws java.lang.Exception
Throws:
java.lang.Exception