Examples of TestInputStream


Examples of org.apache.jackrabbit.mk.test.util.TestInputStream

        testBlobs(32 * 1024 * 1024, 1024 * 1024);
    }

    private void testBlobs(int size, int bufferSize) {
        // write data
        TestInputStream in = new TestInputStream(size);
        String id = mk.write(in);
        assertNotNull(id);
        assertTrue(in.isClosed());

        // write identical data
        in = new TestInputStream(size);
        String id1 = mk.write(in);
        assertNotNull(id1);
        assertTrue(in.isClosed());
        // both id's must be identical since they refer to identical data
        assertEquals(id, id1);

        // verify length
        assertEquals(mk.getLength(id), size);

        // verify data
        InputStream in1 = new TestInputStream(size);
        InputStream in2 = new BufferedInputStream(
                new MicroKernelInputStream(mk, id), bufferSize);
        try {
            while (true) {
                int x = in1.read();
                int y = in2.read();
                if (x == -1 || y == -1) {
                    if (x == y) {
                        break;
                    }
View Full Code Here

Examples of org.apache.jackrabbit.oak.benchmark.TestInputStream

                            (fileNamePrefix + "File" + counter++),
                            getType());

            Binary binary =
                    parent.getSession().getValueFactory().createBinary(
                            new TestInputStream(FILE_SIZE * 1024));
            try {
                Node content =
                        JcrUtils.getOrAddNode(file, Node.JCR_CONTENT, NodeType.NT_RESOURCE);
                if (indexType != null) {
                    content.addMixin(CUSTOM_INDEX_TYPE);
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.