Package org.apache.jackrabbit.mongomk.command

Examples of org.apache.jackrabbit.mongomk.command.ReadBlobCommandMongo.execute()


    @Test
    public void testReadBlobComplete() throws Exception {
        byte[] buffer = new byte[blob.length];
        ReadBlobCommandMongo command = new ReadBlobCommandMongo(mongoConnection, blobId, 0, buffer, 0, blob.length);
        int totalBytes = command.execute();

        Assert.assertEquals(blob.length, totalBytes);
        Assert.assertTrue(Arrays.equals(blob, buffer));
    }
View Full Code Here


    @Test
    public void testReadBlobRangeFromEnd() throws Exception {
        byte[] buffer = new byte[blob.length / 2];
        ReadBlobCommandMongo command = new ReadBlobCommandMongo(mongoConnection, blobId, (blob.length / 2) - 1,
                buffer, 0, blob.length / 2);
        int totalBytes = command.execute();

        Assert.assertEquals(blob.length / 2, totalBytes);
        for (int i = 0; i < buffer.length; i++) {
            Assert.assertEquals(blob[((blob.length / 2) - 1) + i], buffer[i]);
        }
View Full Code Here

    @Test
    public void testReadBlobRangeFromStart() throws Exception {
        byte[] buffer = new byte[blob.length / 2];
        ReadBlobCommandMongo command = new ReadBlobCommandMongo(mongoConnection, blobId, 0, buffer, 0,
                blob.length / 2);
        int totalBytes = command.execute();

        Assert.assertEquals(blob.length / 2, totalBytes);
        for (int i = 0; i < buffer.length; i++) {
            Assert.assertEquals(blob[i], buffer[i]);
        }
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.