diff options
author | David Pursehouse <david.pursehouse@gmail.com> | 2018-03-06 13:37:09 +0900 |
---|---|---|
committer | David Pursehouse <david.pursehouse@gmail.com> | 2018-03-06 16:56:13 +0900 |
commit | 751a08b2f4f745cb0ab0d035d5561fd061166dfa (patch) | |
tree | b2f528ee8592f06554bf5b2458a23a1ddc2891ab /org.eclipse.jgit.test | |
parent | 8d845ec549e60799ca95bf5963b88b81078c70b8 (diff) | |
download | jgit-751a08b2f4f745cb0ab0d035d5561fd061166dfa.tar.gz jgit-751a08b2f4f745cb0ab0d035d5561fd061166dfa.zip |
GetTextTest: Use StandardCharsets constants instead of CharSet.forName
Change-Id: I61d626495338a89c014187c38a1f6b49accf7af4
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/patch/GetTextTest.java | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/patch/GetTextTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/patch/GetTextTest.java index 2aaf6afbe3..d376f99517 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/patch/GetTextTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/patch/GetTextTest.java @@ -43,6 +43,8 @@ package org.eclipse.jgit.patch; +import static java.nio.charset.StandardCharsets.ISO_8859_1; +import static java.nio.charset.StandardCharsets.UTF_8; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; @@ -58,7 +60,7 @@ import org.junit.Test; public class GetTextTest { @Test public void testGetText_BothISO88591() throws IOException { - final Charset cs = Charset.forName("ISO-8859-1"); + final Charset cs = ISO_8859_1; final Patch p = parseTestPatchFile(); assertTrue(p.getErrors().isEmpty()); assertEquals(1, p.getFiles().size()); @@ -69,7 +71,7 @@ public class GetTextTest { @Test public void testGetText_NoBinary() throws IOException { - final Charset cs = Charset.forName("ISO-8859-1"); + final Charset cs = ISO_8859_1; final Patch p = parseTestPatchFile(); assertTrue(p.getErrors().isEmpty()); assertEquals(1, p.getFiles().size()); @@ -80,8 +82,8 @@ public class GetTextTest { @Test public void testGetText_Convert() throws IOException { - final Charset csOld = Charset.forName("ISO-8859-1"); - final Charset csNew = Charset.forName("UTF-8"); + final Charset csOld = ISO_8859_1; + final Charset csNew = UTF_8; final Patch p = parseTestPatchFile(); assertTrue(p.getErrors().isEmpty()); assertEquals(1, p.getFiles().size()); @@ -100,8 +102,8 @@ public class GetTextTest { @Test public void testGetText_DiffCc() throws IOException { - final Charset csOld = Charset.forName("ISO-8859-1"); - final Charset csNew = Charset.forName("UTF-8"); + final Charset csOld = ISO_8859_1; + final Charset csNew = UTF_8; final Patch p = parseTestPatchFile(); assertTrue(p.getErrors().isEmpty()); assertEquals(1, p.getFiles().size()); |