com.mockrunner.mock.connector.cci
Class MockLocalTransaction

java.lang.Object
  extended by com.mockrunner.mock.connector.cci.MockLocalTransaction
All Implemented Interfaces:
javax.resource.cci.LocalTransaction

public class MockLocalTransaction
extends java.lang.Object
implements javax.resource.cci.LocalTransaction

Mock implementation of LocalTransaction.


Constructor Summary
MockLocalTransaction()
           
 
Method Summary
 void begin()
          Starts the transaction.
 void commit()
          Commits the transaction.
 int getNumberBeginCalls()
          Returns the number of overall begin() calls.
 int getNumberCommitCalls()
          Returns the number of overall commit() calls.
 int getNumberRollbackCalls()
          Returns the number of overall rollback() calls.
 void reset()
          Resets the transaction state.
 void rollback()
          Rolls back the transaction.
 boolean wasBeginCalled()
          Returns if begin() was called.
 boolean wasCommitCalled()
          Returns if commit() was called.
 boolean wasRollbackCalled()
          Returns if rollback() was called.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockLocalTransaction

public MockLocalTransaction()
Method Detail

reset

public void reset()
Resets the transaction state. Sets the number of overall begin, commit and rollback calls to 0.


begin

public void begin()
           throws javax.resource.ResourceException
Starts the transaction. The flags wasCommitCalled and wasRollbackCalled are reset to false. This method does not reset the number of overall calls.

Specified by:
begin in interface javax.resource.cci.LocalTransaction
Throws:
javax.resource.ResourceException

commit

public void commit()
            throws javax.resource.ResourceException
Commits the transaction.

Specified by:
commit in interface javax.resource.cci.LocalTransaction
Throws:
javax.resource.ResourceException

rollback

public void rollback()
              throws javax.resource.ResourceException
Rolls back the transaction.

Specified by:
rollback in interface javax.resource.cci.LocalTransaction
Throws:
javax.resource.ResourceException

wasBeginCalled

public boolean wasBeginCalled()
Returns if begin() was called.

Returns:
was begin() called

wasCommitCalled

public boolean wasCommitCalled()
Returns if commit() was called.

Returns:
was commit() called

wasRollbackCalled

public boolean wasRollbackCalled()
Returns if rollback() was called.

Returns:
was rollback() called

getNumberBeginCalls

public int getNumberBeginCalls()
Returns the number of overall begin() calls.

Returns:
the number of overall begin() calls

getNumberCommitCalls

public int getNumberCommitCalls()
Returns the number of overall commit() calls.

Returns:
the number of overall commit() calls

getNumberRollbackCalls

public int getNumberRollbackCalls()
Returns the number of overall rollback() calls.

Returns:
the number of overall rollback() calls