1 18 package org.apache.struts.taglib.html; 19 20 import java.util.HashMap ; 21 import java.util.Locale ; 22 23 24 import javax.servlet.jsp.PageContext ; 25 import junit.framework.Test; 26 import junit.framework.TestSuite; 27 28 import org.apache.cactus.JspTestCase; 29 import org.apache.struts.Globals; 30 import org.apache.struts.taglib.SimpleBeanForTesting; 31 32 33 38 public class TestFrameTag1 extends JspTestCase { 39 40 45 public TestFrameTag1(String theName) { 46 super(theName); 47 } 48 49 54 public static void main(String [] theArgs) { 55 junit.awtui.TestRunner.main(new String [] {TestFrameTag1.class.getName()}); 56 } 57 58 62 public static Test suite() { 63 return new TestSuite(TestFrameTag1.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 request.setAttribute("runTest", whichTest); 70 pageContext.forward("/test/org/apache/struts/taglib/html/TestFrameTag1.jsp"); 71 } 72 73 76 77 79 public void testFrameForward() throws Exception { 80 runMyTest("testFrameForward", ""); 81 } 82 83 public void testFrameForwardAnchor() throws Exception { 84 runMyTest("testFrameForwardAnchor", ""); 85 } 86 87 public void testFrameForwardFrameborder() throws Exception { 88 runMyTest("testFrameForwardFrameborder", ""); 89 } 90 91 public void testFrameForwardFrameName() throws Exception { 92 runMyTest("testFrameForwardFrameName", ""); 93 } 94 95 public void testFrameForwardLongdesc() throws Exception { 96 runMyTest("testFrameForwardLongdesc", ""); 97 } 98 99 public void testFrameForwardMarginheight() throws Exception { 100 runMyTest("testFrameForwardMarginheight", ""); 101 } 102 103 public void testFrameForwardMarginwidth() throws Exception { 104 runMyTest("testFrameForwardMarginwidth", ""); 105 } 106 107 public void testFrameForwardNameNoScope() throws Exception { 108 HashMap map = new HashMap (); 109 map.put("param1","value1"); 110 map.put("param2","value2"); 111 map.put("param3","value3"); 112 map.put("param4","value4"); 113 pageContext.setAttribute("paramMap", map, PageContext.REQUEST_SCOPE); 114 runMyTest("testFrameForwardNameNoScope", ""); 115 } 116 117 public void testFrameForwardNamePropertyNoScope() throws Exception { 118 HashMap map = new HashMap (); 119 map.put("param1","value1"); 120 map.put("param2","value2"); 121 map.put("param3","value3"); 122 map.put("param4","value4"); 123 SimpleBeanForTesting sbft = new SimpleBeanForTesting(map); 124 pageContext.setAttribute("paramPropertyMap", sbft, PageContext.REQUEST_SCOPE); 125 runMyTest("testFrameForwardNamePropertyNoScope", ""); 126 } 127 128 public void testFrameForwardNameApplicationScope() throws Exception { 129 HashMap map = new HashMap (); 130 map.put("param1","value1"); 131 map.put("param2","value2"); 132 map.put("param3","value3"); 133 map.put("param4","value4"); 134 pageContext.setAttribute("paramMap", map, PageContext.APPLICATION_SCOPE); 135 runMyTest("testFrameForwardNameApplicationScope", ""); 136 } 137 138 public void testFrameForwardNamePropertyApplicationScope() throws Exception { 139 HashMap map = new HashMap (); 140 map.put("param1","value1"); 141 map.put("param2","value2"); 142 map.put("param3","value3"); 143 map.put("param4","value4"); 144 SimpleBeanForTesting sbft = new SimpleBeanForTesting(map); 145 pageContext.setAttribute("paramPropertyMap", sbft, PageContext.APPLICATION_SCOPE); 146 runMyTest("testFrameForwardNamePropertyApplicationScope", ""); 147 } 148 149 public void testFrameForwardNameSessionScope() throws Exception { 150 HashMap map = new HashMap (); 151 map.put("param1","value1"); 152 map.put("param2","value2"); 153 map.put("param3","value3"); 154 map.put("param4","value4"); 155 pageContext.setAttribute("paramMap", map, PageContext.SESSION_SCOPE); 156 runMyTest("testFrameForwardNameSessionScope", ""); 157 } 158 159 public void testFrameForwardNamePropertySessionScope() throws Exception { 160 HashMap map = new HashMap (); 161 map.put("param1","value1"); 162 map.put("param2","value2"); 163 map.put("param3","value3"); 164 map.put("param4","value4"); 165 SimpleBeanForTesting sbft = new SimpleBeanForTesting(map); 166 pageContext.setAttribute("paramPropertyMap", sbft, PageContext.SESSION_SCOPE); 167 runMyTest("testFrameForwardNamePropertySessionScope", ""); 168 } 169 170 public void testFrameForwardNameRequestScope() throws Exception { 171 HashMap map = new HashMap (); 172 map.put("param1","value1"); 173 map.put("param2","value2"); 174 map.put("param3","value3"); 175 map.put("param4","value4"); 176 pageContext.setAttribute("paramMap", map, PageContext.REQUEST_SCOPE); 177 runMyTest("testFrameForwardNameRequestScope", ""); 178 } 179 180 public void testFrameForwardNamePropertyRequestScope() throws Exception { 181 HashMap map = new HashMap (); 182 map.put("param1","value1"); 183 map.put("param2","value2"); 184 map.put("param3","value3"); 185 map.put("param4","value4"); 186 SimpleBeanForTesting sbft = new SimpleBeanForTesting(map); 187 pageContext.setAttribute("paramPropertyMap", sbft, PageContext.REQUEST_SCOPE); 188 runMyTest("testFrameForwardNamePropertyRequestScope", ""); 189 } 190 191 192 public void testFrameForwardNoresize1() throws Exception { 193 runMyTest("testFrameForwardNoresize1", ""); 194 } 195 196 public void testFrameForwardNoresize2() throws Exception { 197 runMyTest("testFrameForwardNoresize2", ""); 198 } 199 200 public void testFrameForwardNoresize3() throws Exception { 201 runMyTest("testFrameForwardNoresize3", ""); 202 } 203 204 public void testFrameForwardNoresize4() throws Exception { 205 runMyTest("testFrameForwardNoresize4", ""); 206 } 207 208 public void testFrameForwardNoresize5() throws Exception { 209 runMyTest("testFrameForwardNoresize5", ""); 210 } 211 212 public void testFrameForwardNoresize6() throws Exception { 213 runMyTest("testFrameForwardNoresize6", ""); 214 } 215 216 } 217 | Popular Tags |