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 TestErrorsTag3 extends JspTestCase { 36 37 42 public TestErrorsTag3(String theName) { 43 super(theName); 44 } 45 46 51 public static void main(String [] theArgs) { 52 junit.awtui.TestRunner.main(new String [] {TestErrorsTag3.class.getName()}); 53 } 54 55 59 public static Test suite() { 60 return new TestSuite(TestErrorsTag3.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/TestErrorsTag3.jsp"); 68 } 69 70 73 public void testErrorsDefaultBundle0ErrorsName() throws Exception { 74 runMyTest("testErrorsDefaultBundle0ErrorsName", ""); 75 } 76 public void testErrorsDefaultBundle2ErrorsName() throws Exception { 77 runMyTest("testErrorsDefaultBundle2ErrorsName", ""); 78 } 79 80 public void testErrorsAlternateBundle0ErrorsName() throws Exception { 81 runMyTest("testErrorsAlternateBundle0ErrorsName", ""); 82 } 83 public void testErrorsAlternateBundle2ErrorsName() throws Exception { 84 runMyTest("testErrorsAlternateBundle2ErrorsName", ""); 85 } 86 87 public void testErrorsDefaultBundle0ErrorsName_fr() throws Exception { 88 runMyTest("testErrorsDefaultBundle0ErrorsName_fr", "fr"); 89 } 90 public void testErrorsDefaultBundle2ErrorsName_fr() throws Exception { 91 runMyTest("testErrorsDefaultBundle2ErrorsName_fr", "fr"); 92 } 93 94 public void testErrorsAlternateBundle0ErrorsName_fr() throws Exception { 95 runMyTest("testErrorsAlternateBundle0ErrorsName_fr", "fr"); 96 } 97 public void testErrorsAlternateBundle2ErrorsName_fr() throws Exception { 98 runMyTest("testErrorsAlternateBundle2ErrorsName_fr", "fr"); 99 } 100 101 102 103 public void testErrorsDefaultBundle0ErrorsLocaleName() throws Exception { 104 pageContext.setAttribute("MY_LOCALE_KEY", new Locale ("fr", "fr"), PageContext.SESSION_SCOPE); 105 runMyTest("testErrorsDefaultBundle0ErrorsLocaleName", ""); 106 } 107 public void testErrorsDefaultBundle2ErrorsLocaleName() throws Exception { 108 pageContext.setAttribute("MY_LOCALE_KEY", new Locale ("fr", "fr"), PageContext.SESSION_SCOPE); 109 runMyTest("testErrorsDefaultBundle2ErrorsLocaleName", ""); 110 } 111 112 public void testErrorsAlternateBundle0ErrorsLocaleName() throws Exception { 113 pageContext.setAttribute("MY_LOCALE_KEY", new Locale ("fr", "fr"), PageContext.SESSION_SCOPE); 114 runMyTest("testErrorsAlternateBundle0ErrorsLocaleName", ""); 115 } 116 public void testErrorsAlternateBundle2ErrorsLocaleName() throws Exception { 117 pageContext.setAttribute("MY_LOCALE_KEY", new Locale ("fr", "fr"), PageContext.SESSION_SCOPE); 118 runMyTest("testErrorsAlternateBundle2ErrorsLocaleName", ""); 119 } 120 121 public void testErrorsDefaultBundle0ErrorsLocaleName_fr() throws Exception { 122 pageContext.setAttribute("MY_LOCALE_KEY", new Locale ("fr", "fr"), PageContext.SESSION_SCOPE); 123 runMyTest("testErrorsDefaultBundle0ErrorsLocaleName_fr", ""); 124 } 125 public void testErrorsDefaultBundle2ErrorsLocaleName_fr() throws Exception { 126 pageContext.setAttribute("MY_LOCALE_KEY", new Locale ("fr", "fr"), PageContext.SESSION_SCOPE); 127 runMyTest("testErrorsDefaultBundle2ErrorsLocaleName_fr", ""); 128 } 129 130 public void testErrorsAlternateBundle0ErrorsLocaleName_fr() throws Exception { 131 pageContext.setAttribute("MY_LOCALE_KEY", new Locale ("fr", "fr"), PageContext.SESSION_SCOPE); 132 runMyTest("testErrorsAlternateBundle0ErrorsLocaleName_fr", ""); 133 } 134 public void testErrorsAlternateBundle2ErrorsLocaleName_fr() throws Exception { 135 pageContext.setAttribute("MY_LOCALE_KEY", new Locale ("fr", "fr"), PageContext.SESSION_SCOPE); 136 runMyTest("testErrorsAlternateBundle2ErrorsLocaleName_fr", ""); 137 } 138 139 140 } 141 | Popular Tags |