diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2013-01-24 15:57:11 -0500 |
---|---|---|
committer | Gerrit Code Review @ Eclipse.org <gerrit@eclipse.org> | 2013-01-24 15:57:11 -0500 |
commit | 33bc4f7c052fc7a1150f0c9671736329d8100e29 (patch) | |
tree | 8f1e8366a8b2b2526339a9a7e3fa0b4adeaaedeb | |
parent | aa2db859ea536f1e44c3ad641fb68fe4243d4737 (diff) | |
parent | e522d95a51422e76e3da1b781b24142ad65abcc9 (diff) | |
download | jgit-33bc4f7c052fc7a1150f0c9671736329d8100e29.tar.gz jgit-33bc4f7c052fc7a1150f0c9671736329d8100e29.zip |
Merge changes I25204d9e,Ia10d76e9
* changes:
Attempt to stabilize GCTest
Attempt to stabilize FileTreeIterator test on Windows
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/GCTest.java | 11 | ||||
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/FileTreeIteratorTest.java | 4 |
2 files changed, 14 insertions, 1 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/GCTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/GCTest.java index 8b6c003888..820a8ae07e 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/GCTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/GCTest.java @@ -304,6 +304,7 @@ public class GCTest extends LocalDiskRepositoryTestCase { public void nonReferencedExpiredObject_pruned() throws Exception { RevBlob a = tr.blob("a"); gc.setExpireAgeMillis(0); + fsTick(); gc.prune(Collections.<ObjectId> emptySet()); assertFalse(repo.hasObject(a)); } @@ -313,6 +314,7 @@ public class GCTest extends LocalDiskRepositoryTestCase { RevBlob a = tr.blob("a"); RevTree t = tr.tree(tr.file("a", a)); gc.setExpireAgeMillis(0); + fsTick(); gc.prune(Collections.<ObjectId> emptySet()); assertFalse(repo.hasObject(t)); assertFalse(repo.hasObject(a)); @@ -336,6 +338,7 @@ public class GCTest extends LocalDiskRepositoryTestCase { RevBlob a = tr.blob("a"); tr.lightweightTag("t", a); gc.setExpireAgeMillis(0); + fsTick(); gc.prune(Collections.<ObjectId> emptySet()); assertTrue(repo.hasObject(a)); } @@ -347,6 +350,7 @@ public class GCTest extends LocalDiskRepositoryTestCase { tr.lightweightTag("t", t); gc.setExpireAgeMillis(0); + fsTick(); gc.prune(Collections.<ObjectId> emptySet()); assertTrue(repo.hasObject(t)); assertTrue(repo.hasObject(a)); @@ -357,6 +361,7 @@ public class GCTest extends LocalDiskRepositoryTestCase { RevCommit tip = commitChain(10); tr.branch("b").update(tip); gc.setExpireAgeMillis(0); + fsTick(); gc.prune(Collections.<ObjectId> emptySet()); do { assertTrue(repo.hasObject(tip)); @@ -376,6 +381,7 @@ public class GCTest extends LocalDiskRepositoryTestCase { update.setForceUpdate(true); update.delete(); gc.setExpireAgeMillis(0); + fsTick(); gc.prune(Collections.<ObjectId> emptySet()); assertTrue(gc.getStatistics().numberOfLooseObjects == 0); } @@ -404,6 +410,7 @@ public class GCTest extends LocalDiskRepositoryTestCase { update.delete(); gc.setExpireAgeMillis(0); + fsTick(); gc.prune(Collections.<ObjectId> emptySet()); assertTrue(repo.hasObject(b2Tip)); } @@ -532,6 +539,7 @@ public class GCTest extends LocalDiskRepositoryTestCase { assertEquals(0, stats.numberOfPackedObjects); gc.setExpireAgeMillis(0); + fsTick(); gc.gc(); stats = gc.getStatistics(); assertEquals(0, stats.numberOfLooseObjects); @@ -581,6 +589,7 @@ public class GCTest extends LocalDiskRepositoryTestCase { assertEquals(8, stats.numberOfLooseObjects); assertEquals(0, stats.numberOfPackedObjects); gc.setExpireAgeMillis(0); + fsTick(); gc.gc(); stats = gc.getStatistics(); assertEquals(0, stats.numberOfLooseObjects); @@ -640,6 +649,7 @@ public class GCTest extends LocalDiskRepositoryTestCase { assertEquals(9, stats.numberOfLooseObjects); assertEquals(0, stats.numberOfPackedObjects); gc.setExpireAgeMillis(0); + fsTick(); gc.gc(); stats = gc.getStatistics(); assertEquals(0, stats.numberOfLooseObjects); @@ -657,6 +667,7 @@ public class GCTest extends LocalDiskRepositoryTestCase { stats = gc.getStatistics(); assertEquals(8, stats.numberOfLooseObjects); gc.setExpireAgeMillis(0); + fsTick(); gc.prune(Collections.<ObjectId> emptySet()); stats = gc.getStatistics(); assertEquals(8, stats.numberOfLooseObjects); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/FileTreeIteratorTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/FileTreeIteratorTest.java index bf22569dfb..a416c742f8 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/FileTreeIteratorTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/FileTreeIteratorTest.java @@ -253,14 +253,16 @@ public class FileTreeIteratorTest extends RepositoryTestCase { // Hopefully fsTick will make sure our entry gets smudged fsTick(f); writeTrashFile("file", "content"); + long lastModified = f.lastModified(); git.add().addFilepattern("file").call(); writeTrashFile("file", "conten2"); + f.setLastModified(lastModified); DirCacheEntry dce = db.readDirCache().getEntry("file"); FileTreeIterator fti = new FileTreeIterator(trash, db.getFS(), db .getConfig().get(WorkingTreeOptions.KEY)); while (!fti.getEntryPathString().equals("file")) fti.next(1); - // If the fsTick trick does not work we could skip the compareMetaData + // If the rounding trick does not work we could skip the compareMetaData // test and hope that we are usually testing the intended code path. assertEquals(MetadataDiff.SMUDGED, fti.compareMetadata(dce)); assertTrue(fti.isModified(dce, false)); |