use of org.apache.directory.api.ldap.model.url.LdapUrl in project directory-ldap-api by apache.
the class LdapUrlTest method testLdapURLDNAttrsNoScopeNoFilterExtension.
/**
* test a LdapUrl with a Dn, some attributes, no scope, no filter and some extensions
*/
@Test
public void testLdapURLDNAttrsNoScopeNoFilterExtension() throws LdapURLEncodingException {
LdapUrl url = new LdapUrl("ldap://localhost:123/ou=system?cn,ou,dc???!a=b,!c");
assertEquals("ldap://localhost:123/ou=system?cn,ou,dc???!a=b,!c", url.toString());
}
use of org.apache.directory.api.ldap.model.url.LdapUrl in project directory-ldap-api by apache.
the class LdapUrlTest method testLdapURLDNNoAttrsScopeNoFilterExtension.
/**
* test a LdapUrl with a Dn, no attributes, a scope, no filter and some extensions
*/
@Test
public void testLdapURLDNNoAttrsScopeNoFilterExtension() throws LdapURLEncodingException {
LdapUrl url = new LdapUrl("ldap://localhost:123/ou=system??sub??!a=b,!c");
assertEquals("ldap://localhost:123/ou=system??sub??!a=b,!c", url.toString());
}
use of org.apache.directory.api.ldap.model.url.LdapUrl in project directory-ldap-api by apache.
the class LdapUrlTest method testLdapURLNoDNAttrsScopeBaseFilterExtension.
/**
* test a LdapUrl with no Dn, some attributes, a base scope, a filter and some extensions
*/
@Test
public void testLdapURLNoDNAttrsScopeBaseFilterExtension() throws LdapURLEncodingException {
LdapUrl url = new LdapUrl("ldap://localhost:123/?cn,dc,ou?base?(cn=test)?!a=b,!c");
assertEquals("ldap://localhost:123/?cn,dc,ou??(cn=test)?!a=b,!c", url.toString());
}
use of org.apache.directory.api.ldap.model.url.LdapUrl in project directory-ldap-api by apache.
the class LdapUrlTest method testLdapURLDNAttrsScopeFilterExtension.
/**
* test a LdapUrl with a Dn, some attributes, a scope, a filter and some extensions
*/
@Test
public void testLdapURLDNAttrsScopeFilterExtension() throws LdapURLEncodingException {
LdapUrl url = new LdapUrl("ldap://localhost:123/ou=system?cn,ou,dc?sub?(cn=test)?!a=b,!c");
assertEquals("ldap://localhost:123/ou=system?cn,ou,dc?sub?(cn=test)?!a=b,!c", url.toString());
}
use of org.apache.directory.api.ldap.model.url.LdapUrl in project directory-ldap-api by apache.
the class LdapUrlTest method testDnSetScheme.
/**
* test the setScheme() method
*/
@Test
public void testDnSetScheme() throws LdapURLEncodingException {
LdapUrl url = new LdapUrl();
assertEquals("ldap://", url.getScheme());
url.setScheme("invalid");
assertEquals("ldap://", url.getScheme());
url.setScheme("ldap://");
assertEquals("ldap://", url.getScheme());
url.setScheme("ldaps://");
assertEquals("ldaps://", url.getScheme());
url.setScheme(null);
assertEquals("ldap://", url.getScheme());
}
Aggregations