Search in sources :

Example 6 with SearchResultEntryImpl

use of org.apache.directory.api.ldap.model.message.SearchResultEntryImpl in project directory-ldap-api by apache.

the class SearchResultEntryImplTest method testHashCodeExactCopy.

/**
 * Tests for equal hashCode when an exact copy is compared.
 */
@Test
public void testHashCodeExactCopy() throws LdapException {
    SearchResultEntryImpl resp0 = new SearchResultEntryImpl(5);
    resp0.setEntry(getEntry());
    resp0.setObjectName(new Dn("dc=example,dc=com"));
    SearchResultEntryImpl resp1 = new SearchResultEntryImpl(5);
    resp1.setEntry(getEntry());
    resp1.setObjectName(new Dn("dc=example,dc=com"));
    assertTrue(resp0.hashCode() == resp1.hashCode());
}
Also used : SearchResultEntryImpl(org.apache.directory.api.ldap.model.message.SearchResultEntryImpl) Dn(org.apache.directory.api.ldap.model.name.Dn) Test(org.junit.Test)

Aggregations

SearchResultEntryImpl (org.apache.directory.api.ldap.model.message.SearchResultEntryImpl)6 Test (org.junit.Test)5 Dn (org.apache.directory.api.ldap.model.name.Dn)3 SearchResultEntryDecorator (org.apache.directory.api.ldap.codec.decorators.SearchResultEntryDecorator)1