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 27 import junit.framework.Test; 28 import junit.framework.TestSuite; 29 30 import org.apache.cactus.JspTestCase; 31 import org.apache.struts.Globals; 32 import org.apache.struts.taglib.SimpleBeanForTesting; 33 34 39 public class TestImageTag4 extends JspTestCase { 40 41 46 public TestImageTag4(String theName) { 47 super(theName); 48 } 49 50 55 public static void main(String [] theArgs) { 56 junit.awtui.TestRunner.main(new String [] {TestImageTag4.class.getName()}); 57 } 58 59 63 public static Test suite() { 64 return new TestSuite(TestImageTag4.class); 66 } 67 68 private void runMyTest(String whichTest, String locale) throws Exception { 69 pageContext.setAttribute(Globals.LOCALE_KEY, new Locale (locale, locale), PageContext.SESSION_SCOPE); 70 pageContext.setAttribute(Constants.BEAN_KEY, new SimpleBeanForTesting("Test Value"), PageContext.REQUEST_SCOPE); 71 request.setAttribute("runTest", whichTest); 72 pageContext.forward("/test/org/apache/struts/taglib/html/TestImageTag4.jsp"); 73 } 74 75 78 79 81 public void testImagePageKeyOnmousedown() throws Exception { 82 runMyTest("testImagePageKeyOnmousedown", ""); 83 } 84 85 public void testImagePageKeyOnmousemove() throws Exception { 86 runMyTest("testImagePageKeyOnmousemove", ""); 87 } 88 89 public void testImagePageKeyOnmouseout() throws Exception { 90 runMyTest("testImagePageKeyOnmouseout", ""); 91 } 92 93 public void testImagePageKeyOnmouseover() throws Exception { 94 runMyTest("testImagePageKeyOnmouseover", ""); 95 } 96 97 public void testImagePageKeyOnmouseup() throws Exception { 98 runMyTest("testImagePageKeyOnmouseup", ""); 99 } 100 101 public void testImagePageKeyProperty() throws Exception { 102 runMyTest("testImagePageKeyProperty", ""); 103 } 104 105 public void testImagePageKeyStyle() throws Exception { 106 runMyTest("testImagePageKeyStyle", ""); 107 } 108 109 public void testImagePageKeyStyleClass() throws Exception { 110 runMyTest("testImagePageKeyStyleClass", ""); 111 } 112 113 public void testImagePageKeyStyleId() throws Exception { 114 runMyTest("testImagePageKeyStyleId", ""); 115 } 116 117 public void testImagePageKeyTabindex() throws Exception { 118 runMyTest("testImagePageKeyTabindex", ""); 119 } 120 121 public void testImagePageKeyTitle() throws Exception { 122 runMyTest("testImagePageKeyTitle", ""); 123 } 124 125 public void testImagePageKeyTitleKeyDefaultBundle() throws Exception { 126 runMyTest("testImagePageKeyTitleKeyDefaultBundle", ""); 127 } 128 129 public void testImagePageKeyTitleKeyAlternateBundle() throws Exception { 130 runMyTest("testImagePageKeyTitleKeyAlternateBundle", ""); 131 } 132 133 public void testImagePageKeyTitleKeyDefaultBundle_fr() throws Exception { 134 runMyTest("testImagePageKeyTitleKeyDefaultBundle_fr", "fr"); 135 } 136 137 public void testImagePageKeyTitleKeyAlternateBundle_fr() throws Exception { 138 runMyTest("testImagePageKeyTitleKeyAlternateBundle_fr", "fr"); 139 } 140 141 public void testImagePageKeyIndexedArray() throws Exception { 142 ArrayList lst = new ArrayList (); 143 lst.add("Test Message"); 144 pageContext.setAttribute("lst", lst, PageContext.REQUEST_SCOPE); 145 runMyTest("testImagePageKeyIndexedArray", ""); 146 } 147 148 public void testImagePageKeyIndexedArrayProperty() throws Exception { 149 SimpleBeanForTesting sbft = new SimpleBeanForTesting(); 150 ArrayList lst = new ArrayList (); 151 lst.add("Test Message"); 152 sbft.setList(lst); 153 pageContext.setAttribute("lst", sbft, PageContext.REQUEST_SCOPE); 154 runMyTest("testImagePageKeyIndexedArrayProperty", ""); 155 } 156 157 public void testImagePageKeyIndexedMap() throws Exception { 158 HashMap map = new HashMap (); 159 map.put("tst1", "Test Message"); 160 pageContext.setAttribute("lst", map, PageContext.REQUEST_SCOPE); 161 runMyTest("testImagePageKeyIndexedMap", ""); 162 } 163 164 public void testImagePageKeyIndexedMapProperty() throws Exception { 165 SimpleBeanForTesting sbft = new SimpleBeanForTesting(); 166 HashMap map = new HashMap (); 167 map.put("tst1", "Test Message"); 168 sbft.setMap(map); 169 pageContext.setAttribute("lst", sbft, PageContext.REQUEST_SCOPE); 170 runMyTest("testImagePageKeyIndexedMapProperty", ""); 171 } 172 173 public void testImagePageKeyIndexedEnumeration() throws Exception { 174 StringTokenizer st = new StringTokenizer ("Test Message"); 175 pageContext.setAttribute("lst", st, PageContext.REQUEST_SCOPE); 176 runMyTest("testImagePageKeyIndexedEnumeration", ""); 177 } 178 179 public void testImagePageKeyIndexedEnumerationProperty() throws Exception { 180 SimpleBeanForTesting sbft = new SimpleBeanForTesting(); 181 StringTokenizer st = new StringTokenizer ("Test Message"); 182 sbft.setEnumeration(st); 183 pageContext.setAttribute("lst", sbft, PageContext.REQUEST_SCOPE); 184 runMyTest("testImagePageKeyIndexedEnumerationProperty", ""); 185 } 186 187 188 189 190 191 } 192 | Popular Tags |