Search in sources :

Example 81 with LdapUrl

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

the class LdapUrlTest method testLdapURLDNNoAttrsScopeBase.

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

Example 82 with LdapUrl

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

the class LdapUrlTest method testLdapURLNoDNNoAttrsNoScopeNoFilter.

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

Example 83 with LdapUrl

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

the class LdapUrlTest method testLdapURLDNNoAttrsDefaultScope.

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

Example 84 with LdapUrl

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

the class LdapUrlTest method testLdapURLDNAttrsNoScopeFilter.

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

Example 85 with LdapUrl

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

the class ApiLdapModelOsgiTest method useBundleClasses.

@Override
protected void useBundleClasses() throws Exception {
    // uses FastDnParser
    new Dn("dc=example,dc=com");
    // uses ComplexDnparser (antlr based)
    new Dn("cn=a+sn=b,dc=example,dc=com");
    new Value("foo");
    new DefaultAttribute("cn");
    new DefaultEntry();
    AttributeUtils.toJndiAttribute(new DefaultAttribute("cn"));
    new BindRequestImpl();
    new EqualityNode<String>("cn", "foo");
    new LdapUrl("ldap://ldap.example.com:10389/dc=example,dc=com?objectclass");
    new ObjectClassDescriptionSchemaParser().parse("( 2.5.6.0 NAME 'top' DESC 'top of the superclass chain' ABSTRACT MUST objectClass )");
    SchemaObject schemaObject = new LdapSyntax("1.2.3");
    new Registries().getGlobalOidRegistry().register(schemaObject);
    new Registries().getLoadedSchemas();
}
Also used : LdapUrl(org.apache.directory.api.ldap.model.url.LdapUrl) SchemaObject(org.apache.directory.api.ldap.model.schema.SchemaObject) ObjectClassDescriptionSchemaParser(org.apache.directory.api.ldap.model.schema.parsers.ObjectClassDescriptionSchemaParser) Value(org.apache.directory.api.ldap.model.entry.Value) DefaultEntry(org.apache.directory.api.ldap.model.entry.DefaultEntry) LdapSyntax(org.apache.directory.api.ldap.model.schema.LdapSyntax) Registries(org.apache.directory.api.ldap.model.schema.registries.Registries) Dn(org.apache.directory.api.ldap.model.name.Dn) DefaultAttribute(org.apache.directory.api.ldap.model.entry.DefaultAttribute) EqualityNode(org.apache.directory.api.ldap.model.filter.EqualityNode) BindRequestImpl(org.apache.directory.api.ldap.model.message.BindRequestImpl)

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