@Override public BlockDiskCacheAttributes getCacheAttributes() { BlockDiskCacheAttributes ret = new BlockDiskCacheAttributes(); ret.setDiskLimitType(DiskLimitType.SIZE); return ret; }
@Override public BlockDiskCacheAttributes getCacheAttributes() { BlockDiskCacheAttributes ret = new BlockDiskCacheAttributes(); ret.setDiskLimitType(DiskLimitType.COUNT); return ret; }
@Override public BlockDiskCacheAttributes getCacheAttributes() { BlockDiskCacheAttributes ret = new BlockDiskCacheAttributes(); ret.setDiskLimitType(DiskLimitType.SIZE); return ret; }
@Override public BlockDiskCacheAttributes getCacheAttributes() { BlockDiskCacheAttributes ret = new BlockDiskCacheAttributes(); ret.setDiskLimitType(DiskLimitType.COUNT); return ret; }
public void testSaveLoadKeysSize() throws Exception { // SETUP BlockDiskCacheAttributes attributes = new BlockDiskCacheAttributes(); attributes.setCacheName( "testSaveLoadKeys" ); attributes.setDiskPath( rootDirName ); attributes.setMaxKeySize( 10000 ); attributes.setBlockSizeBytes( 2000 ); testSaveLoadKeysInner(attributes); }
public void testSaveLoadKeysSize() throws Exception { // SETUP BlockDiskCacheAttributes attributes = new BlockDiskCacheAttributes(); attributes.setCacheName("testSaveLoadKeys"); attributes.setDiskPath(rootDirName); attributes.setMaxKeySize(10000); attributes.setBlockSizeBytes(2000); testSaveLoadKeysInner(attributes); }
/** * Put a bunch of keys inthe key store and verify that they are present. * <p> * @throws Exception */ public void testPutKeys() throws Exception { // SETUP BlockDiskCacheAttributes attributes = new BlockDiskCacheAttributes(); attributes.setCacheName( "testPutKeys" ); attributes.setDiskPath( rootDirName ); attributes.setMaxKeySize( 1000 ); attributes.setBlockSizeBytes( 2000 ); innerTestPutKeys(attributes); }
public void testPutKeysSize() throws Exception { // SETUP BlockDiskCacheAttributes attributes = new BlockDiskCacheAttributes(); attributes.setCacheName( "testPutKeys" ); attributes.setDiskPath( rootDirName ); attributes.setMaxKeySize( 100000 ); attributes.setBlockSizeBytes( 1024 ); attributes.setDiskLimitType(DiskLimitType.SIZE); innerTestPutKeys(attributes); }
/** * Put a bunch of keys in the key store and verify that they are present. * <p> * * @throws Exception */ public void testPutKeys() throws Exception { // SETUP BlockDiskCacheAttributes attributes = new BlockDiskCacheAttributes(); attributes.setCacheName("testPutKeys"); attributes.setDiskPath(rootDirName); attributes.setMaxKeySize(1000); attributes.setBlockSizeBytes(2000); innerTestPutKeys(attributes); }
public void testPutKeysSize() throws Exception { // SETUP BlockDiskCacheAttributes attributes = new BlockDiskCacheAttributes(); attributes.setCacheName("testPutKeys"); attributes.setDiskPath(rootDirName); attributes.setMaxKeySize(100000); attributes.setBlockSizeBytes(1024); attributes.setDiskLimitType(DiskLimitType.SIZE); innerTestPutKeys(attributes); }
/** * Verify that we can load keys that we saved. Add a bunch. Save them. Clear the memory keyhash. * Load the keys. Verify. * <p> * @throws Exception */ public void testSaveLoadKeys() throws Exception { // SETUP BlockDiskCacheAttributes attributes = new BlockDiskCacheAttributes(); attributes.setCacheName( "testSaveLoadKeys" ); attributes.setDiskPath( rootDirName ); attributes.setMaxKeySize( 10000 ); attributes.setBlockSizeBytes( 2000 ); testSaveLoadKeysInner(attributes); }
/** * Verify that we can load keys that we saved. Add a bunch. Save them. Clear * the memory key hash. Load the keys. Verify. * <p> * * @throws Exception */ public void testSaveLoadKeys() throws Exception { // SETUP BlockDiskCacheAttributes attributes = new BlockDiskCacheAttributes(); attributes.setCacheName("testSaveLoadKeys"); attributes.setDiskPath(rootDirName); attributes.setMaxKeySize(10000); attributes.setBlockSizeBytes(2000); testSaveLoadKeysInner(attributes); }
public void testObjectLargerThanMaxSize() { BlockDiskCacheAttributes attributes = new BlockDiskCacheAttributes(); attributes.setCacheName("testObjectLargerThanMaxSize"); attributes.setDiskPath(rootDirName); attributes.setMaxKeySize(1000); attributes.setBlockSizeBytes(2000); attributes.setDiskLimitType(DiskLimitType.SIZE); @SuppressWarnings({ "unchecked", "rawtypes" }) BlockDiskKeyStore<String> keyStore = new BlockDiskKeyStore<String>(attributes, new BlockDiskCache(attributes)); keyStore.put("1", new int[1000]); keyStore.put("2", new int[1000]); assertNull(keyStore.get("1")); assertNotNull(keyStore.get("2")); } }
public void testObjectLargerThanMaxSize() { BlockDiskCacheAttributes attributes = new BlockDiskCacheAttributes(); attributes.setCacheName( "testObjectLargerThanMaxSize" ); attributes.setDiskPath( rootDirName ); attributes.setMaxKeySize( 1000 ); attributes.setBlockSizeBytes( 2000 ); attributes.setDiskLimitType(DiskLimitType.SIZE); @SuppressWarnings({ "unchecked", "rawtypes" }) BlockDiskKeyStore<String> keyStore = new BlockDiskKeyStore<String>( attributes, new BlockDiskCache(attributes)); keyStore.put("1", new int[1000]); keyStore.put("2", new int[1000]); assertNull(keyStore.get("1")); assertNotNull(keyStore.get("2")); } }