@Before
 public void prepareTestedInstance() throws Exception {
   LdapTestUtils.cleanAndSetup(
       contextSource,
       LdapUtils.newLdapName("ou=People"),
       new ClassPathResource("/setup_data.ldif"));
 }
예제 #2
0
 /** @deprecated use {@link #startEmbeddedServer(int, String, String)} instead. */
 public static DirContext startApacheDirectoryServer(
     int port,
     String defaultPartitionSuffix,
     String defaultPartitionName,
     String principal,
     String credentials)
     throws NamingException {
   return LdapTestUtils.startApacheDirectoryServer(
       port, defaultPartitionSuffix, defaultPartitionName, principal, credentials, null);
 }
예제 #3
0
  @Before
  public void setUp() throws Exception {
    // Bind to the directory
    LdapContextSource contextSource = new LdapContextSource();
    contextSource.setUrl("ldap://127.0.0.1:" + PORT);
    contextSource.setUserDn("");
    contextSource.setPassword("");
    contextSource.setPooled(false);
    contextSource.afterPropertiesSet();

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

    // Clear out any old data - and load the test data
    LdapTestUtils.cleanAndSetup(
        template.getContextSource(), baseName, new ClassPathResource("testdata.ldif"));
  }
 @After
 public void cleanup() throws Exception {
   LdapTestUtils.clearSubContexts(contextSource, LdapUtils.newLdapName("ou=People"));
 }
예제 #5
0
 @AfterClass
 public static void tearDownClass() throws Exception {
   LdapTestUtils.shutdownEmbeddedServer();
 }
예제 #6
0
 @BeforeClass
 public static void setUpClass() throws Exception {
   // Start an LDAP server and import test data
   LdapTestUtils.startEmbeddedServer(PORT, baseName.toString(), "odm-test");
 }