1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package javax.faces;
21
22 import junit.framework.TestCase;
23
24 public class FacesExceptionTest extends TestCase {
25
26 public static void main(String[] args) {
27 junit.textui.TestRunner.run(FacesExceptionTest.class);
28 }
29
30 public FacesExceptionTest(String name) {
31 super(name);
32 }
33
34 protected void setUp() throws Exception {
35 super.setUp();
36 }
37
38 protected void tearDown() throws Exception {
39 super.tearDown();
40 }
41
42
43
44
45 public void testFacesException() {
46 FacesException e = new FacesException();
47 assertNull(e.getCause());
48 assertNull(e.getMessage());
49 }
50
51
52
53
54 public void testFacesExceptionThrowable() {
55 Throwable t = new Throwable();
56 FacesException fe = new FacesException(t);
57 assertEquals(t, fe.getCause());
58 }
59
60
61
62
63 public void testFacesExceptionString() {
64 String m = "Message";
65 FacesException e = new FacesException(m);
66 assertEquals(e.getMessage(), m);
67 }
68
69
70
71
72 public void testFacesExceptionStringThrowable() {
73 String m = "Message";
74 Throwable t = new Throwable();
75 FacesException fe = new FacesException(m, t);
76 assertEquals(t, fe.getCause());
77 assertEquals(fe.getMessage(), m);
78 }
79
80
81
82
83 public void testGetCause() {
84
85 }
86
87 }