KickJava   Java API By Example, From Geeks To Geeks.

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


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.HasErrorsTei;
16
17
18 /**
19  * <p>
20  * This class tests the HasErrorsTei.
21  * </p>
22  *
23  * @author Brian Pontarelli
24  * @since 2.0
25  * @version 2.0
26  */

27 public class HasErrorsTeiTest extends TestCase {
28
29     /**
30      * Constructs a new <code>HasErrorsTagTest</code>
31      *
32      * @param name The name of the test case being run
33      */

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

42     public void testAll() {
43         HasErrorsTei tei = new HasErrorsTei();
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("java.lang.Object", infos[0].getClassName());
50         assertTrue(infos[0].getDeclare());
51         assertEquals(VariableInfo.AT_BEGIN, infos[0].getScope());
52     }
53 }
Popular Tags