1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.supercsv.exception;
17
18 import static org.junit.Assert.assertEquals;
19 import static org.junit.Assert.assertNull;
20
21 import org.junit.Test;
22
23
24
25
26
27
28 public class SuperCsvReflectionExceptionTest {
29
30 private static final String MSG = "Reflection failed";
31 private static final Throwable THROWABLE = new RuntimeException("Mirror is broken");
32
33
34
35
36 @Test
37 public void testConstructor1() {
38 SuperCsvReflectionException e = new SuperCsvReflectionException(MSG);
39 assertEquals(MSG, e.getMessage());
40
41
42 e = new SuperCsvReflectionException(null);
43 assertNull(e.getMessage());
44 }
45
46
47
48
49 @Test
50 public void testConstructor2() {
51 SuperCsvReflectionException e = new SuperCsvReflectionException(MSG, THROWABLE);
52 assertEquals(MSG, e.getMessage());
53 assertEquals(THROWABLE, e.getCause());
54
55
56 e = new SuperCsvReflectionException(null, null);
57 assertNull(e.getMessage());
58 assertNull(e.getCause());
59 }
60
61 }