Fix tearDown code for UsageTestSuite classes

- Ensure that we either commit (successfully) or do rollback
 - Added leaked transaction detection to tests
 - ALF-19787: RED BUILD: Build repeatedly hanging in UsageTestSuite 


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@54587 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2013-08-28 14:41:04 +00:00
parent b5a4b2aed9
commit 859d4b9ce4
3 changed files with 54 additions and 9 deletions

View File

@@ -30,6 +30,7 @@ import junit.framework.TestCase;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.content.MimetypeMap;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.repo.transaction.AlfrescoTransactionSupport;
import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.alfresco.service.cmr.repository.ContentService;
import org.alfresco.service.cmr.repository.ContentWriter;
@@ -79,6 +80,11 @@ public class UserUsageTrackingComponentTest extends TestCase
protected void setUp() throws Exception
{
if (AlfrescoTransactionSupport.isActualTransactionActive())
{
fail("Test started with transaction in progress");
}
nodeService = (NodeService)applicationContext.getBean("NodeService");
authenticationService = (MutableAuthenticationService)applicationContext.getBean("authenticationService");
transactionService = (TransactionService)applicationContext.getBean("transactionComponent");