System.out.println( "------------------------- testRecycleBin " );
for ( int i = 0; i < 6; i++ )
{
ICacheElement element = new CacheElement( "testRecycleBin", "key:" + test[i], test[i] );
System.out.println( "About to add " + "key:" + test[i] + " i = " + i );
disk.doUpdate( element );
}
for ( int i = 3; i < 5; i++ )
{
System.out.println( "About to remove " + "key:" + test[i] + " i = " + i );
disk.remove( "key:" + test[i] );
}
// there was a bug where 7 would try to be put in the empty slot left by 4's removal, but it
// will not fit.
for ( int i = 7; i < 9; i++ )
{
ICacheElement element = new CacheElement( "testRecycleBin", "key:" + test[i], test[i] );
System.out.println( "About to add " + "key:" + test[i] + " i = " + i );
disk.doUpdate( element );
}
try
{
for ( int i = 0; i < 9; i++ )
{
ICacheElement element = disk.get( "key:" + test[i] );
if ( element != null )
{
System.out.println( "element = " + element.getVal() );
}
else
{
System.out.println( "null --" + "key:" + test[i] );
}
String expectedValue = expect[i];
if ( expectedValue == null )
{
assertNull( "Expected a null element", element );
}
else
{
assertNotNull( "The element for key [" + "key:" + test[i] + "] should not be null. i = " + i,
element );
assertEquals( "Elements contents do not match expected", element.getVal(), expectedValue );
}
}
}
catch ( Exception e )
{