String groupName = "testRemove_Group";
int cnt = 25;
for ( int i = 0; i < cnt; i++ )
{
GroupAttrName groupAttrName = getGroupAttrName( cacheName, groupName, i + ":key" );
CacheElement element = new CacheElement( cacheName, groupAttrName, "data:" + i );
IElementAttributes eAttr = new ElementAttributes();
eAttr.setIsSpool( true );
element.setElementAttributes( eAttr );
disk.doUpdate( element );
}
// verify each
for ( int i = 0; i < cnt; i++ )
{
GroupAttrName groupAttrName = getGroupAttrName( cacheName, groupName, i + ":key" );
ICacheElement element = disk.doGet( groupAttrName );
assertNotNull( "Should have recevied an element.", element );
}
// DO WORK
// remove the group
GroupId gid = new GroupId( cacheName, groupName );
disk.remove( gid );
for ( int i = 0; i < cnt; i++ )
{
GroupAttrName groupAttrName = getGroupAttrName( cacheName, groupName, i + ":key" );
ICacheElement element = disk.doGet( groupAttrName );
// VERIFY
assertNull( "Should not have recevied an element.", element );
}