InitialContext ctx = new InitialContext( env );  assertNotNull( ctx );
env.put( Context.SECURITY_AUTHENTICATION, "none" );  env.put( Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory" );  InitialContext ctx = null;  try { ctx = new InitialContext( env );  fail( "If anonymous binds are disabled we should never get here!" ); } catch ( NoPermissionException e ) { assertNull( ctx );  assertNotNull( e ); }
    public void test11DisableAnonymousBinds() throws Exception    {        // Use the SUN JNDI provider to hit server port and bind as anonymous        Hashtable env = new Hashtable();        env.put( Context.PROVIDER_URL, "ldap://localhost:" + port + "/ou=system" );        env.put( Context.SECURITY_PRINCIPAL, "none" );        InitialContext ctx = new InitialContext( env );                assertNotNull( ctx );    }