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 }
49
50
51
52
53 public void testFacesExceptionThrowable() {
54 Throwable t = new Throwable();
55 FacesException fe = new FacesException(t);
56 assertEquals(t, fe.getCause());
57 }
58
59
60
61
62 public void testFacesExceptionString() {
63 String m = "Message";
64 FacesException e = new FacesException(m);
65 assertEquals(e.getMessage(), m);
66 }
67
68
69
70
71 public void testFacesExceptionStringThrowable() {
72 String m = "Message";
73 Throwable t = new Throwable();
74 FacesException fe = new FacesException(m, t);
75 assertEquals(t, fe.getCause());
76 assertEquals(fe.getMessage(), m);
77 }
78
79
80
81
82 public void testGetCause() {
83
84 }
85
86 }