org.alfresco.util
Class RetryingTransactionHelperTestCase

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.alfresco.util.RetryingTransactionHelperTestCase
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
BaseAlfrescoTestCase

public abstract class RetryingTransactionHelperTestCase
extends junit.framework.TestCase

Test case base class with helper methods for transactional tests.


Nested Class Summary
protected  class RetryingTransactionHelperTestCase.FailureTest
          Class containing test code that is expected to fail.
protected  class RetryingTransactionHelperTestCase.Test
          Class containing the code to run as test and the optional code to check the results of the test in a separate transaction if required.
 
Constructor Summary
RetryingTransactionHelperTestCase()
           
 
Method Summary
protected  void doTestInTransaction(RetryingTransactionHelperTestCase.FailureTest test)
          Executes a test in a retrying transaction.
protected  void doTestInTransaction(RetryingTransactionHelperTestCase.FailureTest test, java.lang.String asUser)
          Executes a test in a retrying transaction.
protected  java.lang.Object doTestInTransaction(RetryingTransactionHelperTestCase.Test test)
          Executes a test in a retrying transaction as the admin user.
protected  java.lang.Object doTestInTransaction(RetryingTransactionHelperTestCase.Test test, java.lang.String asUser)
          Executes a test in a retrying transaction as the admin user.
abstract  RetryingTransactionHelper getRetryingTransactionHelper()
           
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, 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, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RetryingTransactionHelperTestCase

public RetryingTransactionHelperTestCase()
Method Detail

getRetryingTransactionHelper

public abstract RetryingTransactionHelper getRetryingTransactionHelper()
Returns:
retrying transaction helper

doTestInTransaction

protected java.lang.Object doTestInTransaction(RetryingTransactionHelperTestCase.Test test)
Executes a test in a retrying transaction as the admin user.

Parameters:
test - test object to be executed within a retrying transaction
Returns:
A the result of the test

doTestInTransaction

protected java.lang.Object doTestInTransaction(RetryingTransactionHelperTestCase.Test test,
                                               java.lang.String asUser)
Executes a test in a retrying transaction as the admin user.

Parameters:
test - test object to be executed within a retrying transaction
asUser - user to execute the test as
Returns:
A the result of the test

doTestInTransaction

protected void doTestInTransaction(RetryingTransactionHelperTestCase.FailureTest test)
Executes a test in a retrying transaction. Run as admin user.

Parameters:
test - failure test object

doTestInTransaction

protected void doTestInTransaction(RetryingTransactionHelperTestCase.FailureTest test,
                                   java.lang.String asUser)
Executes a test in a retrying transaction.

Parameters:
test - failure test object
asUser - user to run test as


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.