ALF-15888: change DefaultSimpleCache to initialise itself in constructor rather than using an initialising bean.

Cleaner code, no longer requires afterPropertiesSet() to be called for initialisation.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@42254 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Matt Ward
2012-10-02 09:10:41 +00:00
parent 4550f97fc9
commit dcce548a8d
2 changed files with 33 additions and 54 deletions

View File

@@ -43,9 +43,7 @@ public class DefaultSimpleCacheTest
@Before
public void setUp() throws Exception
{
cache = new DefaultSimpleCache<Integer, String>();
cache.setMaxItems(100);
cache.afterPropertiesSet();
cache = new DefaultSimpleCache<Integer, String>(100, getClass().getName());
}
@Test
@@ -53,7 +51,6 @@ public class DefaultSimpleCacheTest
{
// We'll only keep the LAST 3 items
cache.setMaxItems(3);
cache.afterPropertiesSet();
cache.put(1, "1");
cache.put(2, "2");