aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/tst/org/eclipse/jgit
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jgit.test/tst/org/eclipse/jgit')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/SimilarityIndexTest.java22
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/PackIndexV2Test.java16
2 files changed, 21 insertions, 17 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/SimilarityIndexTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/SimilarityIndexTest.java
index 7e42e53586..1da5828b34 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/SimilarityIndexTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/SimilarityIndexTest.java
@@ -48,10 +48,11 @@ import java.io.IOException;
import junit.framework.TestCase;
+import org.eclipse.jgit.diff.SimilarityIndex.TableFullException;
import org.eclipse.jgit.lib.Constants;
public class SimilarityIndexTest extends TestCase {
- public void testIndexingSmallObject() {
+ public void testIndexingSmallObject() throws TableFullException {
SimilarityIndex si = hash("" //
+ "A\n" //
+ "B\n" //
@@ -70,7 +71,8 @@ public class SimilarityIndexTest extends TestCase {
assertEquals(2, si.count(si.findIndex(key_D)));
}
- public void testIndexingLargeObject() throws IOException {
+ public void testIndexingLargeObject() throws IOException,
+ TableFullException {
byte[] in = ("" //
+ "A\n" //
+ "B\n" //
@@ -81,7 +83,7 @@ public class SimilarityIndexTest extends TestCase {
assertEquals(2, si.size());
}
- public void testCommonScore_SameFiles() {
+ public void testCommonScore_SameFiles() throws TableFullException {
String text = "" //
+ "A\n" //
+ "B\n" //
@@ -96,21 +98,22 @@ public class SimilarityIndexTest extends TestCase {
assertEquals(100, dst.score(src, 100));
}
- public void testCommonScore_EmptyFiles() {
+ public void testCommonScore_EmptyFiles() throws TableFullException {
SimilarityIndex src = hash("");
SimilarityIndex dst = hash("");
assertEquals(0, src.common(dst));
assertEquals(0, dst.common(src));
}
- public void testCommonScore_TotallyDifferentFiles() {
+ public void testCommonScore_TotallyDifferentFiles()
+ throws TableFullException {
SimilarityIndex src = hash("A\n");
SimilarityIndex dst = hash("D\n");
assertEquals(0, src.common(dst));
assertEquals(0, dst.common(src));
}
- public void testCommonScore_SimiliarBy75() {
+ public void testCommonScore_SimiliarBy75() throws TableFullException {
SimilarityIndex src = hash("A\nB\nC\nD\n");
SimilarityIndex dst = hash("A\nB\nC\nQ\n");
assertEquals(6, src.common(dst));
@@ -120,10 +123,11 @@ public class SimilarityIndexTest extends TestCase {
assertEquals(75, dst.score(src, 100));
}
- private static SimilarityIndex hash(String text) {
+ private static SimilarityIndex hash(String text) throws TableFullException {
SimilarityIndex src = new SimilarityIndex() {
@Override
- void hash(byte[] raw, int ptr, final int end) {
+ void hash(byte[] raw, int ptr, final int end)
+ throws TableFullException {
while (ptr < end) {
int hash = raw[ptr] & 0xff;
int start = ptr;
@@ -143,7 +147,7 @@ public class SimilarityIndexTest extends TestCase {
return src;
}
- private static int keyFor(String line) {
+ private static int keyFor(String line) throws TableFullException {
SimilarityIndex si = hash(line);
assertEquals("single line scored", 1, si.size());
return si.key(0);
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/PackIndexV2Test.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/PackIndexV2Test.java
index 2d3ec7b729..0ed336da39 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/PackIndexV2Test.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/PackIndexV2Test.java
@@ -74,21 +74,21 @@ public class PackIndexV2Test extends PackIndexTestCase {
public void testCRC32() throws MissingObjectException,
UnsupportedOperationException {
assertTrue(smallIdx.hasCRC32Support());
- assertEquals(0x00000000C2B64258l, smallIdx.findCRC32(ObjectId
+ assertEquals(0x00000000C2B64258L, smallIdx.findCRC32(ObjectId
.fromString("4b825dc642cb6eb9a060e54bf8d69288fbee4904")));
- assertEquals(0x0000000072AD57C2l, smallIdx.findCRC32(ObjectId
+ assertEquals(0x0000000072AD57C2L, smallIdx.findCRC32(ObjectId
.fromString("540a36d136cf413e4b064c2b0e0a4db60f77feab")));
- assertEquals(0x00000000FF10A479l, smallIdx.findCRC32(ObjectId
+ assertEquals(0x00000000FF10A479L, smallIdx.findCRC32(ObjectId
.fromString("5b6e7c66c276e7610d4a73c70ec1a1f7c1003259")));
- assertEquals(0x0000000034B27DDCl, smallIdx.findCRC32(ObjectId
+ assertEquals(0x0000000034B27DDCL, smallIdx.findCRC32(ObjectId
.fromString("6ff87c4664981e4397625791c8ea3bbb5f2279a3")));
- assertEquals(0x000000004743F1E4l, smallIdx.findCRC32(ObjectId
+ assertEquals(0x000000004743F1E4L, smallIdx.findCRC32(ObjectId
.fromString("82c6b885ff600be425b4ea96dee75dca255b69e7")));
- assertEquals(0x00000000640B358Bl, smallIdx.findCRC32(ObjectId
+ assertEquals(0x00000000640B358BL, smallIdx.findCRC32(ObjectId
.fromString("902d5476fa249b7abc9d84c611577a81381f0327")));
- assertEquals(0x000000002A17CB5El, smallIdx.findCRC32(ObjectId
+ assertEquals(0x000000002A17CB5EL, smallIdx.findCRC32(ObjectId
.fromString("aabf2ffaec9b497f0950352b3e582d73035c2035")));
- assertEquals(0x000000000B3B5BA6l, smallIdx.findCRC32(ObjectId
+ assertEquals(0x000000000B3B5BA6L, smallIdx.findCRC32(ObjectId
.fromString("c59759f143fb1fe21c197981df75a7ee00290799")));
}
}