KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > myfaces > el > ELParserHelperTest


1 /*
2  * Copyright 2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.myfaces.el;
17
18 import junit.framework.TestCase;
19
20
21 /**
22  * @author Manfred Geiler (latest modification by $Author: svieujot $)
23  * @author Anton Koinov
24  * @version $Revision: 1.1 $ $Date: 2005/04/11 17:39:35 $
25  */

26 public class ELParserHelperTest extends TestCase
27 {
28     //~ Constructors -------------------------------------------------------------------------------
29

30     public ELParserHelperTest(String JavaDoc name)
31     {
32         super(name);
33     }
34
35     //~ Methods ------------------------------------------------------------------------------------
36

37     public void testToJspElExpression() throws Exception JavaDoc
38     {
39         assertEquals("${}", ELParserHelper.toJspElExpression("#{}"));
40         assertEquals("{}", ELParserHelper.toJspElExpression("{}"));
41         assertEquals("{aa} {bb}", ELParserHelper.toJspElExpression("{aa} {bb}"));
42         assertEquals("{aa}{bb}", ELParserHelper.toJspElExpression("{aa}{bb}"));
43         assertEquals("1${'<'}{0,number,integer}", ELParserHelper.toJspElExpression("1#{'<'}{0,number,integer}"));
44         
45         assertEquals(
46                                                  "{0,choice,0#${scrollerNoItem_}|1#${scrollerOneItem_}|1${'<'}{0,number,integer} ${scrollerItems_}} ${dataScrollerMsg.found_displaying} {1} to {2}. ${dataScrollerMsg.Page} {3} / {4}",
47                 ELParserHelper.toJspElExpression("{0,choice,0##{scrollerNoItem_}|1##{scrollerOneItem_}|1#{'<'}{0,number,integer} #{scrollerItems_}} #{dataScrollerMsg.found_displaying} {1} to {2}. #{dataScrollerMsg.Page} {3} / {4}"));
48     }
49     
50 }
Popular Tags