1 18 package org.apache.struts.taglib.html; 19 20 import java.util.HashMap ; 21 import java.util.Locale ; 22 23 import javax.servlet.jsp.PageContext ; 24 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 37 public class TestFrameTag3 extends JspTestCase { 38 39 44 public TestFrameTag3(String theName) { 45 super(theName); 46 } 47 48 53 public static void main(String [] theArgs) { 54 junit.awtui.TestRunner.main(new String [] {TestFrameTag3.class.getName()}); 55 } 56 57 61 public static Test suite() { 62 return new TestSuite(TestFrameTag3.class); 64 } 65 66 private void runMyTest(String whichTest, String locale) throws Exception { 67 pageContext.setAttribute(Globals.LOCALE_KEY, new Locale (locale, locale), PageContext.SESSION_SCOPE); 68 request.setAttribute("runTest", whichTest); 69 pageContext.forward("/test/org/apache/struts/taglib/html/TestFrameTag3.jsp"); 70 } 71 72 75 76 78 public void testFrameAction() throws Exception { 79 runMyTest("testFrameAction", ""); 80 } 81 82 public void testFrameActionAnchor() throws Exception { 83 runMyTest("testFrameActionAnchor", ""); 84 } 85 86 public void testFrameActionFrameborder() throws Exception { 87 runMyTest("testFrameActionFrameborder", ""); 88 } 89 90 public void testFrameActionFrameName() throws Exception { 91 runMyTest("testFrameActionFrameName", ""); 92 } 93 94 public void testFrameActionLongdesc() throws Exception { 95 runMyTest("testFrameActionLongdesc", ""); 96 } 97 98 public void testFrameActionMarginheight() throws Exception { 99 runMyTest("testFrameActionMarginheight", ""); 100 } 101 102 public void testFrameActionMarginwidth() throws Exception { 103 runMyTest("testFrameActionMarginwidth", ""); 104 } 105 106 public void testFrameActionNameNoScope() throws Exception { 107 HashMap map = new HashMap (); 108 map.put("param1","value1"); 109 map.put("param2","value2"); 110 map.put("param3","value3"); 111 map.put("param4","value4"); 112 pageContext.setAttribute("paramMap", map, PageContext.REQUEST_SCOPE); 113 runMyTest("testFrameActionNameNoScope", ""); 114 } 115 116 public void testFrameActionNamePropertyNoScope() throws Exception { 117 HashMap map = new HashMap (); 118 map.put("param1","value1"); 119 map.put("param2","value2"); 120 map.put("param3","value3"); 121 map.put("param4","value4"); 122 SimpleBeanForTesting sbft = new SimpleBeanForTesting(map); 123 pageContext.setAttribute("paramPropertyMap", sbft, PageContext.REQUEST_SCOPE); 124 runMyTest("testFrameActionNamePropertyNoScope", ""); 125 } 126 127 public void testFrameActionNameApplicationScope() throws Exception { 128 HashMap map = new HashMap (); 129 map.put("param1","value1"); 130 map.put("param2","value2"); 131 map.put("param3","value3"); 132 map.put("param4","value4"); 133 pageContext.setAttribute("paramMap", map, PageContext.APPLICATION_SCOPE); 134 runMyTest("testFrameActionNameApplicationScope", ""); 135 } 136 137 public void testFrameActionNamePropertyApplicationScope() throws Exception { 138 HashMap map = new HashMap (); 139 map.put("param1","value1"); 140 map.put("param2","value2"); 141 map.put("param3","value3"); 142 map.put("param4","value4"); 143 SimpleBeanForTesting sbft = new SimpleBeanForTesting(map); 144 pageContext.setAttribute("paramPropertyMap", sbft, PageContext.APPLICATION_SCOPE); 145 runMyTest("testFrameActionNamePropertyApplicationScope", ""); 146 } 147 148 public void testFrameActionNameSessionScope() throws Exception { 149 HashMap map = new HashMap (); 150 map.put("param1","value1"); 151 map.put("param2","value2"); 152 map.put("param3","value3"); 153 map.put("param4","value4"); 154 pageContext.setAttribute("paramMap", map, PageContext.SESSION_SCOPE); 155 runMyTest("testFrameActionNameSessionScope", ""); 156 } 157 158 public void testFrameActionNamePropertySessionScope() throws Exception { 159 HashMap map = new HashMap (); 160 map.put("param1","value1"); 161 map.put("param2","value2"); 162 map.put("param3","value3"); 163 map.put("param4","value4"); 164 SimpleBeanForTesting sbft = new SimpleBeanForTesting(map); 165 pageContext.setAttribute("paramPropertyMap", sbft, PageContext.SESSION_SCOPE); 166 runMyTest("testFrameActionNamePropertySessionScope", ""); 167 } 168 169 public void testFrameActionNameRequestScope() throws Exception { 170 HashMap map = new HashMap (); 171 map.put("param1","value1"); 172 map.put("param2","value2"); 173 map.put("param3","value3"); 174 map.put("param4","value4"); 175 pageContext.setAttribute("paramMap", map, PageContext.REQUEST_SCOPE); 176 runMyTest("testFrameActionNameRequestScope", ""); 177 } 178 179 public void testFrameActionNamePropertyRequestScope() throws Exception { 180 HashMap map = new HashMap (); 181 map.put("param1","value1"); 182 map.put("param2","value2"); 183 map.put("param3","value3"); 184 map.put("param4","value4"); 185 SimpleBeanForTesting sbft = new SimpleBeanForTesting(map); 186 pageContext.setAttribute("paramPropertyMap", sbft, PageContext.REQUEST_SCOPE); 187 runMyTest("testFrameActionNamePropertyRequestScope", ""); 188 } 189 190 191 public void testFrameActionNoresize1() throws Exception { 192 runMyTest("testFrameActionNoresize1", ""); 193 } 194 195 public void testFrameActionNoresize2() throws Exception { 196 runMyTest("testFrameActionNoresize2", ""); 197 } 198 199 public void testFrameActionNoresize3() throws Exception { 200 runMyTest("testFrameActionNoresize3", ""); 201 } 202 203 public void testFrameActionNoresize4() throws Exception { 204 runMyTest("testFrameActionNoresize4", ""); 205 } 206 207 public void testFrameActionNoresize5() throws Exception { 208 runMyTest("testFrameActionNoresize5", ""); 209 } 210 211 public void testFrameActionNoresize6() throws Exception { 212 runMyTest("testFrameActionNoresize6", ""); 213 } 214 215 } 216 | Popular Tags |