use of org.apache.directory.api.ldap.model.name.Dn in project directory-ldap-api by apache.
the class AddRequestImplTest method testNotEqualDiffId.
/**
* Test for inequality when only the IDs are different.
*/
@Test
public void testNotEqualDiffId() throws LdapException {
AddRequestImpl req0 = new AddRequestImpl();
req0.setMessageId(7);
req0.setEntryDn(new Dn("cn=admin,dc=example,dc=com"));
req0.setEntry(getEntry());
AddRequestImpl req1 = new AddRequestImpl();
req1.setMessageId(5);
req1.setEntryDn(new Dn("cn=admin,dc=example,dc=com"));
req1.setEntry(getEntry());
assertFalse(req0.equals(req1));
}
use of org.apache.directory.api.ldap.model.name.Dn in project directory-ldap-api by apache.
the class AddRequestImplTest method testEqualsExactCopy.
/**
* Tests for equality using exact copies.
*/
@Test
public void testEqualsExactCopy() throws LdapException {
AddRequestImpl req0 = new AddRequestImpl();
req0.setMessageId(5);
req0.setEntryDn(new Dn("cn=admin,dc=example,dc=com"));
req0.setEntry(getEntry());
AddRequestImpl req1 = new AddRequestImpl();
req1.setMessageId(5);
req1.setEntryDn(new Dn("cn=admin,dc=example,dc=com"));
req1.setEntry(getEntry());
assertTrue(req0.equals(req1));
}
use of org.apache.directory.api.ldap.model.name.Dn in project directory-ldap-api by apache.
the class AddRequestImplTest method testNotEqualDiffName.
/**
* Test for inequality when only the Dn names are different.
*/
@Test
public void testNotEqualDiffName() throws LdapException {
AddRequestImpl req0 = new AddRequestImpl();
req0.setMessageId(5);
req0.setEntry(getEntry());
req0.setEntryDn(new Dn("cn=admin,dc=example,dc=com"));
AddRequestImpl req1 = new AddRequestImpl();
req1.setMessageId(5);
req1.setEntry(getEntry());
req1.setEntryDn(new Dn("cn=admin,dc=apache,dc=org"));
assertFalse(req0.equals(req1));
}
use of org.apache.directory.api.ldap.model.name.Dn in project directory-ldap-api by apache.
the class BindRequestImplTest method testEqualsExactCopy.
/**
* Tests for equality using exact copies.
*/
@Test
public void testEqualsExactCopy() throws LdapException {
BindRequestImpl req0 = new BindRequestImpl();
req0.setMessageId(5);
req0.setCredentials(PASSWORD);
req0.setDn(new Dn("cn=admin,dc=example,dc=com"));
req0.setSimple(true);
req0.setVersion3(true);
BindRequestImpl req1 = new BindRequestImpl();
req1.setMessageId(5);
req1.setCredentials(PASSWORD);
req1.setDn(new Dn("cn=admin,dc=example,dc=com"));
req1.setSimple(true);
req1.setVersion3(true);
assertTrue(req0.equals(req1));
}
use of org.apache.directory.api.ldap.model.name.Dn in project directory-ldap-api by apache.
the class BindRequestImplTest method testNotEqualDiffCreds.
/**
* Test for inequality when only the credentials are different.
*/
@Test
public void testNotEqualDiffCreds() throws LdapException {
BindRequestImpl req0 = new BindRequestImpl();
req0.setMessageId(5);
req0.setCredentials(Strings.getBytesUtf8("abcdefg"));
req0.setDn(new Dn("cn=admin,dc=example,dc=com"));
req0.setSimple(true);
req0.setVersion3(true);
BindRequestImpl req1 = new BindRequestImpl();
req1.setMessageId(5);
req1.setCredentials(PASSWORD);
req1.setDn(new Dn("cn=admin,dc=example,dc=com"));
req1.setSimple(true);
req1.setVersion3(true);
assertFalse(req0.equals(req1));
}
Aggregations