Search in sources :

Example 46 with LdapUrl

use of org.apache.directory.api.ldap.model.url.LdapUrl in project directory-ldap-api by apache.

the class LdapUrlTest method testLdapURLDNAttrsScopeNoFilterExtension.

/**
 * test a LdapUrl with a Dn, some attributes, a scope, no filter and some extensions
 */
@Test
public void testLdapURLDNAttrsScopeNoFilterExtension() throws LdapURLEncodingException {
    LdapUrl url = new LdapUrl("ldap://localhost:123/ou=system?cn,ou,dc?sub??!a=b,!c");
    assertEquals("ldap://localhost:123/ou=system?cn,ou,dc?sub??!a=b,!c", url.toString());
}
Also used : LdapUrl(org.apache.directory.api.ldap.model.url.LdapUrl) Test(org.junit.Test)

Example 47 with LdapUrl

use of org.apache.directory.api.ldap.model.url.LdapUrl in project directory-ldap-api by apache.

the class LdapUrlTest method testLdapURLDNAttrsDefaultScope.

/**
 * test a LdapUrl with a Dn, some attributes an default scope
 */
@Test
public void testLdapURLDNAttrsDefaultScope() throws LdapURLEncodingException {
    LdapUrl url = new LdapUrl("ldap://localhost:123/ou=system?ou,cn?");
    assertEquals("ldap://localhost:123/ou=system?ou,cn", url.toString());
}
Also used : LdapUrl(org.apache.directory.api.ldap.model.url.LdapUrl) Test(org.junit.Test)

Example 48 with LdapUrl

use of org.apache.directory.api.ldap.model.url.LdapUrl in project directory-ldap-api by apache.

the class LdapUrlTest method testLdapURLNoDNAttrsScopeBaseNoFilterExtension.

/**
 * test a LdapUrl with no Dn, some attributes, a base scope, no filter and some extensions
 */
@Test
public void testLdapURLNoDNAttrsScopeBaseNoFilterExtension() throws LdapURLEncodingException {
    LdapUrl url = new LdapUrl("ldap://localhost:123/?cn,dc,ou?base??!a=b,!c");
    assertEquals("ldap://localhost:123/?cn,dc,ou???!a=b,!c", url.toString());
}
Also used : LdapUrl(org.apache.directory.api.ldap.model.url.LdapUrl) Test(org.junit.Test)

Example 49 with LdapUrl

use of org.apache.directory.api.ldap.model.url.LdapUrl in project directory-ldap-api by apache.

the class LdapUrlTest method testLdapURLNoDNAttrsScopeFilterExtension.

/**
 * test a LdapUrl with no Dn, some attributes, a scope, a filter and some extensions
 */
@Test
public void testLdapURLNoDNAttrsScopeFilterExtension() throws LdapURLEncodingException {
    LdapUrl url = new LdapUrl("ldap://localhost:123/?cn,dc,ou?sub?(cn=test)?!a=b,!c");
    assertEquals("ldap://localhost:123/?cn,dc,ou?sub?(cn=test)?!a=b,!c", url.toString());
}
Also used : LdapUrl(org.apache.directory.api.ldap.model.url.LdapUrl) Test(org.junit.Test)

Example 50 with LdapUrl

use of org.apache.directory.api.ldap.model.url.LdapUrl in project directory-ldap-api by apache.

the class LdapUrlTest method testLdapURLExtensionAfterEmptyExtension.

/**
 * Test a LdapUrl with an extension after an empty extension.
 */
@Test
public void testLdapURLExtensionAfterEmptyExtension() throws LdapURLEncodingException {
    LdapUrl url = new LdapUrl("ldap://localhost:123/????!a=b,!c,d=e");
    assertEquals("ldap://localhost:123/????!a=b,!c,d=e", url.toString());
}
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