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 TestErrorsTag4 extends JspTestCase { 36 37 42 public TestErrorsTag4(String theName) { 43 super(theName); 44 } 45 46 51 public static void main(String [] theArgs) { 52 junit.awtui.TestRunner.main(new String [] {TestErrorsTag4.class.getName()}); 53 } 54 55 59 public static Test suite() { 60 return new TestSuite(TestErrorsTag4.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/TestErrorsTag4.jsp"); 68 } 69 70 71 74 75 public void testErrorsDefaultBundle0ErrorsNameProperty() throws Exception { 76 runMyTest("testErrorsDefaultBundle0ErrorsNameProperty", ""); 77 } 78 public void testErrorsDefaultBundle2ErrorsNameProperty() throws Exception { 79 runMyTest("testErrorsDefaultBundle2ErrorsNameProperty", ""); 80 } 81 82 public void testErrorsAlternateBundle0ErrorsNameProperty() throws Exception { 83 runMyTest("testErrorsAlternateBundle0ErrorsNameProperty", ""); 84 } 85 public void testErrorsAlternateBundle2ErrorsNameProperty() throws Exception { 86 runMyTest("testErrorsAlternateBundle2ErrorsNameProperty", ""); 87 } 88 89 public void testErrorsDefaultBundle0ErrorsNameProperty_fr() throws Exception { 90 runMyTest("testErrorsDefaultBundle0ErrorsNameProperty_fr", "fr"); 91 } 92 public void testErrorsDefaultBundle2ErrorsNameProperty_fr() throws Exception { 93 runMyTest("testErrorsDefaultBundle2ErrorsNameProperty_fr", "fr"); 94 } 95 96 public void testErrorsAlternateBundle0ErrorsNameProperty_fr() throws Exception { 97 runMyTest("testErrorsAlternateBundle0ErrorsNameProperty_fr", "fr"); 98 } 99 public void testErrorsAlternateBundle2ErrorsNameProperty_fr() throws Exception { 100 runMyTest("testErrorsAlternateBundle2ErrorsNameProperty_fr", "fr"); 101 } 102 103 104 105 public void testErrorsDefaultBundle0ErrorsLocaleNameProperty() throws Exception { 106 pageContext.setAttribute("MY_LOCALE_KEY", new Locale ("fr", "fr"), PageContext.SESSION_SCOPE); 107 runMyTest("testErrorsDefaultBundle0ErrorsLocaleNameProperty", ""); 108 } 109 public void testErrorsDefaultBundle2ErrorsLocaleNameProperty() throws Exception { 110 pageContext.setAttribute("MY_LOCALE_KEY", new Locale ("fr", "fr"), PageContext.SESSION_SCOPE); 111 runMyTest("testErrorsDefaultBundle2ErrorsLocaleNameProperty", ""); 112 } 113 114 public void testErrorsAlternateBundle0ErrorsLocaleNameProperty() throws Exception { 115 pageContext.setAttribute("MY_LOCALE_KEY", new Locale ("fr", "fr"), PageContext.SESSION_SCOPE); 116 runMyTest("testErrorsAlternateBundle0ErrorsLocaleNameProperty", ""); 117 } 118 public void testErrorsAlternateBundle2ErrorsLocaleNameProperty() throws Exception { 119 pageContext.setAttribute("MY_LOCALE_KEY", new Locale ("fr", "fr"), PageContext.SESSION_SCOPE); 120 runMyTest("testErrorsAlternateBundle2ErrorsLocaleNameProperty", ""); 121 } 122 123 public void testErrorsDefaultBundle0ErrorsLocaleNameProperty_fr() throws Exception { 124 pageContext.setAttribute("MY_LOCALE_KEY", new Locale ("fr", "fr"), PageContext.SESSION_SCOPE); 125 runMyTest("testErrorsDefaultBundle0ErrorsLocaleNameProperty_fr", ""); 126 } 127 public void testErrorsDefaultBundle2ErrorsLocaleNameProperty_fr() throws Exception { 128 pageContext.setAttribute("MY_LOCALE_KEY", new Locale ("fr", "fr"), PageContext.SESSION_SCOPE); 129 runMyTest("testErrorsDefaultBundle2ErrorsLocaleNameProperty_fr", ""); 130 } 131 132 public void testErrorsAlternateBundle0ErrorsLocaleNameProperty_fr() throws Exception { 133 pageContext.setAttribute("MY_LOCALE_KEY", new Locale ("fr", "fr"), PageContext.SESSION_SCOPE); 134 runMyTest("testErrorsAlternateBundle0ErrorsLocaleNameProperty_fr", ""); 135 } 136 public void testErrorsAlternateBundle2ErrorsLocaleNameProperty_fr() throws Exception { 137 pageContext.setAttribute("MY_LOCALE_KEY", new Locale ("fr", "fr"), PageContext.SESSION_SCOPE); 138 runMyTest("testErrorsAlternateBundle2ErrorsLocaleNameProperty_fr", ""); 139 } 140 141 142 public void testErrorsCustomResources() throws Exception { 143 runMyTest("testErrorsCustomResources", ""); 144 } 145 public void testErrorsCustomResourcesAltBundle() throws Exception { 146 runMyTest("testErrorsCustomResourcesAltBundle", ""); 147 } 148 149 } 150 | Popular Tags |