Package org.apache.directory.shared.ldap.model.schema

Examples of org.apache.directory.shared.ldap.model.schema.Normalizer


        // Check that the MR and N are present
        assertTrue( isMatchingRulePresent( schemaManager, OID ) );
        assertTrue( isNormalizerPresent( schemaManager, OID ) );

        // Now try to remove the N
        Normalizer normalizer = schemaManager.lookupNormalizerRegistry( OID );
       
        // shouldn't be deleted cause there is a MR associated with it
        assertFalse( schemaManager.delete( normalizer ) );

        List<Throwable> errors = schemaManager.getErrors();
View Full Code Here


     */
    private void addNormalizers( Schema schema, Registries registries ) throws LdapException, IOException
    {
        for ( Entry entry : schemaLoader.loadNormalizers( schema ) )
        {
            Normalizer normalizer = factory.getNormalizer( this, entry, registries, schema.getSchemaName() );

            addSchemaObject( registries, normalizer, schema );
        }
    }
View Full Code Here

            ldapSchemaException.setSourceObject( matchingRule );
            errors.add( ldapSchemaException );
        }

        // Process the Normalizer
        Normalizer normalizer = matchingRule.getNormalizer();

        if ( normalizer == null )
        {
            // Ok, no normalizer, this is an error
            Throwable error = new LdapSchemaViolationException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, I18n.err(
View Full Code Here

public class TelephoneNumberNormalizerTest
{
    @Test
    public void testTelephoneNumberNormalizerNull() throws LdapException
    {
        Normalizer normalizer = new TelephoneNumberNormalizer();
        assertEquals( "", normalizer.normalize( ( String ) null ) );
    }
View Full Code Here


    @Test
    public void testTelephoneNumberNormalizerEmpty() throws LdapException
    {
        Normalizer normalizer = new TelephoneNumberNormalizer();
        assertEquals( "", normalizer.normalize( "" ) );
    }
View Full Code Here


    @Test
    public void testTelephoneNumberNormalizerOneSpace() throws LdapException
    {
        Normalizer normalizer = new TelephoneNumberNormalizer();
        assertEquals( "", normalizer.normalize( " " ) );
    }
View Full Code Here


    @Test
    public void testTelephoneNumberNormalizerTwoSpaces() throws LdapException
    {
        Normalizer normalizer = new TelephoneNumberNormalizer();
        assertEquals( "", normalizer.normalize( "  " ) );
    }
View Full Code Here


    @Test
    public void testTelephoneNumberNormalizerNSpaces() throws LdapException
    {
        Normalizer normalizer = new TelephoneNumberNormalizer();
        assertEquals( "", normalizer.normalize( "      " ) );
    }
View Full Code Here

        sb.setSyntaxChecker( new OctetStringSyntaxChecker() );
        mrb = new EntryUtils.MR( "1.1.2.1" );
        mrb.setSyntax( sb );
       
        mrb.setLdapComparator( new ByteArrayComparator( "1.1.1" ) );
        mrb.setNormalizer( new Normalizer( "1.1.1" )
        {
            public Value<?> normalize( Value<?> value ) throws LdapException
            {
                if ( !value.isHumanReadable() )
                {
View Full Code Here

        s.setSyntaxChecker( new OctetStringSyntaxChecker() );
        mr = EntryUtils.matchingRuleFactory( "1.1.2.1" );
        mr.setSyntax( s );
       
        mr.setLdapComparator( new ByteArrayComparator( "1.1.1" ) );
        mr.setNormalizer( new Normalizer( "1.1.1" )
        {
            public Value<?> normalize( Value<?> value ) throws LdapException
            {
                if ( !value.isHumanReadable() )
                {
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.model.schema.Normalizer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.