/** * Verify that we can get a region using the define region method with cache attributes. * @throws Exception */ public void testRegionDefinitonWithAttributes() throws Exception { ICompositeCacheAttributes ca = new CompositeCacheAttributes(); long maxIdleTime = 8765; ca.setMaxMemoryIdleTimeSeconds( maxIdleTime ); CacheAccess<String, String> access = JCS.getInstance( "testRegionDefinitonWithAttributes", ca ); assertNotNull( "We should have an access class", access ); ICompositeCacheAttributes ca2 = access.getCacheAttributes(); assertEquals( "Wrong idle time setting.", ca.getMaxMemoryIdleTimeSeconds(), ca2.getMaxMemoryIdleTimeSeconds() ); }
/** * Verify that we can get a region using the define region method with cache attributes. * @throws Exception */ public void testRegionDefinitonWithAttributes() throws Exception { ICompositeCacheAttributes ca = new CompositeCacheAttributes(); long maxIdleTime = 8765; ca.setMaxMemoryIdleTimeSeconds( maxIdleTime ); CacheAccess<String, String> access = JCS.defineRegion( "testRegionDefinitonWithAttributes", ca ); assertNotNull( "We should have an access class", access ); ICompositeCacheAttributes ca2 = access.getCacheAttributes(); assertEquals( "Wrong idle time setting.", ca.getMaxMemoryIdleTimeSeconds(), ca2.getMaxMemoryIdleTimeSeconds() ); }
/** * Verify that we can get a region using the define region method with cache attributes and * element attributes. * @throws Exception */ public void testRegionDefinitonWithBothAttributes() throws Exception { ICompositeCacheAttributes ca = new CompositeCacheAttributes(); long maxIdleTime = 8765; ca.setMaxMemoryIdleTimeSeconds( maxIdleTime ); long maxLife = 9876; IElementAttributes attr = new ElementAttributes(); attr.setMaxLife(maxLife); CacheAccess<String, String> access = JCS.defineRegion( "testRegionDefinitonWithAttributes", ca, attr ); assertNotNull( "We should have an access class", access ); ICompositeCacheAttributes ca2 = access.getCacheAttributes(); assertEquals( "Wrong idle time setting.", ca.getMaxMemoryIdleTimeSeconds(), ca2.getMaxMemoryIdleTimeSeconds() ); }
/** * Verify that we can get a region using the define region method with cache attributes and * element attributes. * @throws Exception */ public void testRegionDefinitonWithBothAttributes() throws Exception { ICompositeCacheAttributes ca = new CompositeCacheAttributes(); long maxIdleTime = 8765; ca.setMaxMemoryIdleTimeSeconds( maxIdleTime ); long maxLife = 9876; IElementAttributes attr = new ElementAttributes(); attr.setMaxLife(maxLife); CacheAccess<String, String> access = JCS.getInstance( "testRegionDefinitonWithAttributes", ca, attr ); assertNotNull( "We should have an access class", access ); ICompositeCacheAttributes ca2 = access.getCacheAttributes(); assertEquals( "Wrong idle time setting.", ca.getMaxMemoryIdleTimeSeconds(), ca2.getMaxMemoryIdleTimeSeconds() ); }