com.xenonsoft.bridgetown.test.aop.transaction
Class TestJdbcTransactionSession

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended bycom.xenonsoft.bridgetown.test.aop.transaction.TestJdbcTransactionSession
All Implemented Interfaces:
junit.framework.Test

public class TestJdbcTransactionSession
extends junit.framework.TestCase

A unit test to verify the operation of the data source JDBC transaction session object

Version:
$Id: TestJdbcTransactionSession.java,v 1.2 2005/02/23 01:32:38 peter_pilgrim Exp $
Author:
peterp, 14-Feb-2005

Field Summary
protected  JdbcTransactionContext context
           
protected  JdbcTransactionSession session
          Simulate retrieving session from a lookup context e.g JNDI
 
Constructor Summary
TestJdbcTransactionSession()
           
 
Method Summary
 void deleteCurrentAccount(int accountId)
          Delete a saving account records from the database
 void insertCurrentAccount(int accountId, java.lang.String accountNumber, java.lang.String accountName, double amount)
          Insert a new saving account records into the database
static void main(java.lang.String[] args)
          Main program
protected  void setUp()
           
static junit.framework.Test suite()
           
protected  void tearDown()
           
 void testTransactionCommit()
          Test the data source transaction session and context implementations by inserting some records into the database.
 void testTransactionRollback()
          Test the data source transaction session and context implementations By trying to begin a transaction twice.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, 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
 

Field Detail

session

protected JdbcTransactionSession session
Simulate retrieving session from a lookup context e.g JNDI


context

protected JdbcTransactionContext context
Constructor Detail

TestJdbcTransactionSession

public TestJdbcTransactionSession()
Method Detail

main

public static void main(java.lang.String[] args)
Main program


suite

public static junit.framework.Test suite()

setUp

protected void setUp()
              throws java.lang.Exception
Throws:
java.lang.Exception

tearDown

protected void tearDown()
                 throws java.lang.Exception
Throws:
java.lang.Exception

insertCurrentAccount

public void insertCurrentAccount(int accountId,
                                 java.lang.String accountNumber,
                                 java.lang.String accountName,
                                 double amount)
                          throws java.sql.SQLException
Insert a new saving account records into the database

Parameters:
accountId -
accountNumber -
accountName -
amount -
Throws:
java.sql.SQLException

deleteCurrentAccount

public void deleteCurrentAccount(int accountId)
                          throws java.sql.SQLException
Delete a saving account records from the database

Parameters:
accountId -
Throws:
java.sql.SQLException

testTransactionCommit

public void testTransactionCommit()
                           throws java.lang.Exception
Test the data source transaction session and context implementations by inserting some records into the database.

Throws:
java.sql.SQLException
java.lang.Exception

testTransactionRollback

public void testTransactionRollback()
                             throws java.lang.Exception
Test the data source transaction session and context implementations By trying to begin a transaction twice.

Throws:
java.sql.SQLException
java.lang.Exception


Copyright © 2005 XeNoNSoFT.com. All Rights Reserved.