assertNull( "Should not have value for key [" + i + ":key" + "] in the cache." + cache.getStats(), value ); for ( int i = max-1; i >= 0; i-- ) assertNull( "Should not have value for key [" + i + ":key" + "] in the cache." + cache.getStats(), elements.get( i + ":key" ) );
assertNull( "Should not have value for key [" + i + ":key" + "] in the cache." + cache.getStats(), value ); for ( int i = max-1; i >= 0; i-- ) assertNull( "Should not have value for key [" + i + ":key" + "] in the cache." + cache.getStats(), elements.get( i + ":key" ) );
/** * put the max and clear. verify that no elements remain. * <p> * @throws CacheException */ public void testClearThroughHub() throws CacheException { CacheAccess<String, String> cache = JCS.getInstance( "testClearThroughHub" ); int max = cache.getCacheAttributes().getMaxObjects(); int items = max * 2; for ( int i = 0; i < items; i++ ) { cache.put( i + ":key", "myregion" + " data " + i ); } cache.clear(); // Test that first items are not in the cache for ( int i = max; i >= 0; i-- ) { String value = cache.get( i + ":key" ); assertNull( "Should not have value for key [" + i + ":key" + "] in the cache.", value ); } }
/** * put the max and clear. verify that no elements remain. * <p> * @throws CacheException */ public void testClearThroughHub() throws CacheException { CacheAccess<String, String> cache = JCS.getInstance( "testClearThroughHub" ); int max = cache.getCacheAttributes().getMaxObjects(); int items = max * 2; for ( int i = 0; i < items; i++ ) { cache.put( i + ":key", "myregion" + " data " + i ); } cache.clear(); // Test that first items are not in the cache for ( int i = max; i >= 0; i-- ) { String value = cache.get( i + ":key" ); assertNull( "Should not have value for key [" + i + ":key" + "] in the cache.", value ); } }
/** * put the max and remove each. verify that they are all null. * <p> * @throws CacheException */ public void testPutRemoveThroughHub() throws CacheException { CacheAccess<String, String> cache = JCS.getInstance( "testPutRemoveThroughHub" ); int max = cache.getCacheAttributes().getMaxObjects(); int items = max * 2; for ( int i = 0; i < items; i++ ) { cache.put( i + ":key", "myregion" + " data " + i ); } for ( int i = 0; i < items; i++ ) { cache.remove( i + ":key" ); } // Test that first items are not in the cache for ( int i = max; i >= 0; i-- ) { String value = cache.get( i + ":key" ); assertNull( "Should not have value for key [" + i + ":key" + "] in the cache.", value ); } }
/** * put the max and remove each. verify that they are all null. * <p> * @throws CacheException */ public void testPutRemoveThroughHub() throws CacheException { CacheAccess<String, String> cache = JCS.getInstance( "testPutRemoveThroughHub" ); int max = cache.getCacheAttributes().getMaxObjects(); int items = max * 2; for ( int i = 0; i < items; i++ ) { cache.put( i + ":key", "myregion" + " data " + i ); } for ( int i = 0; i < items; i++ ) { cache.remove( i + ":key" ); } // Test that first items are not in the cache for ( int i = max; i >= 0; i-- ) { String value = cache.get( i + ":key" ); assertNull( "Should not have value for key [" + i + ":key" + "] in the cache.", value ); } }
assertNull( "Should not have value for key [" + i + ":key" + "] in the cache.", value );
assertNull( "Should not have value for key [" + i + ":key" + "] in the cache.", value );
assertNull( "Should have been removed by partial loop.", cache.get( root + ":" + i + ":key" ) );
assertNull( "Should have been removed by partial loop.", cache.get( root + ":" + i + ":key" ) );