Examples of ByteArrayComparator


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

    public void testB1PrefixOfB2()
    {
        byte[] b1 = new byte[] { 0, 1, 2 };
        byte[] b2 = new byte[] { 0, 1, 2, 3 };

        assertEquals( -1, new ByteArrayComparator( null ).compare( b1, b2 ) );
    }
View Full Code Here

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

    public void testB2PrefixOfB1()
    {
        byte[] b1 = new byte[] { 0, 1, 2, 3 };
        byte[] b2 = new byte[] { 0, 1, 2 };

        assertEquals( 1, new ByteArrayComparator( null ).compare( b1, b2 ) );
    }
View Full Code Here

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

    public void testB1GreaterThanB2()
    {
        byte[] b1 = new byte[] { 0, 5 };
        byte[] b2 = new byte[] { 0, 1, 2 };

        assertEquals( 1, new ByteArrayComparator( null ).compare( b1, b2 ) );
    }
View Full Code Here

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

    public void testB1GreaterThanB2SameLength()
    {
        byte[] b1 = new byte[] { 0, 5 };
        byte[] b2 = new byte[] { 0, 1 };

        assertEquals( 1, new ByteArrayComparator( null ).compare( b1, b2 ) );
    }
View Full Code Here

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

    public void testB2GreaterThanB1()
    {
        byte[] b1 = new byte[] { 0, 1, 2 };
        byte[] b2 = new byte[] { 0, 5 };

        assertEquals( -1, new ByteArrayComparator( null ).compare( b1, b2 ) );
    }
View Full Code Here

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

    public void testB2GreaterThanB1SameLength()
    {
        byte[] b1 = new byte[] { 0, 1 };
        byte[] b2 = new byte[] { 0, 5 };

        assertEquals( -1, new ByteArrayComparator( null ).compare( b1, b2 ) );
    }
View Full Code Here

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

        } );

        MutableMatchingRule matchingRule = new MutableMatchingRule( "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

                    return comparator
                        .compare( getNormReference(), binaryValue.getNormReference() );
                }
                else
                {
                    return new ByteArrayComparator( null ).compare( getNormReference(), binaryValue
                        .getNormReference() );
                }
            }
            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( getNormValue(), binaryValue.getNormValue() );
        }
    }
View Full Code Here

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

        sb = new EntryUtils.S( "1.1.1.1", false );
        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

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
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.