Package org.apache.jcs.engine.control.group

Examples of org.apache.jcs.engine.control.group.GroupAttrName


        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 );
        }
View Full Code Here


     * @return GroupAttrName
     */
    private GroupAttrName getGroupAttrName( String cacheName, String group, Object name )
    {
        GroupId gid = new GroupId( cacheName, group );
        return new GroupAttrName( gid, name );
    }
View Full Code Here

                log.error( "key class=" + key.getClass() );
                log.error( "key hashcode=" + key.hashCode() );
                log.error( "key toString=" + key.toString() );
                if ( key instanceof GroupAttrName )
                {
                    GroupAttrName name = (GroupAttrName) key;
                    log.error( "GroupID hashcode=" + name.groupId.hashCode() );
                    log.error( "GroupID.class=" + name.groupId.getClass() );
                    log.error( "AttrName hashcode=" + name.attrName.hashCode() );
                    log.error( "AttrName.class=" + name.attrName.getClass() );
                }
View Full Code Here

TOP

Related Classes of org.apache.jcs.engine.control.group.GroupAttrName

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.