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  package javax.faces.application;
20  
21  import javax.el.ValueExpression;
22  
23  import org.apache.myfaces.test.base.junit4.AbstractJsfTestCase;
24  import org.junit.Test;
25  
26  /**
27   * Tests for {@link Application}
28   * 
29   * @author Mathias Broekelmann (latest modification by $Author: struberg $)
30   * @version $Revision: 1079582 $ $Date: 2011-03-08 17:25:59 -0500 (Tue, 08 Mar 2011) $
31   */
32  public class ApplicationTest extends AbstractJsfTestCase
33  {
34      public ApplicationTest()
35      {
36      }
37  
38      private Application app;
39  
40      public void setUp() throws Exception
41      {
42          super.setUp();
43          app = new MockApplication();
44      }
45      
46      public void tearDown() throws Exception
47      {
48          app = null;
49          super.tearDown();
50      }
51  
52      /**
53       * Test method for {@link javax.faces.application.Application#addELResolver(javax.el.ELResolver)}.
54       */
55      @Test(expected=UnsupportedOperationException.class)
56      public void testAddELResolver()
57      {
58          app.addELResolver(null);
59      }
60  
61      /**
62       * Test method for {@link javax.faces.application.Application#getELResolver()}.
63       */
64      @Test(expected=UnsupportedOperationException.class)
65      public void testGetELResolver()
66      {
67          app.getELResolver();
68      }
69  
70      /**
71       * Test method for
72       * {@link javax.faces.application.Application#getResourceBundle(javax.faces.context.FacesContext, java.lang.String)}.
73       */
74      @Test(expected=UnsupportedOperationException.class)
75      public void testGetResourceBundle()
76      {
77          app.getResourceBundle(null, null);
78      }
79  
80      /**
81       * Test method for
82       * {@link javax.faces.application.Application#createComponent(javax.el.ValueExpression, javax.faces.context.FacesContext, java.lang.String)}.
83       */
84      @Test(expected=UnsupportedOperationException.class)
85      public void testCreateComponentValueExpressionFacesContextString()
86      {
87          app.createComponent((ValueExpression) null, null, null);
88      }
89  
90      /**
91       * Test method for {@link javax.faces.application.Application#getExpressionFactory()}.
92       */
93      @Test(expected=UnsupportedOperationException.class)
94      public void testGetExpressionFactory()
95      {
96          app.getExpressionFactory();
97      }
98  
99      /**
100      * Test method for {@link javax.faces.application.Application#addELContextListener(javax.el.ELContextListener)}.
101      */
102     @Test(expected=UnsupportedOperationException.class)
103     public void testAddELContextListener()
104     {
105         app.addELContextListener(null);
106     }
107 
108     /**
109      * Test method for {@link javax.faces.application.Application#removeELContextListener(javax.el.ELContextListener)}.
110      */
111     @Test(expected=UnsupportedOperationException.class)
112     public void testRemoveELContextListener()
113     {
114         app.removeELContextListener(null);
115     }
116 
117     /**
118      * Test method for {@link javax.faces.application.Application#getELContextListeners()}.
119      */
120     @Test(expected=UnsupportedOperationException.class)
121     public void testGetELContextListeners()
122     {
123         app.getELContextListeners();
124     }
125 
126     /**
127      * Test method for
128      * {@link javax.faces.application.Application#evaluateExpressionGet(javax.faces.context.FacesContext, java.lang.String, java.lang.Class)}.
129      */
130     @Test(expected=UnsupportedOperationException.class)
131     public void testEvaluateExpressionGet()
132     {
133         app.evaluateExpressionGet(null, null, null);
134     }
135 }