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 org.junit.After;
23  import org.junit.Assert;
24  import org.junit.Before;
25  import org.junit.Test;
26  
27  public class FacesExceptionTest
28  {
29  
30      public FacesExceptionTest()
31      {
32      }
33  
34      @Before
35      public void setUp() throws Exception
36      {
37      }
38  
39      @After
40      public void tearDown() throws Exception
41      {
42      }
43  
44      /*
45       * Test method for 'javax.faces.FacesException.FacesException()'
46       */
47      @Test
48      public void testFacesException()
49      {
50          FacesException e = new FacesException();
51          Assert.assertNull(e.getCause());
52          Assert.assertNull(e.getMessage());
53      }
54  
55      /*
56       * Test method for 'javax.faces.FacesException.FacesException(Throwable)'
57       */
58      @Test
59      public void testFacesExceptionThrowable()
60      {
61          Throwable t = new Throwable();
62          FacesException fe = new FacesException(t);
63          Assert.assertEquals(t, fe.getCause());
64      }
65  
66      /*
67       * Test method for 'javax.faces.FacesException.FacesException(String)'
68       */
69      @Test
70      public void testFacesExceptionString()
71      {
72          String m = "Message";
73          FacesException e = new FacesException(m);
74          Assert.assertEquals(e.getMessage(), m);
75      }
76  
77      /*
78       * Test method for 'javax.faces.FacesException.FacesException(String, Throwable)'
79       */
80      @Test
81      public void testFacesExceptionStringThrowable()
82      {
83          String m = "Message";
84          Throwable t = new Throwable();
85          FacesException fe = new FacesException(m, t);
86          Assert.assertEquals(t, fe.getCause());
87          Assert.assertEquals(fe.getMessage(), m);
88      }
89  
90      /*
91       * Test method for 'javax.faces.FacesException.getCause()'
92       */
93      @Test
94      public void testGetCause()
95      {
96  
97      }
98  
99  }