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());
}
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());
}
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());
}
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());
}
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();
}
Aggregations