1 18 package org.apache.struts.taglib.html; 19 20 import java.util.ArrayList ; 21 import java.util.HashMap ; 22 import java.util.Locale ; 23 import java.util.StringTokenizer ; 24 25 import javax.servlet.jsp.PageContext ; 26 import junit.framework.Test; 27 import junit.framework.TestSuite; 28 29 import org.apache.cactus.JspTestCase; 30 import org.apache.struts.Globals; 31 import org.apache.struts.taglib.SimpleBeanForTesting; 32 33 38 public class TestCheckboxTag4 extends JspTestCase { 39 40 45 public TestCheckboxTag4(String theName) { 46 super(theName); 47 } 48 49 54 public static void main(String [] theArgs) { 55 junit.awtui.TestRunner.main(new String [] {TestCheckboxTag4.class.getName()}); 56 } 57 58 62 public static Test suite() { 63 return new TestSuite(TestCheckboxTag4.class); 65 } 66 67 private void runMyTest(String whichTest, String locale) throws Exception { 68 pageContext.setAttribute(Globals.LOCALE_KEY, new Locale (locale, locale), PageContext.SESSION_SCOPE); 69 pageContext.setAttribute(Constants.BEAN_KEY, new SimpleBeanForTesting(false), PageContext.REQUEST_SCOPE); 70 request.setAttribute("runTest", whichTest); 71 pageContext.forward("/test/org/apache/struts/taglib/html/TestCheckboxTag4.jsp"); 72 } 73 74 77 78 public void testCheckboxPropertybooleanFalseStyle() throws Exception { 79 runMyTest("testCheckboxPropertybooleanFalseStyle", ""); 80 } 81 82 public void testCheckboxPropertybooleanFalseStyleClass() throws Exception { 83 runMyTest("testCheckboxPropertybooleanFalseStyleClass", ""); 84 } 85 86 public void testCheckboxPropertybooleanFalseStyleId() throws Exception { 87 runMyTest("testCheckboxPropertybooleanFalseStyleId", ""); 88 } 89 90 public void testCheckboxPropertybooleanFalseTabindex() throws Exception { 91 runMyTest("testCheckboxPropertybooleanFalseTabindex", ""); 92 } 93 94 public void testCheckboxPropertybooleanFalseTitle() throws Exception { 95 runMyTest("testCheckboxPropertybooleanFalseTitle", ""); 96 } 97 98 public void testCheckboxPropertybooleanFalseTitleKey() throws Exception { 99 runMyTest("testCheckboxPropertybooleanFalseTitleKey", ""); 100 } 101 102 public void testCheckboxPropertybooleanFalseTitleKey_fr() throws Exception { 103 runMyTest("testCheckboxPropertybooleanFalseTitleKey_fr", "fr"); 104 } 105 106 public void testCheckboxPropertybooleanFalseValue() throws Exception { 107 runMyTest("testCheckboxPropertybooleanFalseValue", ""); 108 } 109 110 public void testCheckboxPropertybooleanFalseBodyContent() throws Exception { 111 runMyTest("testCheckboxPropertybooleanFalseBodyContent", ""); 112 } 113 114 public void testCheckboxPropertybooleanFalseBodyContentMessageKey() throws Exception { 115 runMyTest("testCheckboxPropertybooleanFalseBodyContentMessageKey", ""); 116 } 117 118 public void testCheckboxPropertybooleanFalseBodyContentMessageKey_fr() throws Exception { 119 runMyTest("testCheckboxPropertybooleanFalseBodyContentMessageKey_fr", "fr"); 120 } 121 122 public void testCheckboxPropertybooleanFalseIndexedArray() throws Exception { 123 ArrayList lst = new ArrayList (); 124 lst.add("Test Message"); 125 pageContext.setAttribute("lst", lst, PageContext.REQUEST_SCOPE); 126 runMyTest("testCheckboxPropertybooleanFalseIndexedArray", ""); 127 } 128 129 public void testCheckboxPropertybooleanFalseIndexedArrayProperty() throws Exception { 130 SimpleBeanForTesting sbft = new SimpleBeanForTesting(); 131 ArrayList lst = new ArrayList (); 132 lst.add("Test Message"); 133 sbft.setList(lst); 134 pageContext.setAttribute("lst", sbft, PageContext.REQUEST_SCOPE); 135 runMyTest("testCheckboxPropertybooleanFalseIndexedArrayProperty", ""); 136 } 137 138 public void testCheckboxPropertybooleanFalseIndexedMap() throws Exception { 139 HashMap map = new HashMap (); 140 map.put("tst1", "Test Message"); 141 pageContext.setAttribute("lst", map, PageContext.REQUEST_SCOPE); 142 runMyTest("testCheckboxPropertybooleanFalseIndexedMap", ""); 143 } 144 145 public void testCheckboxPropertybooleanFalseIndexedMapProperty() throws Exception { 146 SimpleBeanForTesting sbft = new SimpleBeanForTesting(); 147 HashMap map = new HashMap (); 148 map.put("tst1", "Test Message"); 149 sbft.setMap(map); 150 pageContext.setAttribute("lst", sbft, PageContext.REQUEST_SCOPE); 151 runMyTest("testCheckboxPropertybooleanFalseIndexedMapProperty", ""); 152 } 153 154 public void testCheckboxPropertybooleanFalseIndexedEnumeration() throws Exception { 155 StringTokenizer st = new StringTokenizer ("Test Message"); 156 pageContext.setAttribute("lst", st, PageContext.REQUEST_SCOPE); 157 runMyTest("testCheckboxPropertybooleanFalseIndexedEnumeration", ""); 158 } 159 160 public void testCheckboxPropertybooleanFalseIndexedEnumerationProperty() throws Exception { 161 SimpleBeanForTesting sbft = new SimpleBeanForTesting(); 162 StringTokenizer st = new StringTokenizer ("Test Message"); 163 sbft.setEnumeration(st); 164 pageContext.setAttribute("lst", sbft, PageContext.REQUEST_SCOPE); 165 runMyTest("testCheckboxPropertybooleanFalseIndexedEnumerationProperty", ""); 166 } 167 168 169 170 } 171 | Popular Tags |