1 18 package org.apache.struts.taglib.html; 19 20 import java.util.Locale ; 21 22 import javax.servlet.jsp.PageContext ; 23 24 import junit.framework.Test; 25 import junit.framework.TestSuite; 26 27 import org.apache.cactus.JspTestCase; 28 import org.apache.struts.Globals; 29 import org.apache.struts.taglib.SimpleBeanForTesting; 30 31 36 public class TestLinkTag6 extends JspTestCase { 37 38 43 public TestLinkTag6(String theName) { 44 super(theName); 45 } 46 47 52 public static void main(String [] theArgs) { 53 junit.awtui.TestRunner.main(new String [] {TestLinkTag6.class.getName()}); 54 } 55 56 60 public static Test suite() { 61 return new TestSuite(TestLinkTag6.class); 63 } 64 65 private void runMyTest(String whichTest, String locale) throws Exception { 66 pageContext.setAttribute(Globals.LOCALE_KEY, new Locale (locale, locale), PageContext.SESSION_SCOPE); 67 pageContext.setAttribute(Constants.BEAN_KEY, new SimpleBeanForTesting("Test Value"), PageContext.REQUEST_SCOPE); 68 request.setAttribute("runTest", whichTest); 69 pageContext.forward("/test/org/apache/struts/taglib/html/TestLinkTag6.jsp"); 70 } 71 72 75 76 public void testLinkHrefOnblur() throws Exception { 78 runMyTest("testLinkHrefOnblur", ""); 79 } 80 81 public void testLinkHrefOnclick() throws Exception { 82 runMyTest("testLinkHrefOnclick", ""); 83 } 84 85 public void testLinkHrefOndblclick() throws Exception { 86 runMyTest("testLinkHrefOndblclick", ""); 87 } 88 89 public void testLinkHrefOnfocus() throws Exception { 90 runMyTest("testLinkHrefOnfocus", ""); 91 } 92 93 public void testLinkHrefOnkeydown() throws Exception { 94 runMyTest("testLinkHrefOnkeydown", ""); 95 } 96 97 public void testLinkHrefOnkeypress() throws Exception { 98 runMyTest("testLinkHrefOnkeypress", ""); 99 } 100 101 public void testLinkHrefOnkeyup() throws Exception { 102 runMyTest("testLinkHrefOnkeyup", ""); 103 } 104 105 public void testLinkHrefOnmousedown() throws Exception { 106 runMyTest("testLinkHrefOnmousedown", ""); 107 } 108 109 public void testLinkHrefOnmousemove() throws Exception { 110 runMyTest("testLinkHrefOnmousemove", ""); 111 } 112 113 public void testLinkHrefOnmouseout() throws Exception { 114 runMyTest("testLinkHrefOnmouseout", ""); 115 } 116 117 public void testLinkHrefOnmouseover() throws Exception { 118 runMyTest("testLinkHrefOnmouseover", ""); 119 } 120 121 public void testLinkHrefOnmouseup() throws Exception { 122 runMyTest("testLinkHrefOnmouseup", ""); 123 } 124 125 public void testLinkHrefParamIdParamNameNoScope() throws Exception { 126 pageContext.setAttribute("paramName", "paramValue", PageContext.REQUEST_SCOPE); 127 runMyTest("testLinkHrefParamIdParamNameNoScope", ""); 128 } 129 130 public void testLinkHrefParamIdParamNameParamPropertyNoScope() throws Exception { 131 SimpleBeanForTesting sbft = new SimpleBeanForTesting("paramPropertyValue"); 132 pageContext.setAttribute("testingParamProperty", sbft, PageContext.REQUEST_SCOPE); 133 runMyTest("testLinkHrefParamIdParamNameParamPropertyNoScope", ""); 134 } 135 136 public void testLinkHrefParamIdParamNameApplicationScope() throws Exception { 137 pageContext.setAttribute("paramName", "paramValue", PageContext.APPLICATION_SCOPE); 138 runMyTest("testLinkHrefParamIdParamNameApplicationScope", ""); 139 } 140 141 public void testLinkHrefParamIdParamNameParamPropertyApplicationScope() throws Exception { 142 SimpleBeanForTesting sbft = new SimpleBeanForTesting("paramPropertyValue"); 143 pageContext.setAttribute("testingParamProperty", sbft, PageContext.APPLICATION_SCOPE); 144 runMyTest("testLinkHrefParamIdParamNameParamPropertyApplicationScope", ""); 145 } 146 147 public void testLinkHrefParamIdParamNameSessionScope() throws Exception { 148 pageContext.setAttribute("paramName", "paramValue", PageContext.SESSION_SCOPE); 149 runMyTest("testLinkHrefParamIdParamNameSessionScope", ""); 150 } 151 152 public void testLinkHrefParamIdParamNameParamPropertySessionScope() throws Exception { 153 SimpleBeanForTesting sbft = new SimpleBeanForTesting("paramPropertyValue"); 154 pageContext.setAttribute("testingParamProperty", sbft, PageContext.SESSION_SCOPE); 155 runMyTest("testLinkHrefParamIdParamNameParamPropertySessionScope", ""); 156 } 157 158 public void testLinkHrefParamIdParamNameRequestScope() throws Exception { 159 pageContext.setAttribute("paramName", "paramValue", PageContext.REQUEST_SCOPE); 160 runMyTest("testLinkHrefParamIdParamNameRequestScope", ""); 161 } 162 163 public void testLinkHrefParamIdParamNameParamPropertyRequestScope() throws Exception { 164 SimpleBeanForTesting sbft = new SimpleBeanForTesting("paramPropertyValue"); 165 pageContext.setAttribute("testingParamProperty", sbft, PageContext.REQUEST_SCOPE); 166 runMyTest("testLinkHrefParamIdParamNameParamPropertyRequestScope", ""); 167 } 168 169 170 public void testLinkHrefStyle() throws Exception { 171 runMyTest("testLinkHrefStyle", ""); 172 } 173 174 public void testLinkHrefStyleClass() throws Exception { 175 runMyTest("testLinkHrefStyleClass", ""); 176 } 177 178 public void testLinkHrefStyleId() throws Exception { 179 runMyTest("testLinkHrefStyleId", ""); 180 } 181 182 public void testLinkHrefTabIndex() throws Exception { 183 runMyTest("testLinkHrefTabIndex", ""); 184 } 185 186 public void testLinkHrefTarget() throws Exception { 187 runMyTest("testLinkHrefTarget", ""); 188 } 189 190 191 192 193 194 195 196 public void testLinkHrefTitle() throws Exception { 197 runMyTest("testLinkHrefTitle", ""); 198 } 199 200 public void testLinkHrefTitleKey() throws Exception { 201 runMyTest("testLinkHrefTitleKey", ""); 202 } 203 204 public void testLinkHrefTransaction() throws Exception { 205 pageContext.setAttribute(Globals.TRANSACTION_TOKEN_KEY, "Some_Token_Here", PageContext.SESSION_SCOPE); 206 runMyTest("testLinkHrefTransaction", ""); 207 } 208 209 210 211 212 213 } 214 | Popular Tags |