From c396613cddc6fd9b168a4e0add08d7080dec0356 Mon Sep 17 00:00:00 2001 From: Derek Hulley Date: Mon, 6 Feb 2006 16:49:02 +0000 Subject: [PATCH] Some test cleanup to help with profiling git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2305 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../java/org/alfresco/repo/cache/CacheTest.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/source/java/org/alfresco/repo/cache/CacheTest.java b/source/java/org/alfresco/repo/cache/CacheTest.java index ac0ca40536..e85f3c43c0 100644 --- a/source/java/org/alfresco/repo/cache/CacheTest.java +++ b/source/java/org/alfresco/repo/cache/CacheTest.java @@ -57,6 +57,15 @@ public class CacheTest extends TestCase transactionalCache = (SimpleCache) ctx.getBean("transactionalCache"); } + @Override + public void tearDown() + { + serviceRegistry = null; + standaloneCache = null; + backingCache = null; + transactionalCache = null; + } + public void testSetUp() throws Exception { CacheManager cacheManager = (CacheManager) ctx.getBean("ehCacheManager"); @@ -116,11 +125,11 @@ public class CacheTest extends TestCase TransactionService transactionService = serviceRegistry.getTransactionService(); UserTransaction txn = transactionService.getUserTransaction(); - // begin a transaction - txn.begin(); - try { + // begin a transaction + txn.begin(); + // remove 1 from the cache transactionalCache.remove(newGlobalOne); assertFalse("Item was not removed from txn cache", transactionalCache.contains(newGlobalOne));