GetTextTest: Use StandardCharsets constants instead of CharSet.forName
Change-Id: I61d626495338a89c014187c38a1f6b49accf7af4 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
This commit is contained in:
parent
8d845ec549
commit
751a08b2f4
|
@ -43,6 +43,8 @@
|
||||||
|
|
||||||
package org.eclipse.jgit.patch;
|
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.assertEquals;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
import static org.junit.Assert.fail;
|
import static org.junit.Assert.fail;
|
||||||
|
@ -58,7 +60,7 @@
|
||||||
public class GetTextTest {
|
public class GetTextTest {
|
||||||
@Test
|
@Test
|
||||||
public void testGetText_BothISO88591() throws IOException {
|
public void testGetText_BothISO88591() throws IOException {
|
||||||
final Charset cs = Charset.forName("ISO-8859-1");
|
final Charset cs = ISO_8859_1;
|
||||||
final Patch p = parseTestPatchFile();
|
final Patch p = parseTestPatchFile();
|
||||||
assertTrue(p.getErrors().isEmpty());
|
assertTrue(p.getErrors().isEmpty());
|
||||||
assertEquals(1, p.getFiles().size());
|
assertEquals(1, p.getFiles().size());
|
||||||
|
@ -69,7 +71,7 @@ public void testGetText_BothISO88591() throws IOException {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetText_NoBinary() throws IOException {
|
public void testGetText_NoBinary() throws IOException {
|
||||||
final Charset cs = Charset.forName("ISO-8859-1");
|
final Charset cs = ISO_8859_1;
|
||||||
final Patch p = parseTestPatchFile();
|
final Patch p = parseTestPatchFile();
|
||||||
assertTrue(p.getErrors().isEmpty());
|
assertTrue(p.getErrors().isEmpty());
|
||||||
assertEquals(1, p.getFiles().size());
|
assertEquals(1, p.getFiles().size());
|
||||||
|
@ -80,8 +82,8 @@ public void testGetText_NoBinary() throws IOException {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetText_Convert() throws IOException {
|
public void testGetText_Convert() throws IOException {
|
||||||
final Charset csOld = Charset.forName("ISO-8859-1");
|
final Charset csOld = ISO_8859_1;
|
||||||
final Charset csNew = Charset.forName("UTF-8");
|
final Charset csNew = UTF_8;
|
||||||
final Patch p = parseTestPatchFile();
|
final Patch p = parseTestPatchFile();
|
||||||
assertTrue(p.getErrors().isEmpty());
|
assertTrue(p.getErrors().isEmpty());
|
||||||
assertEquals(1, p.getFiles().size());
|
assertEquals(1, p.getFiles().size());
|
||||||
|
@ -100,8 +102,8 @@ public void testGetText_Convert() throws IOException {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetText_DiffCc() throws IOException {
|
public void testGetText_DiffCc() throws IOException {
|
||||||
final Charset csOld = Charset.forName("ISO-8859-1");
|
final Charset csOld = ISO_8859_1;
|
||||||
final Charset csNew = Charset.forName("UTF-8");
|
final Charset csNew = UTF_8;
|
||||||
final Patch p = parseTestPatchFile();
|
final Patch p = parseTestPatchFile();
|
||||||
assertTrue(p.getErrors().isEmpty());
|
assertTrue(p.getErrors().isEmpty());
|
||||||
assertEquals(1, p.getFiles().size());
|
assertEquals(1, p.getFiles().size());
|
||||||
|
|
Loading…
Reference in New Issue