KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > inversoft > verge > mvc > view > jsp > error > test > ErrorsTeiTest


1 /*
2  * Copyright (c) 2003, Inversoft
3  *
4  * This software is distribuable under the GNU Lesser General Public License.
5  * For more information visit gnu.org.
6  */

7 package com.inversoft.verge.mvc.view.jsp.error.test;
8
9
10 import javax.servlet.jsp.tagext.TagData JavaDoc;
11 import javax.servlet.jsp.tagext.VariableInfo JavaDoc;
12
13 import junit.framework.TestCase;
14
15 import com.inversoft.verge.mvc.view.jsp.error.ErrorsTei;
16
17
18 /**
19  * <p>
20  * Tests the ErrorsTei class
21  * </p>
22  *
23  * @author Brian Pontarelli
24  * @since 2.0
25  * @version 2.0
26  */

27 public class ErrorsTeiTest extends TestCase {
28
29     /**
30      * Constructs a new <code>ErrorsTagTest</code>
31      *
32      * @param name The name of the currently executing test
33      */

34     public ErrorsTeiTest(String JavaDoc name) {
35         super(name);
36     }
37
38
39     /**
40      * Tests a complex situation
41      */

42     public void testAll() {
43         ErrorsTei tei = new ErrorsTei();
44         TagData JavaDoc data = new TagData JavaDoc(new Object JavaDoc[][]{{"var", "foo"}});
45         VariableInfo JavaDoc[] infos = tei.getVariableInfo(data);
46
47         assertEquals(1, infos.length);
48         assertEquals("foo", infos[0].getVarName());
49         assertEquals("com.inversoft.error.BasicError", infos[0].getClassName());
50         assertTrue(infos[0].getDeclare());
51         assertEquals(VariableInfo.NESTED, infos[0].getScope());
52     }
53 }
Popular Tags