1 7 package com.inversoft.verge.mvc.view.jsp.html.test; 8 9 10 import javax.servlet.jsp.tagext.TagData ; 11 12 import junit.framework.TestCase; 13 14 import com.inversoft.verge.mvc.view.jsp.html.FormTei; 15 16 17 26 public class FormTeiTest extends TestCase { 27 28 33 public FormTeiTest(String name) { 34 super(name); 35 } 36 37 38 public void testIsValid() { 39 FormTei tei = new FormTei(); 40 Object [][] params = {{"method", "post"}}; 41 TagData data = new TagData (params); 42 assertTrue("Should be valid", tei.isValid(data)); 43 44 params = new Object [][]{{"method", "get"}}; 45 data = new TagData (params); 46 assertTrue("Should be valid", tei.isValid(data)); 47 48 params = new Object [][]{{"method", "PoSt"}}; 49 data = new TagData (params); 50 assertTrue("Should be valid", tei.isValid(data)); 51 52 params = new Object [][]{{"method", "gEt"}}; 53 data = new TagData (params); 54 assertTrue("Should be valid", tei.isValid(data)); 55 56 params = new Object [][]{{"method", "bob"}}; 57 data = new TagData (params); 58 assertFalse("Should NOT be valid", tei.isValid(data)); 59 60 params = null; 62 data = new TagData (params); 63 assertTrue("Should be valid", tei.isValid(data)); 64 } 65 } | Popular Tags |