Search in sources :

Example 71 with LdapUrl

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());
}
Also used : LdapUrl(org.apache.directory.api.ldap.model.url.LdapUrl) Test(org.junit.Test)

Example 72 with LdapUrl

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());
}
Also used : LdapUrl(org.apache.directory.api.ldap.model.url.LdapUrl) Test(org.junit.Test)

Example 73 with LdapUrl

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());
}
Also used : LdapUrl(org.apache.directory.api.ldap.model.url.LdapUrl) Test(org.junit.Test)

Example 74 with LdapUrl

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());
}
Also used : LdapUrl(org.apache.directory.api.ldap.model.url.LdapUrl) Test(org.junit.Test)

Example 75 with LdapUrl

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());
}
Also used : LdapUrl(org.apache.directory.api.ldap.model.url.LdapUrl) Test(org.junit.Test)

Aggregations

LdapUrl (org.apache.directory.api.ldap.model.url.LdapUrl)98 Test (org.junit.Test)95 LdapURLEncodingException (org.apache.directory.api.ldap.model.exception.LdapURLEncodingException)27 AbstractResponseTest (org.apache.directory.api.dsmlv2.AbstractResponseTest)24 Dsmlv2ResponseParser (org.apache.directory.api.dsmlv2.Dsmlv2ResponseParser)24 LdapResult (org.apache.directory.api.ldap.model.message.LdapResult)23 DecoderException (org.apache.directory.api.asn1.DecoderException)5 SearchResponse (org.apache.directory.api.dsmlv2.response.SearchResponse)5 Dn (org.apache.directory.api.ldap.model.name.Dn)5 Extension (org.apache.directory.api.ldap.model.url.LdapUrl.Extension)5 BindResponse (org.apache.directory.api.ldap.model.message.BindResponse)3 CompareResponse (org.apache.directory.api.ldap.model.message.CompareResponse)3 DeleteResponse (org.apache.directory.api.ldap.model.message.DeleteResponse)3 ExtendedResponse (org.apache.directory.api.ldap.model.message.ExtendedResponse)3 ModifyDnResponse (org.apache.directory.api.ldap.model.message.ModifyDnResponse)3 ModifyResponse (org.apache.directory.api.ldap.model.message.ModifyResponse)3 SearchResultDone (org.apache.directory.api.ldap.model.message.SearchResultDone)3 SearchResultReference (org.apache.directory.api.ldap.model.message.SearchResultReference)3 TLV (org.apache.directory.api.asn1.ber.tlv.TLV)2 Referral (org.apache.directory.api.ldap.model.message.Referral)2