sk.baka.tools.jpa
Class SimpleTransactionInterceptorTest.Helper

java.lang.Object
  extended by sk.baka.tools.jpa.SimpleTransactionInterceptorTest.Helper
Enclosing class:
SimpleTransactionInterceptorTest

public static class SimpleTransactionInterceptorTest.Helper
extends Object


Constructor Summary
SimpleTransactionInterceptorTest.Helper()
           
 
Method Summary
 void checkExists(long... ids)
           
 void checkExists(long id)
           
 void checkNoEntityManager()
           
 void checkNotExists(long id)
           
 void insertAndFail()
          Inserts a row and throws SimpleTransactionInterceptorTest.SimulatedException.
 long insertAndSucceed()
           
 long invokeFailAndCommit()
          Invokes insertAndFail() but catches the exception and finishes normally.
 long[] invokeInsert()
          This tests a case when the entity manager was set to null after method return.
 long invokeOkButRollback()
          Invokes insertAndFail() but catches the exception and finishes normally.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleTransactionInterceptorTest.Helper

public SimpleTransactionInterceptorTest.Helper()
Method Detail

insertAndFail

public void insertAndFail()
Inserts a row and throws SimpleTransactionInterceptorTest.SimulatedException.


invokeFailAndCommit

public long invokeFailAndCommit()
Invokes insertAndFail() but catches the exception and finishes normally.

Returns:
row added by the invocation.

invokeOkButRollback

public long invokeOkButRollback()
Invokes insertAndFail() but catches the exception and finishes normally.

Returns:
row added by the invocation.

insertAndSucceed

public long insertAndSucceed()

invokeInsert

public long[] invokeInsert()
This tests a case when the entity manager was set to null after method return. In this case the test should fail with NPE as it will try to use entity manager.

Returns:
all records created

checkExists

public void checkExists(long id)

checkExists

public void checkExists(long... ids)

checkNotExists

public void checkNotExists(long id)

checkNoEntityManager

public void checkNoEntityManager()


Copyright © 2009-2010. All Rights Reserved.