Add tests for racy git / Index state encoding
commit4ed2f940136c7f49fde0f029e5b301148ca75cfc
authorChristian Halstrick <christian.halstrick@sap.com>
Tue, 20 Jul 2010 19:21:14 +0000 (20 21:21 +0200)
committerShawn O. Pearce <spearce@spearce.org>
Wed, 28 Jul 2010 19:16:23 +0000 (28 12:16 -0700)
tree8da93ab113a39034a621df31e5db8fd6d1e3a5b1
parent6e59e6dab963f2ae796a1e331a716fc7f4f9bfdd
Add tests for racy git / Index state encoding

In order to test racy git situations we have to be able to control
the last-modification timestamps of the filesystem. Since we already
access the modification timestamps of files through an abstraction
(the WorkingTreeIterator) I add a new implementation of this iterator
which allows to map timestamp-ranges to single constant timestamps.
For users of this iterator it looks like all files in that range
have been modified at exactly the same time.
With the help of this iterator a test has been writting which
checkes for racy git handling (smudging, unsmudging, dirty-detection).

Additionally add a method to RepositoryTestCase which encodes the
current index state in one String. This should include info about
pathes, file/index modtime, smudgeState, clean-state. Make
sure timestamps are presented in a way that it is easy to
write assertions against this strings (no concrete milliseconds
but t0,t1,...).

These two topics depend circulary on each other: thats why they have
been squashed in one commit.

Change-Id: I115c3f2f20fca9b481830bdc6b9d1ade2c3abdcf
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RacyGitTests.java [new file with mode: 0644]
org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RepositoryTestCase.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/FileTreeIteratorWithTimeControl.java [new file with mode: 0644]