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 30 35 public class TestErrorsTag1 extends JspTestCase { 36 37 42 public TestErrorsTag1(String theName) { 43 super(theName); 44 } 45 46 51 public static void main(String [] theArgs) { 52 junit.awtui.TestRunner.main(new String [] {TestErrorsTag1.class.getName()}); 53 } 54 55 59 public static Test suite() { 60 return new TestSuite(TestErrorsTag1.class); 62 } 63 64 private void runMyTest(String whichTest, String locale) throws Exception { 65 request.setAttribute("runTest", whichTest); 66 pageContext.setAttribute(Globals.LOCALE_KEY, new Locale (locale, locale), PageContext.SESSION_SCOPE); 67 pageContext.forward("/test/org/apache/struts/taglib/html/TestErrorsTag1.jsp"); 68 } 69 70 73 public void testErrorsDefaultBundle0Errors() throws Exception { 74 runMyTest("testErrorsDefaultBundle0Errors", ""); 75 } 76 public void testErrorsDefaultBundle2Errors() throws Exception { 77 runMyTest("testErrorsDefaultBundle2Errors", ""); 78 } 79 80 public void testErrorsAlternateBundle0Errors() throws Exception { 81 runMyTest("testErrorsAlternateBundle0Errors", ""); 82 } 83 public void testErrorsAlternateBundle2Errors() throws Exception { 84 runMyTest("testErrorsAlternateBundle2Errors", ""); 85 } 86 87 public void testErrorsDefaultBundle0Errors_fr() throws Exception { 88 runMyTest("testErrorsDefaultBundle0Errors_fr", "fr"); 89 } 90 public void testErrorsDefaultBundle2Errors_fr() throws Exception { 91 runMyTest("testErrorsDefaultBundle2Errors_fr", "fr"); 92 } 93 94 public void testErrorsAlternateBundle0Errors_fr() throws Exception { 95 runMyTest("testErrorsAlternateBundle0Errors_fr", "fr"); 96 } 97 public void testErrorsAlternateBundle2Errors_fr() throws Exception { 98 runMyTest("testErrorsAlternateBundle2Errors_fr", "fr"); 99 } 100 101 102 103 public void testErrorsDefaultBundle0ErrorsLocale() throws Exception { 104 pageContext.setAttribute("MY_LOCALE_KEY", new Locale ("fr", "fr"), PageContext.SESSION_SCOPE); 105 runMyTest("testErrorsDefaultBundle0ErrorsLocale", ""); 106 } 107 public void testErrorsDefaultBundle2ErrorsLocale() throws Exception { 108 pageContext.setAttribute("MY_LOCALE_KEY", new Locale ("fr", "fr"), PageContext.SESSION_SCOPE); 109 runMyTest("testErrorsDefaultBundle2ErrorsLocale", ""); 110 } 111 112 public void testErrorsAlternateBundle0ErrorsLocale() throws Exception { 113 pageContext.setAttribute("MY_LOCALE_KEY", new Locale ("fr", "fr"), PageContext.SESSION_SCOPE); 114 runMyTest("testErrorsAlternateBundle0ErrorsLocale", ""); 115 } 116 public void testErrorsAlternateBundle2ErrorsLocale() throws Exception { 117 pageContext.setAttribute("MY_LOCALE_KEY", new Locale ("fr", "fr"), PageContext.SESSION_SCOPE); 118 runMyTest("testErrorsAlternateBundle2ErrorsLocale", ""); 119 } 120 121 public void testErrorsDefaultBundle0ErrorsLocale_fr() throws Exception { 122 pageContext.setAttribute("MY_LOCALE_KEY", new Locale ("fr", "fr"), PageContext.SESSION_SCOPE); 123 runMyTest("testErrorsDefaultBundle0ErrorsLocale_fr", ""); 124 } 125 public void testErrorsDefaultBundle2ErrorsLocale_fr() throws Exception { 126 pageContext.setAttribute("MY_LOCALE_KEY", new Locale ("fr", "fr"), PageContext.SESSION_SCOPE); 127 runMyTest("testErrorsDefaultBundle2ErrorsLocale_fr", ""); 128 } 129 130 public void testErrorsAlternateBundle0ErrorsLocale_fr() throws Exception { 131 pageContext.setAttribute("MY_LOCALE_KEY", new Locale ("fr", "fr"), PageContext.SESSION_SCOPE); 132 runMyTest("testErrorsAlternateBundle0ErrorsLocale_fr", ""); 133 } 134 public void testErrorsAlternateBundle2ErrorsLocale_fr() throws Exception { 135 pageContext.setAttribute("MY_LOCALE_KEY", new Locale ("fr", "fr"), PageContext.SESSION_SCOPE); 136 runMyTest("testErrorsAlternateBundle2ErrorsLocale_fr", ""); 137 } 138 } 139 | Popular Tags |