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

Examples of org.apache.directory.shared.ldap.model.csn.Csn


    @Test
    public void testNullCSNs()
    {
        assertEquals( 0, comparator.compare( null, null ) );

        Csn csn2 = new Csn( System.currentTimeMillis(), 1, 1, 1 );
        assertEquals( -1, comparator.compare( null, csn2.toString() ) );

        assertEquals( 1, comparator.compare( csn2.toString(), null ) );
    }
View Full Code Here


    @Test
    public void testEqualsCSNs()
    {
        long t0 = System.currentTimeMillis();
        Csn csn1 = new Csn( t0, 0, 0, 0 );
        Csn csn2 = new Csn( t0, 0, 0, 0 );

        assertEquals( 0, comparator.compare( csn1.toString(), csn2.toString() ) );
    }
View Full Code Here

    @Test
    public void testDifferentTimeStampCSNs()
    {
        long t0 = System.currentTimeMillis();
        long t1 = System.currentTimeMillis() + 1000;
        Csn csn1 = new Csn( t0, 0, 0, 0 );
        Csn csn2 = new Csn( t1, 0, 0, 0 );

        assertEquals( -1, comparator.compare( csn1.toString(), csn2.toString() ) );
        assertEquals( 1, comparator.compare( csn2.toString(), csn1.toString() ) );
    }
View Full Code Here

    @Test
    public void testDifferentChangeCountCSNs()
    {
        long t0 = System.currentTimeMillis();
        Csn csn1 = new Csn( t0, 0, 0, 0 );
        Csn csn2 = new Csn( t0, 1, 0, 0 );

        assertEquals( -1, comparator.compare( csn1.toString(), csn2.toString() ) );
        assertEquals( 1, comparator.compare( csn2.toString(), csn1.toString() ) );
    }
View Full Code Here

    @Test
    public void testDifferentReplicaIdCSNs()
    {
        long t0 = System.currentTimeMillis();
        Csn csn1 = new Csn( t0, 0, 0, 0 );
        Csn csn2 = new Csn( t0, 0, 1, 0 );

        assertEquals( -1, comparator.compare( csn1.toString(), csn2.toString() ) );
        assertEquals( 1, comparator.compare( csn2.toString(), csn1.toString() ) );
    }
View Full Code Here

    @Test
    public void testDifferentOperationNumberCSNs()
    {
        long t0 = System.currentTimeMillis();
        Csn csn1 = new Csn( t0, 0, 0, 0 );
        Csn csn2 = new Csn( t0, 0, 0, 1 );

        assertEquals( -1, comparator.compare( csn1.toString(), csn2.toString() ) );
        assertEquals( 1, comparator.compare( csn2.toString(), csn1.toString() ) );
    }
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.model.csn.Csn

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.