public void testCheckoutAndCommitWithChangeDoesChangeVersion() 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);
assertNotNull(is, "Nothing checked out?!");
data = new ByteArrayInputStream("def".getBytes());
assertTrue(repo.commit(data, 1), "Commit should NOT be ignored");
range = repo.getRange();
assertEquals(2, range.getHigh());
}
|