use of org.apache.directory.api.ldap.model.message.SearchResultEntryImpl in project directory-ldap-api by apache.
the class SearchResultEntryImplTest method testNotEqualDiffObjectName.
/**
* Tests for inequality when the objectName dn is not the same.
*/
@Test
public void testNotEqualDiffObjectName() throws LdapException {
SearchResultEntryImpl resp0 = new SearchResultEntryImpl(5);
resp0.setEntry(getEntry());
resp0.setObjectName(new Dn("dc=apache,dc=org"));
SearchResultEntryImpl resp1 = new SearchResultEntryImpl(5);
resp1.setEntry(getEntry());
resp1.setObjectName(new Dn("dc=example,dc=com"));
assertFalse("different object names should not be equal", resp1.equals(resp0));
assertFalse("different object names should not be equal", resp0.equals(resp1));
}
use of org.apache.directory.api.ldap.model.message.SearchResultEntryImpl in project directory-ldap-api by apache.
the class SearchResultEntryImplTest method testHashCodeSameObject.
/**
* Tests for equal hashCode when the same object reference is used.
*/
@Test
public void testHashCodeSameObject() {
SearchResultEntryImpl resp = new SearchResultEntryImpl(5);
assertTrue(resp.hashCode() == resp.hashCode());
}
use of org.apache.directory.api.ldap.model.message.SearchResultEntryImpl in project directory-ldap-api by apache.
the class InitSearchResultEntry method action.
/**
* {@inheritDoc}
*/
public void action(LdapMessageContainer<SearchResultEntryDecorator> container) {
// Now, we can allocate the SearchResultEntry Object
SearchResultEntryDecorator searchResultEntry = new SearchResultEntryDecorator(container.getLdapCodecService(), new SearchResultEntryImpl(container.getMessageId()));
container.setMessage(searchResultEntry);
}
use of org.apache.directory.api.ldap.model.message.SearchResultEntryImpl in project directory-ldap-api by apache.
the class SearchResultEntryImplTest method testEqualsExactCopy.
/**
* Tests for equality when an exact copy is compared.
*/
@Test
public void testEqualsExactCopy() 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("exact copies should be equal", resp0.equals(resp1));
assertTrue("exact copies should be equal", resp1.equals(resp0));
}
use of org.apache.directory.api.ldap.model.message.SearchResultEntryImpl in project directory-ldap-api by apache.
the class SearchResultEntryImplTest method testEqualsSameObject.
/**
* Tests for equality when the same object reference is used.
*/
@Test
public void testEqualsSameObject() {
SearchResultEntryImpl resp = new SearchResultEntryImpl(5);
assertTrue("the same object should be equal", resp.equals(resp));
}
Aggregations