1 18 package org.apache.struts.taglib.html; 19 20 import java.util.Locale ; 21 22 import javax.servlet.jsp.PageContext ; 23 import junit.framework.Test; 24 import junit.framework.TestSuite; 25 26 import org.apache.cactus.JspTestCase; 27 import org.apache.struts.Globals; 28 import org.apache.struts.taglib.SimpleBeanForTesting; 29 30 53 public class TestOptionTag1 extends JspTestCase { 54 55 60 public TestOptionTag1(String theName) { 61 super(theName); 62 } 63 64 69 public static void main(String [] theArgs) { 70 junit.awtui.TestRunner.main(new String [] {TestOptionTag1.class.getName()}); 71 } 72 73 77 public static Test suite() { 78 return new TestSuite(TestOptionTag1.class); 80 } 81 82 private void runMyTest(String whichTest, String locale) throws Exception { 83 pageContext.setAttribute(Globals.LOCALE_KEY, 84 new Locale (locale, locale), 85 PageContext.SESSION_SCOPE); 86 87 SimpleBeanForTesting sbft = new SimpleBeanForTesting("SelectMe"); 88 89 pageContext.setAttribute(Constants.BEAN_KEY, sbft, PageContext.REQUEST_SCOPE); 90 request.setAttribute("runTest", whichTest); 91 pageContext.forward("/test/org/apache/struts/taglib/html/TestOptionTag1.jsp"); 92 } 93 94 97 public void testOptionBodySelected() throws Exception { 98 runMyTest("testOptionBodySelected", ""); 99 } 100 101 public void testOptionBodyNotSelected() throws Exception { 102 runMyTest("testOptionBodyNotSelected", ""); 103 } 104 105 public void testOptionBodySelectedDisabled_true() throws Exception { 106 runMyTest("testOptionBodySelectedDisabled_true", ""); 107 } 108 109 public void testOptionBodyNotSelectedDisabled_true() throws Exception { 110 runMyTest("testOptionBodyNotSelectedDisabled_true", ""); 111 } 112 113 public void testOptionBodySelectedDisabled_false() throws Exception { 114 runMyTest("testOptionBodySelectedDisabled_false", ""); 115 } 116 117 public void testOptionBodyNotSelectedDisabled_false() throws Exception { 118 runMyTest("testOptionBodyNotSelectedDisabled_false", ""); 119 } 120 121 public void testOptionBodySelectedDisabled_other() throws Exception { 122 runMyTest("testOptionBodySelectedDisabled_other", ""); 123 } 124 125 public void testOptionBodyNotSelectedDisabled_other() throws Exception { 126 runMyTest("testOptionBodyNotSelectedDisabled_other", ""); 127 } 128 129 public void testOptionKeySelected() throws Exception { 130 runMyTest("testOptionKeySelected", ""); 131 } 132 133 public void testOptionKeyNotSelected() throws Exception { 134 runMyTest("testOptionKeyNotSelected", ""); 135 } 136 137 public void testOptionKeySelectedAlternateBundle() throws Exception { 138 runMyTest("testOptionKeySelectedAlternateBundle", ""); 139 } 140 141 public void testOptionKeyNotSelectedAlternateBundle() throws Exception { 142 runMyTest("testOptionKeyNotSelectedAlternateBundle", ""); 143 } 144 145 public void testOptionKeySelectedLocale_fr() throws Exception { 146 runMyTest("testOptionKeySelectedLocale_fr", "fr"); 147 } 148 149 public void testOptionKeyNotSelectedLocale_fr() throws Exception { 150 runMyTest("testOptionKeyNotSelectedLocale_fr", "fr"); 151 } 152 153 public void testOptionKeySelectedAlternateBundleLocale_fr() throws Exception { 154 runMyTest("testOptionKeySelectedAlternateBundleLocale_fr", "fr"); 155 } 156 157 public void testOptionKeyNotSelectedAlternateBundleLocale_fr() throws Exception { 158 runMyTest("testOptionKeyNotSelectedAlternateBundleLocale_fr", "fr"); 159 } 160 161 } 162 | Popular Tags |