KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > inversoft > verge > mvc > view > jsp > html > test > FormTeiTest


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.html.test;
8
9
10 import javax.servlet.jsp.tagext.TagData JavaDoc;
11
12 import junit.framework.TestCase;
13
14 import com.inversoft.verge.mvc.view.jsp.html.FormTei;
15
16
17 /**
18  * <p>
19  * This class tests the FormTei
20  * </p>
21  *
22  * @author Brian Pontarelli
23  * @since 2.0
24  * @version 2.0
25  */

26 public class FormTeiTest extends TestCase {
27
28     /**
29      * Constructor for FormTeiTest.
30      *
31      * @param name
32      */

33     public FormTeiTest(String JavaDoc name) {
34         super(name);
35     }
36
37
38     public void testIsValid() {
39         FormTei tei = new FormTei();
40         Object JavaDoc [][] params = {{"method", "post"}};
41         TagData JavaDoc data = new TagData JavaDoc(params);
42         assertTrue("Should be valid", tei.isValid(data));
43
44         params = new Object JavaDoc[][]{{"method", "get"}};
45         data = new TagData JavaDoc(params);
46         assertTrue("Should be valid", tei.isValid(data));
47
48         params = new Object JavaDoc[][]{{"method", "PoSt"}};
49         data = new TagData JavaDoc(params);
50         assertTrue("Should be valid", tei.isValid(data));
51
52         params = new Object JavaDoc[][]{{"method", "gEt"}};
53         data = new TagData JavaDoc(params);
54         assertTrue("Should be valid", tei.isValid(data));
55
56         params = new Object JavaDoc[][]{{"method", "bob"}};
57         data = new TagData JavaDoc(params);
58         assertFalse("Should NOT be valid", tei.isValid(data));
59
60         // Test empty method
61
params = null;
62         data = new TagData JavaDoc(params);
63         assertTrue("Should be valid", tei.isValid(data));
64     }
65 }
Popular Tags