Examples of ByteArrayComparator


Examples of org.apache.directory.shared.ldap.model.schema.comparators.ByteArrayComparator

                    return comparator
                        .compare( getNormalizedValueReference(), binaryValue.getNormalizedValueReference() );
                }
                else
                {
                    return new ByteArrayComparator( null ).compare( getNormalizedValueReference(), binaryValue
                        .getNormalizedValueReference() );
                }
            }
            catch ( LdapException e )
            {
                String msg = I18n.err( I18n.ERR_04443, Arrays.toString( getReference() ), value );
                LOG.error( msg, e );
                throw new IllegalStateException( msg, e );
            }
        }
        else
        {
            return new ByteArrayComparator( null ).compare( getNormalizedValue(), binaryValue.getNormalizedValue() );
        }
    }
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.schema.comparators.ByteArrayComparator

        } );

        MatchingRule matchingRule = new MatchingRule( "1.2.2" );
        matchingRule.setSyntax( syntax );

        matchingRule.setLdapComparator( new ByteArrayComparator( "1.2.2" ) );
       
        matchingRule.setNormalizer( new Normalizer( "1.1.1" )
        {
            // The serial UID
            private static final long serialVersionUID = 1L;
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.schema.comparators.ByteArrayComparator

        } );

        MatchingRule matchingRule = new MatchingRule( "1.2.2" );
        matchingRule.setSyntax( syntax );

        matchingRule.setLdapComparator( new ByteArrayComparator( "1.2.2" ) );
       
        matchingRule.setNormalizer( new Normalizer( "1.1.1" )
        {
            public Value<?> normalize( Value<?> value ) throws LdapException
            {
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.schema.comparators.ByteArrayComparator

        s = EntryUtils.syntaxFactory( "1.1.1.1", false );
        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

Examples of org.apache.directory.shared.ldap.model.schema.comparators.ByteArrayComparator

public class ByteArrayComparatorTest
{
    @Test
    public void testBothNull()
    {
        assertEquals( 0, new ByteArrayComparator( null ).compare( null, null ) );
    }
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.schema.comparators.ByteArrayComparator

   
    @Test
    public void testB2Null()
    {
        assertEquals( 1, new ByteArrayComparator( null ).compare( new byte[0], null ) );
    }
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.schema.comparators.ByteArrayComparator

   
    @Test
    public void testB1Null()
    {
        assertEquals( -1, new ByteArrayComparator( null ).compare( null, new byte[0] ) );
    }
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.schema.comparators.ByteArrayComparator

   
    @Test
    public void testBothEmpty()
    {
        assertEquals( 0, new ByteArrayComparator( null ).compare( new byte[0], new byte[0] ) );
    }
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.schema.comparators.ByteArrayComparator

   
    @Test
    public void testBothEqualLengthOne()
    {
        assertEquals( 0, new ByteArrayComparator( null ).compare( new byte[1], new byte[1] ) );
    }
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.schema.comparators.ByteArrayComparator

   
    @Test
    public void testBothEqualLengthTen()
    {
        assertEquals( 0, new ByteArrayComparator( null ).compare( new byte[10], new byte[10] ) );
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.