eAttr.setIsSpool(true); ICacheElement<String, String> element = new CacheElement<String, String>("testSimplePutAndGet", "key:" + i, "data:" + i); element.setElementAttributes(eAttr);
eAttr.setIsSpool( true ); ICacheElement<String, String> element = new CacheElement<String, String>( "testSimplePutAndGet", "key:" + i, "data:" + i ); element.setElementAttributes( eAttr );
/** * Add some items to the disk cache and then remove them one by one. * * @throws IOException */ public void testRemoveItems() throws IOException { BlockDiskCacheAttributes cattr = getCacheAttributes(); cattr.setCacheName("testRemoveItems"); cattr.setMaxKeySize(100); cattr.setDiskPath("target/test-sandbox/BlockDiskCacheUnitTest"); BlockDiskCache<String, String> disk = new BlockDiskCache<String, String>(cattr); disk.processRemoveAll(); int cnt = 25; for (int i = 0; i < cnt; i++) { IElementAttributes eAttr = new ElementAttributes(); eAttr.setIsSpool(true); ICacheElement<String, String> element = new CacheElement<String, String>("testRemoveItems", "key:" + i, "data:" + i); element.setElementAttributes(eAttr); disk.processUpdate(element); } // remove each for (int i = 0; i < cnt; i++) { disk.remove("key:" + i); ICacheElement<String, String> element = disk.processGet("key:" + i); assertNull("Should not have received an element.", element); } }
/** * Add some items to the disk cache and then remove them one by one. * * @throws IOException */ public void testRemoveItems() throws IOException { IndexedDiskCacheAttributes cattr = getCacheAttributes(); cattr.setCacheName("testRemoveItems"); cattr.setMaxKeySize(100); cattr.setDiskPath("target/test-sandbox/IndexDiskCacheUnitTest"); IndexedDiskCache<String, String> disk = new IndexedDiskCache<String, String>(cattr); disk.processRemoveAll(); int cnt = 25; for (int i = 0; i < cnt; i++) { IElementAttributes eAttr = new ElementAttributes(); eAttr.setIsSpool(true); ICacheElement<String, String> element = new CacheElement<String, String>("testRemoveItems", "key:" + i, "data:" + i); element.setElementAttributes(eAttr); disk.processUpdate(element); } // remove each for (int i = 0; i < cnt; i++) { disk.remove("key:" + i); ICacheElement<String, String> element = disk.processGet("key:" + i); assertNull("Should not have received an element.", element); } }
/** * Add some items to the disk cache and then remove them one by one. * @throws IOException */ public void testRemoveItems() throws IOException { IndexedDiskCacheAttributes cattr = getCacheAttributes(); cattr.setCacheName( "testRemoveItems" ); cattr.setMaxKeySize( 100 ); cattr.setDiskPath( "target/test-sandbox/IndexDiskCacheUnitTest" ); IndexedDiskCache<String, String> disk = new IndexedDiskCache<String, String>( cattr ); disk.processRemoveAll(); int cnt = 25; for ( int i = 0; i < cnt; i++ ) { IElementAttributes eAttr = new ElementAttributes(); eAttr.setIsSpool( true ); ICacheElement<String, String> element = new CacheElement<String, String>( "testRemoveItems", "key:" + i, "data:" + i ); element.setElementAttributes( eAttr ); disk.processUpdate( element ); } // remove each for ( int i = 0; i < cnt; i++ ) { disk.remove( "key:" + i ); ICacheElement<String, String> element = disk.processGet( "key:" + i ); assertNull( "Should not have received an element.", element ); } }
eAttr.setIsSpool(true); ICacheElement<String, String> element = new CacheElement<String, String>("testRemove_PartialKey", i + ":key", "data:" + i);
eAttr.setIsSpool( true ); ICacheElement<String, String> element = new CacheElement<String, String>( "testRemove_PartialKey", i + ":key", "data:" + i ); element.setElementAttributes( eAttr );
eAttr.setIsSpool( true ); ICacheElement<String, String> element = new CacheElement<String, String>( cattr.getCacheName(), "key:" + i, "data:" + i ); element.setElementAttributes( eAttr ); eAttr.setIsSpool( true ); ICacheElement<String, String> elementSetup = new CacheElement<String, String>( cattr.getCacheName(), "key:" + "A", "data:" + "A" ); elementSetup.setElementAttributes( eAttr );
eAttr.setIsSpool( true ); ICacheElement<String, String> element = new CacheElement<String, String>( cattr.getCacheName(), "key:" + i, "data:" + i ); element.setElementAttributes( eAttr ); eAttr.setIsSpool( true ); ICacheElement<String, String> elementSetup = new CacheElement<String, String>( cattr.getCacheName(), "key:" + "A", "data:" + "A" ); elementSetup.setElementAttributes( eAttr );
eAttr.setIsSpool(true); ICacheElement<String, String> element = new CacheElement<String, String>("testRemove_PartialKey", i + ":key", "data:" + i);
eAttr.setIsSpool(true); element.setElementAttributes(eAttr);
eAttr.setIsSpool( true ); element.setElementAttributes( eAttr );
eAttr.setIsSpool(true); element.setElementAttributes(eAttr);
eAttr.setIsSpool( true ); ICacheElement<String, String> element = new CacheElement<String, String>( cattr.getCacheName(), "key:" + i, "data:" + i ); element.setElementAttributes( eAttr );
eAttr.setIsSpool( true ); ICacheElement<String, String> element = new CacheElement<String, String>( cattr.getCacheName(), "key:" + i, "data:" + i ); element.setElementAttributes( eAttr );