Package org.apache.directory.mavibot.btree

Examples of org.apache.directory.mavibot.btree.RevisionName


    public void testRevisionNameComparator()
    {
        RevisionNameComparator comparator = new RevisionNameComparator();

        assertEquals( 0, comparator.compare( null, null ) );
        assertEquals( 0, comparator.compare( new RevisionName( 0L, "test" ), new RevisionName( 0L, "test" ) ) );
        assertEquals( 1, comparator.compare( new RevisionName( 3L, "test" ), new RevisionName( 0L, "test" ) ) );
        assertEquals( -1, comparator.compare( new RevisionName( 3L, "test" ), new RevisionName( 5L, "test" ) ) );
        assertEquals( 1, comparator.compare( new RevisionName( 3L, "test2" ), new RevisionName( 3L, "test1" ) ) );
        assertEquals( -1, comparator.compare( new RevisionName( 3L, "test" ), new RevisionName( 3L, "test2" ) ) );
    }
View Full Code Here



    @Test
    public void testRevisionNameSerializer() throws IOException
    {
        RevisionName value = null;

        try
        {
            serializer.serialize( value );
            fail();
        }
        catch ( Exception e )
        {
            //exptected
        }

        // ------------------------------------------------------------------
        value = new RevisionName( 1L, null );
        byte[] result = serializer.serialize( value );

        assertEquals( 12, result.length );

        assertEquals( 1L, ( long ) LongSerializer.deserialize( result ) );
        assertNull( StringSerializer.deserialize( result, 8 ) );

        assertEquals( value, serializer.deserialize( new BufferHandler( result ) ) );

        // ------------------------------------------------------------------
        value = new RevisionName( 0L, "" );
        result = serializer.serialize( value );

        assertEquals( value, serializer.deserialize( new BufferHandler( result ) ) );

        // ------------------------------------------------------------------
        value = new RevisionName( 0L, "L\u00E9charny" );
        result = serializer.serialize( value );

        assertEquals( value, serializer.deserialize( new BufferHandler( result ) ) );
    }
View Full Code Here

    public void testRevisionNameComparator()
    {
        RevisionNameComparator comparator = new RevisionNameComparator();

        assertEquals( 0, comparator.compare( null, null ) );
        assertEquals( 0, comparator.compare( new RevisionName( 0L, "test" ), new RevisionName( 0L, "test" ) ) );
        assertEquals( 1, comparator.compare( new RevisionName( 3L, "test" ), new RevisionName( 0L, "test" ) ) );
        assertEquals( -1, comparator.compare( new RevisionName( 3L, "test" ), new RevisionName( 5L, "test" ) ) );
        assertEquals( 1, comparator.compare( new RevisionName( 3L, "test2" ), new RevisionName( 3L, "test1" ) ) );
        assertEquals( -1, comparator.compare( new RevisionName( 3L, "test" ), new RevisionName( 3L, "test2" ) ) );
    }
View Full Code Here


    @Test
    public void testRevisionNameSerializer() throws IOException
    {
        RevisionName value = null;

        try
        {
            serializer.serialize( value );
            fail();
        }
        catch ( Exception e )
        {
            //exptected
        }

        // ------------------------------------------------------------------
        value = new RevisionName( 1L, null );
        byte[] result = serializer.serialize( value );

        assertEquals( 12, result.length );

        assertEquals( 1L, ( long ) LongSerializer.deserialize( result ) );
        assertNull( StringSerializer.deserialize( result, 8 ) );

        assertEquals( value, serializer.deserialize( new BufferHandler( result ) ) );

        // ------------------------------------------------------------------
        value = new RevisionName( 0L, "" );
        result = serializer.serialize( value );

        assertEquals( value, serializer.deserialize( new BufferHandler( result ) ) );

        // ------------------------------------------------------------------
        value = new RevisionName( 0L, "L\u00E9charny" );
        result = serializer.serialize( value );

        assertEquals( value, serializer.deserialize( new BufferHandler( result ) ) );
    }
View Full Code Here


    @Test
    public void testRevisionNameSerializer() throws IOException
    {
        RevisionName value = null;

        try
        {
            serializer.serialize( value );
            fail();
        }
        catch ( Exception e )
        {
            //exptected
        }

        // ------------------------------------------------------------------
        value = new RevisionName( 1L, null );
        byte[] result = serializer.serialize( value );

        assertEquals( 12, result.length );

        assertEquals( 1L, ( long ) LongSerializer.deserialize( result ) );
        assertNull( StringSerializer.deserialize( result, 8 ) );

        assertEquals( value, serializer.deserialize( new BufferHandler( result ) ) );

        // ------------------------------------------------------------------
        value = new RevisionName( 0L, "" );
        result = serializer.serialize( value );

        assertEquals( value, serializer.deserialize( new BufferHandler( result ) ) );

        // ------------------------------------------------------------------
        value = new RevisionName( 0L, "L\u00E9charny" );
        result = serializer.serialize( value );

        assertEquals( value, serializer.deserialize( new BufferHandler( result ) ) );
    }
View Full Code Here

    public void testRevisionNameComparator()
    {
        RevisionNameComparator comparator = new RevisionNameComparator();

        assertEquals( 0, comparator.compare( null, null ) );
        assertEquals( 0, comparator.compare( new RevisionName( 0L, "test" ), new RevisionName( 0L, "test" ) ) );
        assertEquals( 1, comparator.compare( new RevisionName( 3L, "test" ), new RevisionName( 0L, "test" ) ) );
        assertEquals( -1, comparator.compare( new RevisionName( 3L, "test" ), new RevisionName( 5L, "test" ) ) );
        assertEquals( 1, comparator.compare( new RevisionName( 3L, "test2" ), new RevisionName( 3L, "test1" ) ) );
        assertEquals( -1, comparator.compare( new RevisionName( 3L, "test" ), new RevisionName( 3L, "test2" ) ) );
    }
View Full Code Here

TOP

Related Classes of org.apache.directory.mavibot.btree.RevisionName

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.