From 1300d9bd3a41a80f4faf7ec8d6e6f2c4701bef4c Mon Sep 17 00:00:00 2001 From: Alan Davis Date: Wed, 12 Feb 2014 01:10:13 +0000 Subject: [PATCH] Merged HEAD-BUG-FIX (4.3/Cloud) to HEAD (4.3/Cloud) 59177: Fixes SlowContentStoreTest test breakage. Removes dependency on cachingstore/test-context.xml This fix essentially denormalizes the various Spring context XML files in the cachingstore directory. A previous fix had aliased the cachingContentStore to fileContentStore, but unfortunately this broke the SlowContentStoreTest tests, as the cachingContentStore created by those tests is not a real/working content store (the backingStore is a SlowContentStore dummy store), so the bootstrap process failed. By making each of the contexts standalone, the different tests are able to evolve as required without breaking the other tests. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@62108 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../cleanup/CachedContentCleanupJobTest.java | 6 +----- .../test/ConcurrentCachingStoreTest.java | 3 +-- .../caching/test/SlowContentStoreTest.java | 3 +-- .../cachingstore/test-cleaner-context.xml | 14 ++++++++++++++ .../cachingstore/test-slow-context.xml | 19 +++++++++++++++++++ 5 files changed, 36 insertions(+), 9 deletions(-) diff --git a/source/test-java/org/alfresco/repo/content/caching/cleanup/CachedContentCleanupJobTest.java b/source/test-java/org/alfresco/repo/content/caching/cleanup/CachedContentCleanupJobTest.java index 433dc990dd..1b34efe8ef 100644 --- a/source/test-java/org/alfresco/repo/content/caching/cleanup/CachedContentCleanupJobTest.java +++ b/source/test-java/org/alfresco/repo/content/caching/cleanup/CachedContentCleanupJobTest.java @@ -28,7 +28,6 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.io.PrintWriter; import java.util.Calendar; -import java.util.Date; import java.util.GregorianCalendar; import org.alfresco.repo.content.caching.CacheFileProps; @@ -39,10 +38,8 @@ import org.alfresco.service.cmr.repository.ContentReader; import org.alfresco.util.ApplicationContextHelper; import org.alfresco.util.GUID; import org.apache.commons.io.FileUtils; -import org.junit.Assert; import org.junit.Before; import org.junit.BeforeClass; -import org.junit.Ignore; import org.junit.Test; import org.springframework.context.ApplicationContext; @@ -64,9 +61,8 @@ public class CachedContentCleanupJobTest @BeforeClass public static void beforeClass() { - String conf = "classpath:cachingstore/test-context.xml"; String cleanerConf = "classpath:cachingstore/test-cleaner-context.xml"; - ctx = ApplicationContextHelper.getApplicationContext(new String[] { conf, cleanerConf }); + ctx = ApplicationContextHelper.getApplicationContext(new String[] { cleanerConf }); } diff --git a/source/test-java/org/alfresco/repo/content/caching/test/ConcurrentCachingStoreTest.java b/source/test-java/org/alfresco/repo/content/caching/test/ConcurrentCachingStoreTest.java index 1b75354009..a0ef76bba2 100644 --- a/source/test-java/org/alfresco/repo/content/caching/test/ConcurrentCachingStoreTest.java +++ b/source/test-java/org/alfresco/repo/content/caching/test/ConcurrentCachingStoreTest.java @@ -50,9 +50,8 @@ public class ConcurrentCachingStoreTest @Before public void setUp() { - String conf = "classpath:cachingstore/test-context.xml"; String slowconf = "classpath:cachingstore/test-slow-context.xml"; - ctx = ApplicationContextHelper.getApplicationContext(new String[] { conf, slowconf }); + ctx = ApplicationContextHelper.getApplicationContext(new String[] { slowconf }); store = (CachingContentStore) ctx.getBean("cachingContentStore"); store.setCacheOnInbound(false); diff --git a/source/test-java/org/alfresco/repo/content/caching/test/SlowContentStoreTest.java b/source/test-java/org/alfresco/repo/content/caching/test/SlowContentStoreTest.java index cc9a4c59c5..8ea681b11a 100644 --- a/source/test-java/org/alfresco/repo/content/caching/test/SlowContentStoreTest.java +++ b/source/test-java/org/alfresco/repo/content/caching/test/SlowContentStoreTest.java @@ -48,9 +48,8 @@ public class 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 }); + ctx = (ClassPathXmlApplicationContext) ApplicationContextHelper.getApplicationContext(new String[] { slowconf }); } @Before diff --git a/source/test-resources/cachingstore/test-cleaner-context.xml b/source/test-resources/cachingstore/test-cleaner-context.xml index f0a88d4c7e..8c2a69f152 100644 --- a/source/test-resources/cachingstore/test-cleaner-context.xml +++ b/source/test-resources/cachingstore/test-cleaner-context.xml @@ -2,7 +2,21 @@ + + + + + + + + + + + + + + diff --git a/source/test-resources/cachingstore/test-slow-context.xml b/source/test-resources/cachingstore/test-slow-context.xml index 512936c474..254c9ca70d 100644 --- a/source/test-resources/cachingstore/test-slow-context.xml +++ b/source/test-resources/cachingstore/test-slow-context.xml @@ -1,8 +1,27 @@ + + + + + + + + + + + + + + +