Search in sources :

Example 1 with SyntaxCheckerDescription

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

the class SyntaxCheckerDescriptionSchemaParserTest method testSyntaxCheckerExample.

@Test
public void testSyntaxCheckerExample() throws ParseException {
    String simple = "( 1.3.6.1.4.1.18060.0.4.1.0.10000 DESC 'bogus desc' FQCN org.apache.directory.shared.ldap.schema.syntax.OctetStringSyntaxChecker )";
    SyntaxCheckerDescription syntaxCheckerDescription = parser.parseSyntaxCheckerDescription(simple);
    assertNotNull(syntaxCheckerDescription);
}
Also used : SyntaxCheckerDescription(org.apache.directory.api.ldap.model.schema.parsers.SyntaxCheckerDescription) Test(org.junit.Test)

Example 2 with SyntaxCheckerDescription

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

the class SyntaxCheckerDescriptionSchemaParserTest method testBytecode.

@Test
public void testBytecode() throws ParseException {
    String value = null;
    SyntaxCheckerDescription syntaxCheckerDescription = null;
    // FQCN simple p
    value = "( 1.1 FQCN org.apache.directory.SimpleSyntaxChecker BYTECODE ABCDEFGHIJKLMNOPQRSTUVWXYZ+/abcdefghijklmnopqrstuvwxyz0123456789==== )";
    syntaxCheckerDescription = parser.parseSyntaxCheckerDescription(value);
    assertNotNull(syntaxCheckerDescription.getBytecode());
    assertEquals("ABCDEFGHIJKLMNOPQRSTUVWXYZ+/abcdefghijklmnopqrstuvwxyz0123456789====", syntaxCheckerDescription.getBytecode());
}
Also used : SyntaxCheckerDescription(org.apache.directory.api.ldap.model.schema.parsers.SyntaxCheckerDescription) Test(org.junit.Test)

Example 3 with SyntaxCheckerDescription

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

the class SyntaxCheckerDescriptionSchemaParserTest method testFqcn.

@Test
public void testFqcn() throws ParseException {
    String value = null;
    SyntaxCheckerDescription syntaxCheckerDescription = null;
    // FQCN simple p
    value = "( 1.1 FQCN org.apache.directory.SimpleSyntaxChecker )";
    syntaxCheckerDescription = parser.parseSyntaxCheckerDescription(value);
    assertNotNull(syntaxCheckerDescription.getFqcn());
    assertEquals("org.apache.directory.SimpleSyntaxChecker", syntaxCheckerDescription.getFqcn());
}
Also used : SyntaxCheckerDescription(org.apache.directory.api.ldap.model.schema.parsers.SyntaxCheckerDescription) Test(org.junit.Test)

Example 4 with SyntaxCheckerDescription

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

the class SyntaxCheckerDescriptionSchemaParserTest method testSyntaxCheckerWithDesc.

@Test
public void testSyntaxCheckerWithDesc() throws ParseException {
    String simple = "( " + OID + " DESC '" + DESC + "' FQCN " + FQCN + " )";
    SyntaxCheckerDescription syntaxCheckerDescription = parser.parseSyntaxCheckerDescription(simple);
    assertNotNull(syntaxCheckerDescription);
    assertEquals(OID, syntaxCheckerDescription.getOid());
    assertEquals(FQCN, syntaxCheckerDescription.getFqcn());
    assertNull(syntaxCheckerDescription.getBytecode());
    assertEquals(DESC, syntaxCheckerDescription.getDescription());
}
Also used : SyntaxCheckerDescription(org.apache.directory.api.ldap.model.schema.parsers.SyntaxCheckerDescription) Test(org.junit.Test)

Example 5 with SyntaxCheckerDescription

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

the class SyntaxCheckerDescriptionSchemaParserTest method testSimpleSyntaxChecker.

@Test
public void testSimpleSyntaxChecker() throws ParseException {
    String simple = "( " + OID + " FQCN " + FQCN + " )";
    SyntaxCheckerDescription syntaxCheckerDescription = parser.parseSyntaxCheckerDescription(simple);
    assertNotNull(syntaxCheckerDescription);
    assertEquals(OID, syntaxCheckerDescription.getOid());
    assertEquals(FQCN, syntaxCheckerDescription.getFqcn());
    assertNull(syntaxCheckerDescription.getBytecode());
    assertNull(syntaxCheckerDescription.getDescription());
}
Also used : SyntaxCheckerDescription(org.apache.directory.api.ldap.model.schema.parsers.SyntaxCheckerDescription) Test(org.junit.Test)

Aggregations

SyntaxCheckerDescription (org.apache.directory.api.ldap.model.schema.parsers.SyntaxCheckerDescription)9 Test (org.junit.Test)7 ParseException (java.text.ParseException)1 ArrayList (java.util.ArrayList)1 DefaultEntry (org.apache.directory.api.ldap.model.entry.DefaultEntry)1 Entry (org.apache.directory.api.ldap.model.entry.Entry)1 Value (org.apache.directory.api.ldap.model.entry.Value)1 LdapException (org.apache.directory.api.ldap.model.exception.LdapException)1 SchemaObject (org.apache.directory.api.ldap.model.schema.SchemaObject)1 SchemaObjectWrapper (org.apache.directory.api.ldap.model.schema.SchemaObjectWrapper)1 DefaultSchema (org.apache.directory.api.ldap.model.schema.registries.DefaultSchema)1 Schema (org.apache.directory.api.ldap.model.schema.registries.Schema)1