sysRoot.addToEnvironment( DerefAliasesEnum.JNDI_PROP, DerefAliasesEnum.NEVERDEREFALIASES.getName() );
sysRoot.addToEnvironment( DerefAliasesEnum.JNDI_DEREF_ALIAS_PROP, DerefAliasesEnum.NEVER_DEREF_ALIASES );
    public void testSearchSizeLimit() throws NamingException    {        SearchControls controls = new SearchControls();        controls.setSearchScope( SearchControls.SUBTREE_SCOPE );        controls.setDerefLinkFlag( false );        controls.setCountLimit( 7 );        sysRoot.addToEnvironment( DerefAliasesEnum.JNDI_PROP, DerefAliasesEnum.NEVERDEREFALIASES.getName() );        HashMap map = new HashMap();        NamingEnumeration list = sysRoot.search( "", "(ou=*)", controls );        try        {            while ( list.hasMore() )            {                SearchResult result = ( SearchResult ) list.next();                map.put( result.getName(), result.getAttributes() );            }            fail( "Should not get here due to a SizeLimitExceededException" );        }        catch ( LdapSizeLimitExceededException e )        {        }        assertEquals( "Expected number of results returned was incorrect", 7, map.size() );    }