Java Code Examples for org.springframework.ldap.test.LdapTestUtils#clearSubContexts()

The following examples show how to use org.springframework.ldap.test.LdapTestUtils#clearSubContexts() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BaseDAOTest.java    From geofence with GNU General Public License v2.0 6 votes vote down vote up
protected static void loadData() throws Exception
{
    // Bind to the directory
    LdapContextSource contextSource = new LdapContextSource();
    contextSource.setUrl("ldap://127.0.0.1:10389");
    contextSource.setUserDn("uid=admin,ou=system");
    contextSource.setPassword("secret");
    contextSource.setPooled(false);
    //contextSource.setDirObjectFactory(null);
    contextSource.afterPropertiesSet();

    // Create the Sprint LDAP template
    LdapTemplate template = new LdapTemplate(contextSource);

    // Clear out any old data - and load the test data
    LdapTestUtils.clearSubContexts(contextSource, LdapUtils.newLdapName("dc=example,dc=com"));
    LdapTestUtils.loadLdif(contextSource, new ClassPathResource("data.ldif"));
}
 
Example 2
Source File: TestLdap.java    From spring-ldap with Apache License 2.0 5 votes vote down vote up
@After
public void tearDown() throws Exception {
    LdapTestUtils.clearSubContexts(contextSource, baseName);

    odmManager=null;
    contextSource=null;
    converterManager=null;
}
 
Example 3
Source File: PagedSearchITest.java    From spring-ldap with Apache License 2.0 4 votes vote down vote up
@After
public void cleanup() throws NamingException {
    LdapTestUtils.clearSubContexts(contextSource, LdapUtils.newLdapName("ou=People"));
}
 
Example 4
Source File: DigestMd5AuthenticationITest.java    From spring-ldap with Apache License 2.0 4 votes vote down vote up
@After
public void cleanup() throws Exception {
    LdapTestUtils.clearSubContexts(contextSource, LdapUtils.newLdapName("ou=People"));
}
 
Example 5
Source File: LdapTemplateSearchResultITest.java    From spring-ldap with Apache License 2.0 4 votes vote down vote up
@After
public void cleanup() throws Exception {
       LdapTestUtils.clearSubContexts(contextSource, LdapUtils.newLdapName("ou=People"));
	attributesMapper = null;
	contextMapper = null;
}