View Javadoc

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  	}
49  
50  	/*
51  	 * Test method for 'javax.faces.FacesException.FacesException(Throwable)'
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  	 * Test method for 'javax.faces.FacesException.FacesException(String)'
61  	 */
62  	public void testFacesExceptionString() {
63  		String m = "Message";
64  		FacesException e = new FacesException(m);
65  		assertEquals(e.getMessage(), m);
66  	}
67  
68  	/*
69  	 * Test method for 'javax.faces.FacesException.FacesException(String, Throwable)'
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  	 * Test method for 'javax.faces.FacesException.getCause()'
81  	 */
82  	public void testGetCause() {
83  
84  	}
85  
86  }