Search in sources :

Example 1 with ObjectClassDescriptionSchemaParser

use of org.apache.directory.api.ldap.model.schema.parsers.ObjectClassDescriptionSchemaParser in project directory-ldap-api by apache.

the class SchemaObjectRendererTest method testSubschemSubentryRendererAndParserRoundtrip.

private void testSubschemSubentryRendererAndParserRoundtrip(ObjectClass original) throws ParseException {
    String renderedOriginal = SchemaObjectRenderer.SUBSCHEMA_SUBENTRY_RENDERER.render(original);
    ObjectClass parsed = new ObjectClassDescriptionSchemaParser().parse(renderedOriginal);
    String renderedParsed = SchemaObjectRenderer.SUBSCHEMA_SUBENTRY_RENDERER.render(parsed);
    assertTrue(original.equals(parsed));
    assertTrue(renderedOriginal.equals(renderedParsed));
}
Also used : ObjectClassDescriptionSchemaParser(org.apache.directory.api.ldap.model.schema.parsers.ObjectClassDescriptionSchemaParser)

Example 2 with ObjectClassDescriptionSchemaParser

use of org.apache.directory.api.ldap.model.schema.parsers.ObjectClassDescriptionSchemaParser 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

ObjectClassDescriptionSchemaParser (org.apache.directory.api.ldap.model.schema.parsers.ObjectClassDescriptionSchemaParser)2 DefaultAttribute (org.apache.directory.api.ldap.model.entry.DefaultAttribute)1 DefaultEntry (org.apache.directory.api.ldap.model.entry.DefaultEntry)1 Value (org.apache.directory.api.ldap.model.entry.Value)1 EqualityNode (org.apache.directory.api.ldap.model.filter.EqualityNode)1 BindRequestImpl (org.apache.directory.api.ldap.model.message.BindRequestImpl)1 Dn (org.apache.directory.api.ldap.model.name.Dn)1 LdapSyntax (org.apache.directory.api.ldap.model.schema.LdapSyntax)1 SchemaObject (org.apache.directory.api.ldap.model.schema.SchemaObject)1 Registries (org.apache.directory.api.ldap.model.schema.registries.Registries)1 LdapUrl (org.apache.directory.api.ldap.model.url.LdapUrl)1