cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrus Adamchik (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (CAY-1827) EhCache region corresponding to a cache group loses it settings after 'removeGroup'
Date Fri, 24 May 2013 10:51:20 GMT

     [ https://issues.apache.org/jira/browse/CAY-1827?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Andrus Adamchik closed CAY-1827.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 3.2M1
                   3.1B3
    
> EhCache region corresponding to a cache group loses it settings after 'removeGroup'
> -----------------------------------------------------------------------------------
>
>                 Key: CAY-1827
>                 URL: https://issues.apache.org/jira/browse/CAY-1827
>             Project: Cayenne
>          Issue Type: Bug
>    Affects Versions: 3.1B2, 3.2M1
>            Reporter: Andrus Adamchik
>            Assignee: Andrus Adamchik
>             Fix For: 3.1B3, 3.2M1
>
>
> Here is a unit test showing how the cache region is destroyed and recreated by calling
'removeGroup'. All 'c3' assertions fail.
>         EhCacheQueryCache cache = new EhCacheQueryCache(cacheManager);
>         Object[] lists = new Object[] { new ArrayList<Object>(), new ArrayList<Object>(),
new ArrayList<Object>() };
>         QueryCacheEntryFactory factory = mock(QueryCacheEntryFactory.class);
>         when(factory.createObject()).thenReturn(lists[0], lists[1], lists[2]);
>         QueryMetadata md = mock(QueryMetadata.class);
>         when(md.getCacheKey()).thenReturn("k1");
>         when(md.getCacheGroups()).thenReturn(new String[] { "cg1" });
>         assertEquals(lists[0], cache.get(md, factory));
>         assertEquals(lists[0], cache.get(md, factory));
>         Cache c1 = cache.cacheManager.getCache("cg1");
>         assertEquals(201, c1.getCacheConfiguration().getTimeToLiveSeconds());
>         cache.removeGroup("cg1");
>         assertEquals(lists[1], cache.get(md, factory));
>         // make sure the cache still has all the configured settings after
>         // 'removeGroup'
>         Cache c3 = cache.cacheManager.getCache("cg1");
>         assertSame(c1, c3);
>         assertEquals(201, c3.getCacheConfiguration().getTimeToLiveSeconds());

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message