Examples of compare()


Examples of org.apache.directory.mavibot.btree.comparator.ShortArrayComparator.compare()

    public void testShortArrayComparator()
    {
        ShortArrayComparator comparator = new ShortArrayComparator();

        // Check equality
        assertEquals( 0, comparator.compare( null, null ) );
        assertEquals( 0, comparator.compare( new short[]
            {}, new short[]
            {} ) );
        assertEquals( 0, comparator.compare( new short[]
            { ( short ) 1, ( short ) 2 }, new short[]
View Full Code Here

Examples of org.apache.directory.mavibot.btree.comparator.ShortComparator.compare()

        assertEquals( 0, comparator.compare( ( short ) -1, ( short ) -1 ) );
        assertEquals( 1, comparator.compare( ( short ) 1, null ) );
        assertEquals( 1, comparator.compare( ( short ) 2, ( short ) 1 ) );
        assertEquals( 1, comparator.compare( ( short ) 3, ( short ) 1 ) );
        assertEquals( 1, comparator.compare( ( short ) 1, ( short ) -1 ) );
        assertEquals( -1, comparator.compare( null, ( short ) 1 ) );
        assertEquals( -1, comparator.compare( ( short ) 1, ( short ) 2 ) );
        assertEquals( -1, comparator.compare( ( short ) -1, ( short ) 1 ) );
    }
}
View Full Code Here

Examples of org.apache.directory.mavibot.btree.comparator.StringComparator.compare()

    @Test
    public void testStringComparator()
    {
        StringComparator comparator = new StringComparator();

        assertEquals( 0, comparator.compare( null, null ) );
        assertEquals( 0, comparator.compare( "", "" ) );
        assertEquals( 0, comparator.compare( "abc", "abc" ) );
        assertEquals( 1, comparator.compare( "", null ) );
        assertEquals( 1, comparator.compare( "abc", "" ) );
        assertEquals( 1, comparator.compare( "ac", "ab" ) );
View Full Code Here

Examples of org.apache.directory.server.core.CoreSession.compare()

    {
        CoreSession session = service.getAdminSession();
       
        try
        {
            session.compare( new DN( "cn=Emmanuel Lecharny,ou=Roles,o=MNN,c=WW,ou=system" ), "cn", "Emmanuel Lecharny", false );
            fail();
        }
        catch ( ReferralException re )
        {
            int nbRefs = 0;
View Full Code Here

Examples of org.apache.directory.server.core.OperationManager.compare()

           
            // Inject the referral handling into the operation context
            injectReferralControl( opContext );

            // Call the operation
            boolean result = operationManager.compare( (CompareOperationContext)opContext );

            // setup the op context and populate with request controls
            opContext = new SearchOperationContext( session, dn, filter,
                searchControls );
            ((SearchOperationContext)opContext).setAliasDerefMode( aliasDerefMode );
View Full Code Here

Examples of org.apache.directory.server.core.api.CoreSession.compare()

    {
        CoreSession session = getService().getAdminSession();
       
        try
        {
            session.compare( new Dn( "cn=Emmanuel Lecharny,ou=Roles,o=MNN,c=WW,ou=system" ), "cn", "Emmanuel Lecharny", false );
            fail();
        }
        catch ( LdapReferralException re )
        {
            int nbRefs = 0;
View Full Code Here

Examples of org.apache.directory.server.core.api.OperationManager.compare()

     */
    public boolean compare( Dn dn, String oid, Object value ) throws LdapException
    {
        OperationManager operationManager = directoryService.getOperationManager();

        return operationManager.compare( new CompareOperationContext( this, dn, oid, convertToValue( oid, value ) ) );
    }


    /**
     * {@inheritDoc}
 
View Full Code Here

Examples of org.apache.directory.server.core.api.interceptor.Interceptor.compare()

        lockRead();

        try
        {
            result = head.compare( compareContext );
        }
        finally
        {
            unlockRead();
        }
View Full Code Here

Examples of org.apache.directory.server.core.interceptor.InterceptorChain.compare()

            // Unlock the ReferralManager
            directoryService.getReferralManager().unlock();

            // Call the Add method
            InterceptorChain interceptorChain = directoryService.getInterceptorChain();
            return interceptorChain.compare( opContext );
        }
        finally
        {
            pop();
View Full Code Here

Examples of org.apache.directory.server.core.jndi.ServerLdapContext.compare()

            adminContext.createSubcontext( entryRdn, testEntry );

            // compare the telephone numbers
            DirContext userContext = getContextAs( userName, password );
            ServerLdapContext ctx = ( ServerLdapContext ) userContext.lookup( "" );
            ctx.compare( new DN( entryRdn + ",ou=system" ), "telephoneNumber", number );

            // don't return compare result which can be false but true since op was permitted
            return true;
        }
        catch ( LdapNoPermissionException e )
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.