Make sure deprecated CharEncoding constants are equal to the values defined in StandardCharsets
This commit is contained in:
parent
18e692478d
commit
5ffb662019
|
@ -17,11 +17,14 @@
|
|||
|
||||
package org.apache.commons.lang3;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
/**
|
||||
* Tests CharEncoding.
|
||||
*
|
||||
|
@ -68,4 +71,14 @@ public class CharEncodingTest {
|
|||
assertFalse(CharEncoding.isSupported("DOESNOTEXIST"));
|
||||
assertFalse(CharEncoding.isSupported("this is not a valid encoding name"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testStandardCharsetsEquality() throws Exception {
|
||||
assertEquals(StandardCharsets.ISO_8859_1.name(), CharEncoding.ISO_8859_1);
|
||||
assertEquals(StandardCharsets.US_ASCII.name(), CharEncoding.US_ASCII);
|
||||
assertEquals(StandardCharsets.UTF_8.name(), CharEncoding.UTF_8);
|
||||
assertEquals(StandardCharsets.UTF_16.name(), CharEncoding.UTF_16);
|
||||
assertEquals(StandardCharsets.UTF_16BE.name(), CharEncoding.UTF_16BE);
|
||||
assertEquals(StandardCharsets.UTF_16LE.name(), CharEncoding.UTF_16LE);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue