summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
diff options
context:
space:
mode:
authorHan-Wen NIenhuys <hanwen@google.com>2017-10-24 11:25:50 -0400
committerHan-Wen NIenhuys <hanwen@google.com>2017-10-24 11:26:10 -0400
commitdc24383b6be8bd1e90a6754ea4791af13abb2fc7 (patch)
tree8fb84a5268319c29f009c3ba80640cb91f648263 /org.eclipse.jgit.test
parentf5ae26f74d9ba28ec97e4355112b4d21efa714cc (diff)
downloadjgit-dc24383b6be8bd1e90a6754ea4791af13abb2fc7.tar.gz
jgit-dc24383b6be8bd1e90a6754ea4791af13abb2fc7.zip
Revert "Throw BinaryBlobException from RawParseUtils#lineMap."
This reverts commit f2e64cd895a6aa4f18ab3b876f13b7814fb98f04. The newly added throws clause breaks backward compatibility. Change-Id: Ifa76a1b95935e52640b81cd53c171eb17da175c2 Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/RawTextTest.java10
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/util/RawParseUtils_LineMapTest.java18
2 files changed, 9 insertions, 19 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/RawTextTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/RawTextTest.java
index 3b563b3afb..93ea9a7ab5 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/RawTextTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/RawTextTest.java
@@ -65,16 +65,6 @@ public class RawTextTest {
}
@Test
- public void testBinary() {
- String input = "foo-a\nf\0o-b\n";
- byte[] data = Constants.encodeASCII(input);
- final RawText a = new RawText(data);
- assertEquals(a.content, data);
- assertEquals(a.size(), 1);
- assertEquals(a.getString(0, 1, false), input);
- }
-
- @Test
public void testEquals() {
final RawText a = new RawText(Constants.encodeASCII("foo-a\nfoo-b\n"));
final RawText b = new RawText(Constants.encodeASCII("foo-b\nfoo-c\n"));
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/RawParseUtils_LineMapTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/RawParseUtils_LineMapTest.java
index fe070c80af..6efdce6d77 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/RawParseUtils_LineMapTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/RawParseUtils_LineMapTest.java
@@ -48,45 +48,45 @@ import static org.junit.Assert.assertNotNull;
import java.io.UnsupportedEncodingException;
-import org.eclipse.jgit.errors.BinaryBlobException;
import org.junit.Test;
public class RawParseUtils_LineMapTest {
@Test
- public void testEmpty() throws Exception {
+ public void testEmpty() {
final IntList map = RawParseUtils.lineMap(new byte[] {}, 0, 0);
assertNotNull(map);
assertArrayEquals(new int[]{Integer.MIN_VALUE, 0}, asInts(map));
}
@Test
- public void testOneBlankLine() throws Exception {
+ public void testOneBlankLine() {
final IntList map = RawParseUtils.lineMap(new byte[] { '\n' }, 0, 1);
assertArrayEquals(new int[]{Integer.MIN_VALUE, 0, 1}, asInts(map));
}
@Test
- public void testTwoLineFooBar() throws Exception {
+ public void testTwoLineFooBar() throws UnsupportedEncodingException {
final byte[] buf = "foo\nbar\n".getBytes("ISO-8859-1");
final IntList map = RawParseUtils.lineMap(buf, 0, buf.length);
assertArrayEquals(new int[]{Integer.MIN_VALUE, 0, 4, buf.length}, asInts(map));
}
@Test
- public void testTwoLineNoLF() throws Exception {
+ public void testTwoLineNoLF() throws UnsupportedEncodingException {
final byte[] buf = "foo\nbar".getBytes("ISO-8859-1");
final IntList map = RawParseUtils.lineMap(buf, 0, buf.length);
assertArrayEquals(new int[]{Integer.MIN_VALUE, 0, 4, buf.length}, asInts(map));
}
- @Test(expected = BinaryBlobException.class)
- public void testBinary() throws Exception {
+ @Test
+ public void testBinary() throws UnsupportedEncodingException {
final byte[] buf = "xxxfoo\nb\0ar".getBytes("ISO-8859-1");
- RawParseUtils.lineMap(buf, 3, buf.length);
+ final IntList map = RawParseUtils.lineMap(buf, 3, buf.length);
+ assertArrayEquals(new int[]{Integer.MIN_VALUE, 3, buf.length}, asInts(map));
}
@Test
- public void testFourLineBlanks() throws Exception {
+ public void testFourLineBlanks() throws UnsupportedEncodingException {
final byte[] buf = "foo\n\n\nbar\n".getBytes("ISO-8859-1");
final IntList map = RawParseUtils.lineMap(buf, 0, buf.length);