LDAP-232: Finalized migration to ApacheDS 1.5.5 for integration tests.

This commit is contained in:
Mattias Hellborg Arthursson
2013-08-14 10:36:46 +02:00
parent 2b2cbf0f38
commit 837bc489ef
11 changed files with 78 additions and 72 deletions

View File

@@ -16,15 +16,6 @@
package org.springframework.ldap;
import static junit.framework.Assert.assertEquals;
import java.util.LinkedList;
import java.util.List;
import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
import javax.naming.directory.Attributes;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ldap.core.AttributesMapper;
@@ -33,6 +24,14 @@ import org.springframework.ldap.itest.Person;
import org.springframework.ldap.itest.PersonAttributesMapper;
import org.springframework.test.context.ContextConfiguration;
import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
import javax.naming.directory.Attributes;
import java.util.LinkedList;
import java.util.List;
import static junit.framework.Assert.assertEquals;
/**
* Tests the attributes mapper search method.
*
@@ -78,10 +77,10 @@ public class LdapTemplateAttributesMapperITest extends AbstractLdapTemplateInteg
return members;
}
};
List result = tested.search("ou=groups", "(objectclass=groupOfUniqueNames)", mapper);
List result = tested.search("ou=groups", "(&(objectclass=groupOfUniqueNames)(cn=ROLE_USER))", mapper);
assertEquals(2, result.size());
assertEquals(1, ((String[]) result.get(0)).length);
assertEquals(5, ((String[]) result.get(1)).length);
assertEquals(1, result.size());
assertEquals(5, ((String[]) result.get(0)).length);
}
}

View File

@@ -16,10 +16,6 @@
package org.springframework.ldap;
import static junit.framework.Assert.assertEquals;
import java.util.List;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ldap.core.ContextMapper;
@@ -29,6 +25,10 @@ import org.springframework.ldap.itest.Person;
import org.springframework.ldap.itest.PersonContextMapper;
import org.springframework.test.context.ContextConfiguration;
import java.util.List;
import static junit.framework.Assert.assertEquals;
/**
* Tests the ContextMapper search method. In its way this method also
* demonstrates the use of DirContextAdapter and the DirObjectFactory.
@@ -71,10 +71,9 @@ public class LdapTemplateContextMapperITest extends AbstractLdapTemplateIntegrat
return members;
}
};
List result = tested.search("ou=groups", "(objectclass=groupOfUniqueNames)", mapper);
List result = tested.search("ou=groups", "(&(objectclass=groupOfUniqueNames)(cn=ROLE_USER))", mapper);
assertEquals(2, result.size());
assertEquals(1, ((String[]) result.get(0)).length);
assertEquals(5, ((String[]) result.get(1)).length);
assertEquals(1, result.size());
assertEquals(5, ((String[]) result.get(0)).length);
}
}