Package org.apache.camel.converter.crypto.HMACAccumulator

Examples of org.apache.camel.converter.crypto.HMACAccumulator.CircularBuffer


    }

    @Test
    public void testBufferAdd() throws Exception {
        CircularBuffer buffer = new CircularBuffer(payload.length * 2);
        buffer.write(payload, 0, payload.length);
        assertEquals(payload.length, buffer.availableForWrite());
        buffer.write(payload, 0, payload.length);
        assertEquals(0, buffer.availableForWrite());
        buffer.write(payload, 0, payload.length);
        assertEquals(0, buffer.availableForWrite());
    }
View Full Code Here


        assertEquals(0, buffer.availableForWrite());
    }

    @Test
    public void testBufferDrain() throws Exception {
        CircularBuffer buffer = new CircularBuffer(payload.length * 2);
        buffer.write(payload, 0, payload.length);

        byte[] data = new byte[payload.length >> 1];
        assertEquals(data.length, buffer.read(data, 0, data.length));
        assertEquals(data.length, buffer.read(data, 0, data.length));
        assertEquals(0, buffer.read(data, 0, data.length));
    }
View Full Code Here

        assertEquals(0, buffer.read(data, 0, data.length));
    }

    @Test
    public void testBufferCompare() throws Exception {
        CircularBuffer buffer = new CircularBuffer(payload.length * 2);
        buffer.write(new byte[payload.length >> 1], 0, payload.length >> 1);
        buffer.write(payload, 0, payload.length);
        buffer.compareTo(payload, 0, payload.length);
    }
View Full Code Here

        assertEquals(HexUtils.byteArrayToHexString(expected), HexUtils.byteArrayToHexString(actual));
    }

    @Test
    public void testBufferAdd() throws Exception {
        CircularBuffer buffer = new CircularBuffer(payload.length * 2);
        buffer.write(payload, 0, payload.length);
        assertEquals(payload.length, buffer.availableForWrite());
        buffer.write(payload, 0, payload.length);
        assertEquals(0, buffer.availableForWrite());
        buffer.write(payload, 0, payload.length);
        assertEquals(0, buffer.availableForWrite());
    }
View Full Code Here

        assertEquals(0, buffer.availableForWrite());
    }

    @Test
    public void testBufferDrain() throws Exception {
        CircularBuffer buffer = new CircularBuffer(payload.length * 2);
        buffer.write(payload, 0, payload.length);

        byte[] data = new byte[payload.length >> 1];
        assertEquals(data.length, buffer.read(data, 0, data.length));
        assertEquals(data.length, buffer.read(data, 0, data.length));
        assertEquals(0, buffer.read(data, 0, data.length));
    }
View Full Code Here

        assertEquals(0, buffer.read(data, 0, data.length));
    }

    @Test
    public void testBufferCompare() throws Exception {
        CircularBuffer buffer = new CircularBuffer(payload.length * 2);
        buffer.write(new byte[payload.length >> 1], 0, payload.length >> 1);
        buffer.write(payload, 0, payload.length);
        buffer.compareTo(payload, 0, payload.length);
    }
View Full Code Here

TOP

Related Classes of org.apache.camel.converter.crypto.HMACAccumulator.CircularBuffer

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.