summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
diff options
context:
space:
mode:
authorMinh Thai <mthai@google.com>2017-11-27 14:28:11 -0800
committerMinh Thai <mthai@google.com>2017-11-27 21:55:21 -0800
commit159da6dacc6b60fde77cf10e82312a277c787a3f (patch)
tree5d0549d4f070c0488316e22c3a5862063acd2b1b /org.eclipse.jgit.test
parentc213f0a4cde35d42230f7caf0780c0e8b62f44d0 (diff)
downloadjgit-159da6dacc6b60fde77cf10e82312a277c787a3f.tar.gz
jgit-159da6dacc6b60fde77cf10e82312a277c787a3f.zip
Break down DfsBlockCache stats by pack file extension.
Change-Id: Iaecf0580279b33e3e2439784528cae7b69fb28bc Signed-off-by: Minh Thai <mthai@google.com>
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DeltaBaseCacheTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DfsBlockCacheTest.java9
2 files changed, 6 insertions, 5 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DeltaBaseCacheTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DeltaBaseCacheTest.java
index 32d711f1f8..6a5d3c2347 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DeltaBaseCacheTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DeltaBaseCacheTest.java
@@ -64,7 +64,7 @@ public class DeltaBaseCacheTest {
@Before
public void setUp() {
DfsRepositoryDescription repo = new DfsRepositoryDescription("test");
- key = DfsStreamKey.of(repo, "test.key");
+ key = DfsStreamKey.of(repo, "test.key", null);
cache = new DeltaBaseCache(SZ);
rng = new TestRng(getClass().getSimpleName());
}
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DfsBlockCacheTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DfsBlockCacheTest.java
index 2e3ee4526f..d29744dfc5 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DfsBlockCacheTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DfsBlockCacheTest.java
@@ -50,6 +50,7 @@ import static org.junit.Assert.assertTrue;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
+import java.util.stream.LongStream;
import org.eclipse.jgit.junit.TestRng;
import org.eclipse.jgit.lib.ObjectId;
@@ -84,9 +85,9 @@ public class DfsBlockCacheTest {
ins.flush();
}
- long oldSize = cache.getCurrentSize();
+ long oldSize = LongStream.of(cache.getCurrentSize()).sum();
assertTrue(oldSize > 2000);
- assertEquals(0, cache.getHitCount());
+ assertEquals(0, LongStream.of(cache.getHitCount()).sum());
List<DfsPackDescription> packs = r1.getObjectDatabase().listPacks();
InMemoryRepository r2 = new InMemoryRepository(repo);
@@ -95,8 +96,8 @@ public class DfsBlockCacheTest {
byte[] actual = rdr.open(id, OBJ_BLOB).getBytes();
assertTrue(Arrays.equals(content, actual));
}
- assertEquals(0, cache.getMissCount());
- assertEquals(oldSize, cache.getCurrentSize());
+ assertEquals(0, LongStream.of(cache.getMissCount()).sum());
+ assertEquals(oldSize, LongStream.of(cache.getCurrentSize()).sum());
}
@SuppressWarnings("resource")