Merged HEAD-BUG-FIX (4.3/Cloud) to HEAD (4.3/Cloud)

59116: Merged V4.2-BUG-FIX (4.2.1) to HEAD-BUG-FIX (Cloud/4.3)
      59088: Fix broken test SlowContentStoreTest.readsAreFasterFromCache


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@62096 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2014-02-12 01:00:48 +00:00
parent 2a96f57a17
commit 4d8e6900a7

View File

@@ -23,9 +23,12 @@ import static org.junit.Assert.assertTrue;
import org.alfresco.repo.content.ContentContext;
import org.alfresco.repo.content.caching.CachingContentStore;
import org.alfresco.repo.content.caching.ContentCacheImpl;
import org.alfresco.util.ApplicationContextHelper;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -37,21 +40,31 @@ import org.springframework.context.support.ClassPathXmlApplicationContext;
*/
public class SlowContentStoreTest
{
private ClassPathXmlApplicationContext ctx;
private static ClassPathXmlApplicationContext ctx;
private CachingContentStore cachingStore;
private static final Log logger = LogFactory.getLog(SlowContentStoreTest.class);
public SlowContentStoreTest()
{
@BeforeClass
public static void setUpClass()
{
String conf = "classpath:cachingstore/test-context.xml";
String slowconf = "classpath:cachingstore/test-slow-context.xml";
ctx = (ClassPathXmlApplicationContext) ApplicationContextHelper.getApplicationContext(new String[] { conf, slowconf });
cachingStore = (CachingContentStore) ctx.getBean("cachingContentStore");
cachingStore.setCacheOnInbound(false);
}
@Before
public void setUp()
{
cachingStore = (CachingContentStore) ctx.getBean("cachingContentStore");
cachingStore.setCacheOnInbound(false);
// Clear the cache before each test case.
ContentCacheImpl cache = (ContentCacheImpl) ctx.getBean("contentCache");
cache.removeAll();
}
@Test
public void readsAreFasterFromCache()
{