1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.commons.codec;
19
20 import static org.junit.jupiter.api.Assertions.assertEquals;
21
22 import java.nio.charset.StandardCharsets;
23
24 import org.junit.jupiter.api.Test;
25
26
27
28
29 public class CharEncodingTest {
30
31
32
33
34 @Test
35 public void testConstructor() {
36 new CharEncoding();
37 }
38
39 @Test
40 public void testIso8859_1() {
41 assertEquals(StandardCharsets.ISO_8859_1.name(), CharEncoding.ISO_8859_1);
42 }
43
44 @Test
45 public void testUsAscii() {
46 assertEquals(StandardCharsets.US_ASCII.name(), CharEncoding.US_ASCII);
47 }
48
49 @Test
50 public void testUtf16() {
51 assertEquals(StandardCharsets.UTF_16.name(), CharEncoding.UTF_16);
52 }
53
54 @Test
55 public void testUtf16Be() {
56 assertEquals(StandardCharsets.UTF_16BE.name(), CharEncoding.UTF_16BE);
57 }
58
59 @Test
60 public void testUtf16Le() {
61 assertEquals(StandardCharsets.UTF_16LE.name(), CharEncoding.UTF_16LE);
62 }
63
64 @Test
65 public void testUtf8() {
66 assertEquals(StandardCharsets.UTF_8.name(), CharEncoding.UTF_8);
67 }
68
69 }