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 static org.apache.myfaces.Assert.assertException; 22 import net.sf.cglib.proxy.Enhancer; 23 import net.sf.cglib.proxy.NoOp; 24 25 import org.apache.myfaces.TestRunner; 26 27 import javax.el.ValueExpression; 28 29 import junit.framework.TestCase; 30 31 /** 32 * Tests for {@link Application} 33 * 34 * @author Mathias Broekelmann (latest modification by $Author: lu4242 $) 35 * @version $Revision: 775008 $ $Date: 2009-05-15 00:23:20 -0500 (Fri, 15 May 2009) $ 36 */ 37 public class ApplicationTest extends TestCase 38 { 39 private Application app; 40 41 protected void setUp() throws Exception 42 { 43 app = (Application) Enhancer.create(Application.class, NoOp.INSTANCE); 44 } 45 46 /** 47 * Test method for {@link javax.faces.application.Application#addELResolver(javax.el.ELResolver)}. 48 */ 49 /* 50 public void testAddELResolver() 51 { 52 assertException(UnsupportedOperationException.class, new TestRunner() 53 { 54 public void run() 55 { 56 app.addELResolver(null); 57 } 58 }); 59 }*/ 60 61 /** 62 * Test method for {@link javax.faces.application.Application#getELResolver()}. 63 */ 64 /* 65 public void testGetELResolver() 66 { 67 assertException(UnsupportedOperationException.class, new TestRunner() 68 { 69 public void run() 70 { 71 app.getELResolver(); 72 } 73 }); 74 }*/ 75 76 /** 77 * Test method for 78 * {@link javax.faces.application.Application#getResourceBundle(javax.faces.context.FacesContext, java.lang.String)}. 79 */ 80 /* 81 public void testGetResourceBundle() 82 { 83 assertException(UnsupportedOperationException.class, new TestRunner() 84 { 85 public void run() 86 { 87 app.getResourceBundle(null, null); 88 } 89 }); 90 }*/ 91 92 /** 93 * Test method for 94 * {@link javax.faces.application.Application#createComponent(javax.el.ValueExpression, javax.faces.context.FacesContext, java.lang.String)}. 95 */ 96 /* 97 public void testCreateComponentValueExpressionFacesContextString() 98 { 99 assertException(UnsupportedOperationException.class, new TestRunner() 100 { 101 public void run() 102 { 103 app.createComponent((ValueExpression) null, null, null); 104 } 105 }); 106 }*/ 107 108 /** 109 * Test method for {@link javax.faces.application.Application#getExpressionFactory()}. 110 */ 111 /* 112 public void testGetExpressionFactory() 113 { 114 assertException(UnsupportedOperationException.class, new TestRunner() 115 { 116 public void run() 117 { 118 app.getExpressionFactory(); 119 } 120 }); 121 }*/ 122 123 /** 124 * Test method for {@link javax.faces.application.Application#addELContextListener(javax.el.ELContextListener)}. 125 */ 126 /* 127 public void testAddELContextListener() 128 { 129 assertException(UnsupportedOperationException.class, new TestRunner() 130 { 131 public void run() 132 { 133 app.addELContextListener(null); 134 } 135 }); 136 }*/ 137 138 /** 139 * Test method for {@link javax.faces.application.Application#removeELContextListener(javax.el.ELContextListener)}. 140 */ 141 /* 142 public void testRemoveELContextListener() 143 { 144 assertException(UnsupportedOperationException.class, new TestRunner() 145 { 146 public void run() 147 { 148 app.removeELContextListener(null); 149 } 150 }); 151 }*/ 152 153 /** 154 * Test method for {@link javax.faces.application.Application#getELContextListeners()}. 155 */ 156 /* 157 public void testGetELContextListeners() 158 { 159 assertException(UnsupportedOperationException.class, new TestRunner() 160 { 161 public void run() 162 { 163 app.getELContextListeners(); 164 } 165 }); 166 }*/ 167 168 /** 169 * Test method for 170 * {@link javax.faces.application.Application#evaluateExpressionGet(javax.faces.context.FacesContext, java.lang.String, java.lang.Class)}. 171 */ 172 /* 173 public void testEvaluateExpressionGet() 174 { 175 assertException(UnsupportedOperationException.class, new TestRunner() 176 { 177 public void run() 178 { 179 app.evaluateExpressionGet(null, null, null); 180 } 181 }); 182 }*/ 183 }