1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
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 * Test method for 'javax.faces.FacesException.FacesException()'
44 */
45 public void testFacesException() {
46 FacesException e = new FacesException();
47 assertNull(e.getCause());
48 assertNull(e.getMessage());
49 }
50
51 /*
52 * Test method for 'javax.faces.FacesException.FacesException(Throwable)'
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 * Test method for 'javax.faces.FacesException.FacesException(String)'
62 */
63 public void testFacesExceptionString() {
64 String m = "Message";
65 FacesException e = new FacesException(m);
66 assertEquals(e.getMessage(), m);
67 }
68
69 /*
70 * Test method for 'javax.faces.FacesException.FacesException(String, Throwable)'
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 * Test method for 'javax.faces.FacesException.getCause()'
82 */
83 public void testGetCause() {
84
85 }
86
87 }