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 TestImageTag2 extends JspTestCase { 39 40 45 public TestImageTag2(String theName) { 46 super(theName); 47 } 48 49 54 public static void main(String [] theArgs) { 55 junit.awtui.TestRunner.main(new String [] {TestImageTag2.class.getName()}); 56 } 57 58 62 public static Test suite() { 63 return new TestSuite(TestImageTag2.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("Test Value"), PageContext.REQUEST_SCOPE); 70 request.setAttribute("runTest", whichTest); 71 pageContext.forward("/test/org/apache/struts/taglib/html/TestImageTag2.jsp"); 72 } 73 74 77 78 80 public void testImagePageOnmousedown() throws Exception { 81 runMyTest("testImagePageOnmousedown", ""); 82 } 83 84 public void testImagePageOnmousemove() throws Exception { 85 runMyTest("testImagePageOnmousemove", ""); 86 } 87 88 public void testImagePageOnmouseout() throws Exception { 89 runMyTest("testImagePageOnmouseout", ""); 90 } 91 92 public void testImagePageOnmouseover() throws Exception { 93 runMyTest("testImagePageOnmouseover", ""); 94 } 95 96 public void testImagePageOnmouseup() throws Exception { 97 runMyTest("testImagePageOnmouseup", ""); 98 } 99 100 public void testImagePageProperty() throws Exception { 101 runMyTest("testImagePageProperty", ""); 102 } 103 104 public void testImagePageStyle() throws Exception { 105 runMyTest("testImagePageStyle", ""); 106 } 107 108 public void testImagePageStyleClass() throws Exception { 109 runMyTest("testImagePageStyleClass", ""); 110 } 111 112 public void testImagePageStyleId() throws Exception { 113 runMyTest("testImagePageStyleId", ""); 114 } 115 116 public void testImagePageTabindex() throws Exception { 117 runMyTest("testImagePageTabindex", ""); 118 } 119 120 public void testImagePageTitle() throws Exception { 121 runMyTest("testImagePageTitle", ""); 122 } 123 124 public void testImagePageTitleKeyDefaultBundle() throws Exception { 125 } 127 128 public void testImagePageTitleKeyAlternateBundle() throws Exception { 129 } 131 132 public void testImagePageTitleKeyDefaultBundle_fr() throws Exception { 133 runMyTest("testImagePageTitleKeyDefaultBundle_fr", "fr"); 134 } 135 136 public void testImagePageTitleKeyAlternateBundle_fr() throws Exception { 137 runMyTest("testImagePageTitleKeyAlternateBundle_fr", "fr"); 138 } 139 140 public void testImagePageIndexedArray() throws Exception { 141 ArrayList lst = new ArrayList (); 142 lst.add("Test Message"); 143 pageContext.setAttribute("lst", lst, PageContext.REQUEST_SCOPE); 144 runMyTest("testImagePageIndexedArray", ""); 145 } 146 147 public void testImagePageIndexedArrayProperty() throws Exception { 148 SimpleBeanForTesting sbft = new SimpleBeanForTesting(); 149 ArrayList lst = new ArrayList (); 150 lst.add("Test Message"); 151 sbft.setList(lst); 152 pageContext.setAttribute("lst", sbft, PageContext.REQUEST_SCOPE); 153 runMyTest("testImagePageIndexedArrayProperty", ""); 154 } 155 156 public void testImagePageIndexedMap() throws Exception { 157 HashMap map = new HashMap (); 158 map.put("tst1", "Test Message"); 159 pageContext.setAttribute("lst", map, PageContext.REQUEST_SCOPE); 160 runMyTest("testImagePageIndexedMap", ""); 161 } 162 163 public void testImagePageIndexedMapProperty() throws Exception { 164 SimpleBeanForTesting sbft = new SimpleBeanForTesting(); 165 HashMap map = new HashMap (); 166 map.put("tst1", "Test Message"); 167 sbft.setMap(map); 168 pageContext.setAttribute("lst", sbft, PageContext.REQUEST_SCOPE); 169 runMyTest("testImagePageIndexedMapProperty", ""); 170 } 171 172 public void testImagePageIndexedEnumeration() throws Exception { 173 StringTokenizer st = new StringTokenizer ("Test Message"); 174 pageContext.setAttribute("lst", st, PageContext.REQUEST_SCOPE); 175 runMyTest("testImagePageIndexedEnumeration", ""); 176 } 177 178 public void testImagePageIndexedEnumerationProperty() throws Exception { 179 SimpleBeanForTesting sbft = new SimpleBeanForTesting(); 180 StringTokenizer st = new StringTokenizer ("Test Message"); 181 sbft.setEnumeration(st); 182 pageContext.setAttribute("lst", sbft, PageContext.REQUEST_SCOPE); 183 runMyTest("testImagePageIndexedEnumerationProperty", ""); 184 } 185 186 187 188 189 } 190 | Popular Tags |