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

71624: Merged V4.2-BUG-FIX (4.2.3) to HEAD-BUG-FIX (4.3/Cloud)
      71395: Merged PATCHES/V4.2.2 to V4.2-BUG-FIX (4.2.3)
         70201 : Merged DEV to PATCHES/V4.2.2
            70132 : MNT-11098 : 'Failed to get lock java.util.concurrent.locks.ReentrantReadWriteLock$ReadLock' error occurs during the startup
               - cluster.type changed to invalidating for resourceBundleBaseNamesSharedCache, loadedResourceBundlesSharedCache and messagesSharedCache
            70138 : MNT-11098 : 'Failed to get lock java.util.concurrent.locks.ReentrantReadWriteLock$ReadLock' error occurs during the startup
               - Test for MessageServiceImpl. Cache entries shouldn't be modified directly
            70187 : MNT-11098 : 'Failed to get lock java.util.concurrent.locks.ReentrantReadWriteLock$ReadLock' error occurs during the startup
               - Cache's entries is wrapped in unmodifiable collections


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@74707 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Will Abson
2014-06-25 15:32:48 +00:00
parent 6901888160
commit 93bf623381
3 changed files with 75 additions and 29 deletions

View File

@@ -395,6 +395,32 @@ public class MessageServiceImplTest extends TestCase implements MessageDeployer
assertEquals(Locale.getDefault(), messageService.parseLocale(""));
}
public void testRegisteredBundlesSetDirectModification()
{
String bad_key = "BAD_KEY" + System.currentTimeMillis();
Set<String> bundles = messageService.getRegisteredBundles();
assertNotNull(bundles);
assertTrue(!bundles.contains(bad_key));
try
{
// put entry directly
bundles.add(bad_key);
fail("Shouldn't be modified");
}
catch (UnsupportedOperationException e)
{
// it's ok
}
Set<String> anotherTryBundles = messageService.getRegisteredBundles();
assertNotNull(anotherTryBundles);
assertTrue(!bundles.contains(bad_key));
}
private void getMessages()
{
// Check default values