@Test public void testGetSystemLdapContext() throws NamingException { factory = new JndiLdapContextFactory() { @Override protected LdapContext createLdapContext(Hashtable env) throws NamingException { assertEquals("ldap: assertEquals("foo", env.get(Context.SECURITY_PRINCIPAL)); assertEquals("bar", env.get(Context.SECURITY_CREDENTIALS)); assertEquals("simple", env.get(Context.SECURITY_AUTHENTICATION)); assertNotNull(env.get(SUN_CONNECTION_POOLING_PROPERTY)); return createNiceMock(LdapContext.class); } }; factory.setSystemUsername("foo"); factory.setSystemPassword("bar"); factory.setUrl("ldap: factory.getSystemLdapContext(); }
public LdapContext getSystemLdapContext() throws NamingException { return getLdapContext((Object)getSystemUsername(), getSystemPassword()); }
JndiLdapContextFactory implements LdapContextFactory { public LdapContext getSystemLdapContext() throws NamingException { return getLdapContext((Object)getSystemUsername(), getSystemPassword()); } }
JndiLdapContextFactory implements LdapContextFactory { public LdapContext getSystemLdapContext() throws NamingException { return getLdapContext((Object)getSystemUsername(), getSystemPassword()); } JndiLdapContextFactory(); }
JndiLdapContextFactory implements LdapContextFactory { public LdapContext getSystemLdapContext() throws NamingException { return getLdapContext((Object)getSystemUsername(), getSystemPassword()); } JndiLdapContextFactory(); void setAuthenticationMechanism(String authenticationMechanism); String getAuthenticationMechanism(); void setContextFactoryClassName(String contextFactoryClassName); String getContextFactoryClassName(); Map getEnvironment(); @SuppressWarnings({"unchecked"}) void setEnvironment(Map env); boolean isPoolingEnabled(); void setPoolingEnabled(boolean poolingEnabled); void setReferral(String referral); String getReferral(); void setUrl(String url); String getUrl(); void setSystemPassword(String systemPassword); String getSystemPassword(); void setSystemUsername(String systemUsername); String getSystemUsername(); LdapContext getSystemLdapContext(); @Deprecated LdapContext getLdapContext(String username, String password); LdapContext getLdapContext(Object principal, Object credentials); }
JndiLdapContextFactory implements LdapContextFactory { public LdapContext getSystemLdapContext() throws NamingException { return getLdapContext((Object)getSystemUsername(), getSystemPassword()); } JndiLdapContextFactory(); void setAuthenticationMechanism(String authenticationMechanism); String getAuthenticationMechanism(); void setContextFactoryClassName(String contextFactoryClassName); String getContextFactoryClassName(); Map getEnvironment(); @SuppressWarnings({"unchecked"}) void setEnvironment(Map env); boolean isPoolingEnabled(); void setPoolingEnabled(boolean poolingEnabled); void setReferral(String referral); String getReferral(); void setUrl(String url); String getUrl(); void setSystemPassword(String systemPassword); String getSystemPassword(); void setSystemUsername(String systemUsername); String getSystemUsername(); LdapContext getSystemLdapContext(); @Deprecated LdapContext getLdapContext(String username, String password); LdapContext getLdapContext(Object principal, Object credentials);  }