Examples of SortedRangeSet


Examples of org.apache.ace.range.SortedRangeSet

     * Tests that if we do not change anything in an {@link InputStream} while committing data, that the version is not
     * bumped for a repository.
     */
    @Test(groups = { UNIT })
    public void testCheckoutAndCommitWithoutChangeDoesNotChangeVersion() throws Exception {
        SortedRangeSet range;
        RepositoryImpl repo = new RepositoryImpl(new File(m_baseDir, "data"), new File(m_baseDir, "tmp"), true);
        InputStream data = new ByteArrayInputStream("abc".getBytes());

        assertTrue(repo.put(data, 1), "Put should have succeeded");

        range = repo.getRange();
        assertEquals(1, range.getHigh(), "Version 1 should be the most recent one");

        InputStream is = repo.checkout(1);
        assertFalse(repo.commit(is, 1), "Commit should be ignored");

        range = repo.getRange();
        assertEquals(1, range.getHigh(), "Version 1 should still be the most recent one");
    }
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.