struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hus...@apache.org
Subject svn commit: r376852 [14/20] - /struts/taglib/trunk/src/webapp/org/apache/struts/taglib/html/
Date Fri, 10 Feb 2006 21:08:50 GMT
Modified: struts/taglib/trunk/src/webapp/org/apache/struts/taglib/html/TestMessagesTag4.jsp
URL: http://svn.apache.org/viewcvs/struts/taglib/trunk/src/webapp/org/apache/struts/taglib/html/TestMessagesTag4.jsp?rev=376852&r1=376851&r2=376852&view=diff
==============================================================================
--- struts/taglib/trunk/src/webapp/org/apache/struts/taglib/html/TestMessagesTag4.jsp (original)
+++ struts/taglib/trunk/src/webapp/org/apache/struts/taglib/html/TestMessagesTag4.jsp Fri Feb 10 13:08:44 2006
@@ -1,610 +1,669 @@
 <%@ page contentType="text/html;charset=UTF-8" language="java" %>
-<%@page import="junit.framework.Assert"%>
-<%@page import="java.util.HashMap"%>
-<%@page import="org.apache.struts.util.MessageResources"%>
-<%@page import="org.apache.struts.Globals"%>
-<%@page import="org.apache.struts.action.ActionMessage"%>
-<%@page import="org.apache.struts.action.ActionMessages"%>
-<%@page import="org.apache.struts.Globals"%>
+<%@ page import="junit.framework.Assert" %>
+<%@ page import="org.apache.struts.Globals" %>
+<%@ page import="org.apache.struts.action.ActionMessage" %>
+<%@ page import="org.apache.struts.action.ActionMessages" %>
+<%@ page import="org.apache.struts.util.MessageResources" %>
 
 <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
 <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
 <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
 
 <%
-/** 
-  * From the Docs:
-  * 
-  * <html:message>
-  * Displays a set of messages prepared by a business logic component and 
-  * stored as an ActionMessages object, a String, or a String array in request 
-  * scope. If such a bean is not found, nothing will be rendered.
-  * 
-  * The tests are setup to test all possible scenarios with each ojbect listed.
-  * Using Globals.ERROR_KEY in the request
-  * TestMessagesTag1.jsp - uses ActionMessages to store any keys for testing
-  * TestMessagesTag2.jsp - uses a String to store any keys for testing
-  * TestMessagesTag3.jsp - uses a String Array to store any keys for testing
-  * TestMessagesTag4.jsp - uses ActionMessages to store any keys for testing
-  * 
-  * Using Globals.MESSAGE_KEY in the request
-  * TestMessagesTag5.jsp - uses ActionMessages to store any keys for testing
-  * TestMessagesTag6.jsp - uses a String to store any keys for testing
-  * TestMessagesTag7.jsp - uses a String Array to store any keys for testing
-  * TestMessagesTag8.jsp - uses ActionMessages to store any keys for testing
-  * 
-  **/
+    /**
+     * From the Docs:
+     *
+     * <html:message>
+     * Displays a set of messages prepared by a business logic component and
+     * stored as an ActionMessages object, a String, or a String array in request
+     * scope. If such a bean is not found, nothing will be rendered.
+     *
+     * The tests are setup to test all possible scenarios with each ojbect listed.
+     * Using Globals.ERROR_KEY in the request
+     * TestMessagesTag1.jsp - uses ActionMessages to store any keys for testing
+     * TestMessagesTag2.jsp - uses a String to store any keys for testing
+     * TestMessagesTag3.jsp - uses a String Array to store any keys for testing
+     * TestMessagesTag4.jsp - uses ActionMessages to store any keys for testing
+     *
+     * Using Globals.MESSAGE_KEY in the request
+     * TestMessagesTag5.jsp - uses ActionMessages to store any keys for testing
+     * TestMessagesTag6.jsp - uses a String to store any keys for testing
+     * TestMessagesTag7.jsp - uses a String Array to store any keys for testing
+     * TestMessagesTag8.jsp - uses ActionMessages to store any keys for testing
+     *
+     **/
 %>
 
 <!-- --------Testing attributes using forward------ -->
 <logic:equal name="runTest" value="testMessages">
     <bean:define id="EXPECTED_RESULTS" toScope="page">
-      Messages:
+        Messages:
     </bean:define>
     <bean:define id="TEST_RESULTS" toScope="page">
-      Messages:
-      <html:messages id="message" >
-        Message:<bean:write name="message"/>
-      </html:messages>
+        Messages:
+        <html:messages id="message">
+            Message:<bean:write name="message"/>
+        </html:messages>
     </bean:define>
 </logic:equal>
 
 
 <logic:equal name="runTest" value="testMessagesDefaultBundleEmpty">
     <bean:define id="EXPECTED_RESULTS" toScope="page">
-      Messages:
+        Messages:
     </bean:define>
-   <% 
-     ActionMessages messages = new ActionMessages();
-     request.setAttribute(Globals.ERROR_KEY, messages);
-   %>
-    <bean:define id="TEST_RESULTS" toScope="page">
-      Messages:
-      <html:messages id="message" >
-        Message:<bean:write name="message"/>
-      </html:messages>
+    <%
+        ActionMessages messages = new ActionMessages();
+        request.setAttribute(Globals.ERROR_KEY, messages);
+    %>
+    <bean:define id="TEST_RESULTS" toScope="page">
+        Messages:
+        <html:messages id="message">
+            Message:<bean:write name="message"/>
+        </html:messages>
     </bean:define>
 </logic:equal>
 
 
 <logic:equal name="runTest" value="testMessagesActionMessageDefaultBundle">
     <bean:define id="EXPECTED_RESULTS" toScope="page">
-      Messages:
-      
+        Messages:
+
         Message:Testing Message
-      
+
         Message:Testing Message
     </bean:define>
 
-   <% 
-     ActionMessages messages = new ActionMessages();
-     messages.add("myproperty1", new ActionMessage("default.bundle.message"));
-     messages.add("myproperty2", new ActionMessage("default.bundle.message"));
-     request.setAttribute(Globals.ERROR_KEY, messages);
-   %>
+    <%
+        ActionMessages messages = new ActionMessages();
+        messages.add("myproperty1",
+                new ActionMessage("default.bundle.message"));
+        messages.add("myproperty2",
+                new ActionMessage("default.bundle.message"));
+        request.setAttribute(Globals.ERROR_KEY, messages);
+    %>
     <bean:define id="TEST_RESULTS" toScope="page">
-      Messages:
-      <html:messages id="message" >
-        Message:<bean:write name="message"/>
-      </html:messages>
+        Messages:
+        <html:messages id="message">
+            Message:<bean:write name="message"/>
+        </html:messages>
     </bean:define>
 </logic:equal>
 
 
-<logic:equal name="runTest" value="testMessagesActionMessageDefaultBundleHeader">
+<logic:equal name="runTest"
+             value="testMessagesActionMessageDefaultBundleHeader">
     <bean:define id="EXPECTED_RESULTS" toScope="page">
-      Messages:
-      custom_error_header
+        Messages:
+        custom_error_header
         Message:Testing Message
-      
+
         Message:Testing Message
     </bean:define>
 
-  <% 
-     ActionMessages messages = new ActionMessages();
-     messages.add("myproperty1", new ActionMessage("default.bundle.message"));
-     messages.add("myproperty2", new ActionMessage("default.bundle.message"));
-     request.setAttribute(Globals.ERROR_KEY, messages);
-   %>
+    <%
+        ActionMessages messages = new ActionMessages();
+        messages.add("myproperty1",
+                new ActionMessage("default.bundle.message"));
+        messages.add("myproperty2",
+                new ActionMessage("default.bundle.message"));
+        request.setAttribute(Globals.ERROR_KEY, messages);
+    %>
     <bean:define id="TEST_RESULTS" toScope="page">
-      Messages:
-      <html:messages id="message"  header="custom.errors.header">
-        Message:<bean:write name="message"/>
-      </html:messages>
+        Messages:
+        <html:messages id="message" header="custom.errors.header">
+            Message:<bean:write name="message"/>
+        </html:messages>
     </bean:define>
 </logic:equal>
 
 
-<logic:equal name="runTest" value="testMessagesActionMessageDefaultBundleHeaderFooter">
+<logic:equal name="runTest"
+             value="testMessagesActionMessageDefaultBundleHeaderFooter">
     <bean:define id="EXPECTED_RESULTS" toScope="page">
-      Messages:
-      custom_error_header
+        Messages:
+        custom_error_header
         Message:Testing Message
-      
+
         Message:Testing Message
-      custom_error_footer
+        custom_error_footer
     </bean:define>
 
-  <% 
-     ActionMessages messages = new ActionMessages();
-     messages.add("myproperty1", new ActionMessage("default.bundle.message"));
-     messages.add("myproperty2", new ActionMessage("default.bundle.message"));
-     request.setAttribute(Globals.ERROR_KEY, messages);
-   %>
+    <%
+        ActionMessages messages = new ActionMessages();
+        messages.add("myproperty1",
+                new ActionMessage("default.bundle.message"));
+        messages.add("myproperty2",
+                new ActionMessage("default.bundle.message"));
+        request.setAttribute(Globals.ERROR_KEY, messages);
+    %>
     <bean:define id="TEST_RESULTS" toScope="page">
-      Messages:
-      <html:messages id="message"  header="custom.errors.header" footer="custom.errors.footer">
-        Message:<bean:write name="message"/>
-      </html:messages>
+        Messages:
+        <html:messages id="message" header="custom.errors.header"
+                       footer="custom.errors.footer">
+            Message:<bean:write name="message"/>
+        </html:messages>
     </bean:define>
 </logic:equal>
 
 
-
 <logic:equal name="runTest" value="testMessagesNameDefaultBundleEmpty">
     <bean:define id="EXPECTED_RESULTS" toScope="page">
-      Messages:
+        Messages:
     </bean:define>
 
-   <% 
-     ActionMessages messages = new ActionMessages();
-     request.setAttribute("my-key", messages);
-   %>
+    <%
+        ActionMessages messages = new ActionMessages();
+        request.setAttribute("my-key", messages);
+    %>
     <bean:define id="TEST_RESULTS" toScope="page">
-      Messages:
-      <html:messages id="message"  name="my-key">
-        Message:<bean:write name="message"/>
-      </html:messages>
+        Messages:
+        <html:messages id="message" name="my-key">
+            Message:<bean:write name="message"/>
+        </html:messages>
     </bean:define>
 </logic:equal>
 
-<logic:equal name="runTest" value="testMessagesNamePropertyDefaultBundleEmpty">
+<logic:equal name="runTest"
+             value="testMessagesNamePropertyDefaultBundleEmpty">
     <bean:define id="EXPECTED_RESULTS" toScope="page">
-      Messages:
+        Messages:
     </bean:define>
 
-   <% 
-     ActionMessages messages = new ActionMessages();
-     request.setAttribute("my-key", messages);
-   %>
+    <%
+        ActionMessages messages = new ActionMessages();
+        request.setAttribute("my-key", messages);
+    %>
     <bean:define id="TEST_RESULTS" toScope="page">
-      Messages:
-      <html:messages id="message" name="my-key" property="myproperty2">
-        Message:<bean:write name="message"/>
-      </html:messages>
+        Messages:
+        <html:messages id="message" name="my-key" property="myproperty2">
+            Message:<bean:write name="message"/>
+        </html:messages>
     </bean:define>
 </logic:equal>
 
 
-
-<logic:equal name="runTest" value="testMessagesNameActionMessageDefaultBundle">
+<logic:equal name="runTest"
+             value="testMessagesNameActionMessageDefaultBundle">
     <bean:define id="EXPECTED_RESULTS" toScope="page">
-      Messages:
-      
+        Messages:
+
         Message:Testing Message
-      
+
         Message:Testing Message
     </bean:define>
 
-   <% 
-     ActionMessages messages = new ActionMessages();
-     messages.add("myproperty1", new ActionMessage("default.bundle.message"));
-     messages.add("myproperty2", new ActionMessage("default.bundle.message"));
-     request.setAttribute("my-key", messages);
-   %>
+    <%
+        ActionMessages messages = new ActionMessages();
+        messages.add("myproperty1",
+                new ActionMessage("default.bundle.message"));
+        messages.add("myproperty2",
+                new ActionMessage("default.bundle.message"));
+        request.setAttribute("my-key", messages);
+    %>
     <bean:define id="TEST_RESULTS" toScope="page">
-      Messages:
-      <html:messages id="message"  name="my-key">
-        Message:<bean:write name="message"/>
-      </html:messages>
+        Messages:
+        <html:messages id="message" name="my-key">
+            Message:<bean:write name="message"/>
+        </html:messages>
     </bean:define>
 </logic:equal>
 
 
-
-<logic:equal name="runTest" value="testMessagesNamePropertyActionMessageDefaultBundle">
+<logic:equal name="runTest"
+             value="testMessagesNamePropertyActionMessageDefaultBundle">
     <bean:define id="EXPECTED_RESULTS" toScope="page">
-      Messages:
-      
+        Messages:
+
         Message:Testing Message
     </bean:define>
 
-   <% 
-     ActionMessages messages = new ActionMessages();
-     messages.add("myproperty1", new ActionMessage("default.bundle.message"));
-     messages.add("myproperty2", new ActionMessage("default.bundle.message"));
-     request.setAttribute("my-key", messages);
-   %>
+    <%
+        ActionMessages messages = new ActionMessages();
+        messages.add("myproperty1",
+                new ActionMessage("default.bundle.message"));
+        messages.add("myproperty2",
+                new ActionMessage("default.bundle.message"));
+        request.setAttribute("my-key", messages);
+    %>
     <bean:define id="TEST_RESULTS" toScope="page">
-      Messages:
-      <html:messages id="message"  name="my-key" property="myproperty2">
-        Message:<bean:write name="message"/>
-      </html:messages>
+        Messages:
+        <html:messages id="message" name="my-key" property="myproperty2">
+            Message:<bean:write name="message"/>
+        </html:messages>
     </bean:define>
 </logic:equal>
 
 
-
-<logic:equal name="runTest" value="testMessagesNameActionMessageDefaultBundleHeader">
+<logic:equal name="runTest"
+             value="testMessagesNameActionMessageDefaultBundleHeader">
     <bean:define id="EXPECTED_RESULTS" toScope="page">
-      Messages:
-      custom_error_header
+        Messages:
+        custom_error_header
         Message:Testing Message
-      
+
         Message:Testing Message
     </bean:define>
 
-  <% 
-     ActionMessages messages = new ActionMessages();
-     messages.add("myproperty1", new ActionMessage("default.bundle.message"));
-     messages.add("myproperty2", new ActionMessage("default.bundle.message"));
-     request.setAttribute("my-key", messages);
-   %>
+    <%
+        ActionMessages messages = new ActionMessages();
+        messages.add("myproperty1",
+                new ActionMessage("default.bundle.message"));
+        messages.add("myproperty2",
+                new ActionMessage("default.bundle.message"));
+        request.setAttribute("my-key", messages);
+    %>
     <bean:define id="TEST_RESULTS" toScope="page">
-      Messages:
-      <html:messages id="message"  name="my-key" header="custom.errors.header">
-        Message:<bean:write name="message"/>
-      </html:messages>
+        Messages:
+        <html:messages id="message" name="my-key"
+                       header="custom.errors.header">
+            Message:<bean:write name="message"/>
+        </html:messages>
     </bean:define>
 </logic:equal>
 
 
-<logic:equal name="runTest" value="testMessagesNamePropertyActionMessageDefaultBundleHeader">
+<logic:equal name="runTest"
+             value="testMessagesNamePropertyActionMessageDefaultBundleHeader">
     <bean:define id="EXPECTED_RESULTS" toScope="page">
-      Messages:
-      custom_error_header
+        Messages:
+        custom_error_header
         Message:Testing Message
     </bean:define>
 
-  <% 
-     ActionMessages messages = new ActionMessages();
-     messages.add("myproperty1", new ActionMessage("default.bundle.message"));
-     messages.add("myproperty2", new ActionMessage("default.bundle.message"));
-     request.setAttribute("my-key", messages);
-   %>
+    <%
+        ActionMessages messages = new ActionMessages();
+        messages.add("myproperty1",
+                new ActionMessage("default.bundle.message"));
+        messages.add("myproperty2",
+                new ActionMessage("default.bundle.message"));
+        request.setAttribute("my-key", messages);
+    %>
     <bean:define id="TEST_RESULTS" toScope="page">
-      Messages:
-      <html:messages id="message"  name="my-key" header="custom.errors.header" property="myproperty2">
-        Message:<bean:write name="message"/>
-      </html:messages>
+        Messages:
+        <html:messages id="message" name="my-key"
+                       header="custom.errors.header" property="myproperty2">
+            Message:<bean:write name="message"/>
+        </html:messages>
     </bean:define>
 </logic:equal>
 
-<logic:equal name="runTest" value="testMessagesNameActionMessageDefaultBundleHeaderFooter">
+<logic:equal name="runTest"
+             value="testMessagesNameActionMessageDefaultBundleHeaderFooter">
     <bean:define id="EXPECTED_RESULTS" toScope="page">
-      Messages:
-      custom_error_header
+        Messages:
+        custom_error_header
         Message:Testing Message
-      
+
         Message:Testing Message
-      custom_error_footer
+        custom_error_footer
     </bean:define>
 
-  <% 
-     ActionMessages messages = new ActionMessages();
-     messages.add("myproperty1", new ActionMessage("default.bundle.message"));
-     messages.add("myproperty2", new ActionMessage("default.bundle.message"));
-     request.setAttribute("my-key", messages);
-   %>
+    <%
+        ActionMessages messages = new ActionMessages();
+        messages.add("myproperty1",
+                new ActionMessage("default.bundle.message"));
+        messages.add("myproperty2",
+                new ActionMessage("default.bundle.message"));
+        request.setAttribute("my-key", messages);
+    %>
     <bean:define id="TEST_RESULTS" toScope="page">
-      Messages:
-      <html:messages id="message"  name="my-key" header="custom.errors.header" footer="custom.errors.footer">
-        Message:<bean:write name="message"/>
-      </html:messages>
+        Messages:
+        <html:messages id="message" name="my-key"
+                       header="custom.errors.header"
+                       footer="custom.errors.footer">
+            Message:<bean:write name="message"/>
+        </html:messages>
     </bean:define>
 </logic:equal>
 
 
-<logic:equal name="runTest" value="testMessagesNamePropertyActionMessageDefaultBundleHeaderFooter">
+<logic:equal name="runTest"
+             value="testMessagesNamePropertyActionMessageDefaultBundleHeaderFooter">
     <bean:define id="EXPECTED_RESULTS" toScope="page">
-      Messages:
-      custom_error_header
+        Messages:
+        custom_error_header
         Message:Testing Message
-      custom_error_footer
+        custom_error_footer
     </bean:define>
 
-  <% 
-     ActionMessages messages = new ActionMessages();
-     messages.add("myproperty1", new ActionMessage("default.bundle.message"));
-     messages.add("myproperty2", new ActionMessage("default.bundle.message"));
-     request.setAttribute("my-key", messages);
-   %>
+    <%
+        ActionMessages messages = new ActionMessages();
+        messages.add("myproperty1",
+                new ActionMessage("default.bundle.message"));
+        messages.add("myproperty2",
+                new ActionMessage("default.bundle.message"));
+        request.setAttribute("my-key", messages);
+    %>
     <bean:define id="TEST_RESULTS" toScope="page">
-      Messages:
-      <html:messages id="message"  name="my-key" header="custom.errors.header" footer="custom.errors.footer" property="myproperty2">
-        Message:<bean:write name="message"/>
-      </html:messages>
+        Messages:
+        <html:messages id="message" name="my-key"
+                       header="custom.errors.header"
+                       footer="custom.errors.footer" property="myproperty2">
+            Message:<bean:write name="message"/>
+        </html:messages>
     </bean:define>
 </logic:equal>
 
 
-
-
-
-
-
 <logic:equal name="runTest" value="testMessagesAlternateBundleEmpty">
     <bean:define id="EXPECTED_RESULTS" toScope="page">
-      Messages:
+        Messages:
     </bean:define>
 
-   <% 
-     ActionMessages messages = new ActionMessages();
-     request.setAttribute(Globals.ERROR_KEY, messages);
-   %>
-    <bean:define id="TEST_RESULTS" toScope="page">
-      Messages:
-      <html:messages id="message"  bundle="alternate">
-        Message:<bean:write name="message"/>
-      </html:messages>
+    <%
+        ActionMessages messages = new ActionMessages();
+        request.setAttribute(Globals.ERROR_KEY, messages);
+    %>
+    <bean:define id="TEST_RESULTS" toScope="page">
+        Messages:
+        <html:messages id="message" bundle="alternate">
+            Message:<bean:write name="message"/>
+        </html:messages>
     </bean:define>
 </logic:equal>
 
 
 <logic:equal name="runTest" value="testMessagesActionMessageAlternateBundle">
     <bean:define id="EXPECTED_RESULTS" toScope="page">
-      Messages:
-      
+        Messages:
+
         Message:Testing Message
-      
+
         Message:Testing Message
     </bean:define>
 
-   <% 
-     ActionMessages messages = new ActionMessages();
-     messages.add("myproperty1", new ActionMessage("alternate.bundle.message"));
-     messages.add("myproperty2", new ActionMessage("alternate.bundle.message"));
-     request.setAttribute(Globals.ERROR_KEY, messages);
-   %>
+    <%
+        ActionMessages messages = new ActionMessages();
+        messages.add("myproperty1",
+                new ActionMessage("alternate.bundle.message"));
+        messages.add("myproperty2",
+                new ActionMessage("alternate.bundle.message"));
+        request.setAttribute(Globals.ERROR_KEY, messages);
+    %>
     <bean:define id="TEST_RESULTS" toScope="page">
-      Messages:
-      <html:messages id="message"  bundle="alternate">
-        Message:<bean:write name="message"/>
-      </html:messages>
+        Messages:
+        <html:messages id="message" bundle="alternate">
+            Message:<bean:write name="message"/>
+        </html:messages>
     </bean:define>
 </logic:equal>
 
 
-<logic:equal name="runTest" value="testMessagesActionMessageAlternateBundleHeader">
+<logic:equal name="runTest"
+             value="testMessagesActionMessageAlternateBundleHeader">
     <bean:define id="EXPECTED_RESULTS" toScope="page">
-      Messages:
-      custom_alternate_error_header
+        Messages:
+        custom_alternate_error_header
         Message:Testing Message
-      
+
         Message:Testing Message
     </bean:define>
 
-  <% 
-     ActionMessages messages = new ActionMessages();
-     messages.add("myproperty1", new ActionMessage("alternate.bundle.message"));
-     messages.add("myproperty2", new ActionMessage("alternate.bundle.message"));
-     request.setAttribute(Globals.ERROR_KEY, messages);
-   %>
+    <%
+        ActionMessages messages = new ActionMessages();
+        messages.add("myproperty1",
+                new ActionMessage("alternate.bundle.message"));
+        messages.add("myproperty2",
+                new ActionMessage("alternate.bundle.message"));
+        request.setAttribute(Globals.ERROR_KEY, messages);
+    %>
     <bean:define id="TEST_RESULTS" toScope="page">
-      Messages:
-      <html:messages id="message"  header="custom.alternate.errors.header" bundle="alternate">
-        Message:<bean:write name="message"/>
-      </html:messages>
+        Messages:
+        <html:messages id="message" header="custom.alternate.errors.header"
+                       bundle="alternate">
+            Message:<bean:write name="message"/>
+        </html:messages>
     </bean:define>
 </logic:equal>
 
 
-<logic:equal name="runTest" value="testMessagesActionMessageAlternateBundleHeaderFooter">
+<logic:equal name="runTest"
+             value="testMessagesActionMessageAlternateBundleHeaderFooter">
     <bean:define id="EXPECTED_RESULTS" toScope="page">
-      Messages:
-      custom_alternate_error_header
+        Messages:
+        custom_alternate_error_header
         Message:Testing Message
-      
+
         Message:Testing Message
-      custom_alternate_error_footer
+        custom_alternate_error_footer
     </bean:define>
 
-  <% 
-     ActionMessages messages = new ActionMessages();
-     messages.add("myproperty1", new ActionMessage("alternate.bundle.message"));
-     messages.add("myproperty2", new ActionMessage("alternate.bundle.message"));
-     request.setAttribute(Globals.ERROR_KEY, messages);
-   %>
+    <%
+        ActionMessages messages = new ActionMessages();
+        messages.add("myproperty1",
+                new ActionMessage("alternate.bundle.message"));
+        messages.add("myproperty2",
+                new ActionMessage("alternate.bundle.message"));
+        request.setAttribute(Globals.ERROR_KEY, messages);
+    %>
     <bean:define id="TEST_RESULTS" toScope="page">
-      Messages:
-      <html:messages id="message"  header="custom.alternate.errors.header" 
-             footer="custom.alternate.errors.footer" bundle="alternate">
-        Message:<bean:write name="message"/>
-      </html:messages>
+        Messages:
+        <html:messages id="message" header="custom.alternate.errors.header"
+                       footer="custom.alternate.errors.footer"
+                       bundle="alternate">
+            Message:<bean:write name="message"/>
+        </html:messages>
     </bean:define>
 </logic:equal>
 
 
-
-
 <logic:equal name="runTest" value="testMessagesNameAlternateBundleEmpty">
     <bean:define id="EXPECTED_RESULTS" toScope="page">
-      Messages:
+        Messages:
     </bean:define>
 
-   <% 
-     ActionMessages messages = new ActionMessages();
-     request.setAttribute("my-key", messages);
-   %>
+    <%
+        ActionMessages messages = new ActionMessages();
+        request.setAttribute("my-key", messages);
+    %>
     <bean:define id="TEST_RESULTS" toScope="page">
-      Messages:
-      <html:messages id="message"  name="my-key" bundle="alternate">
-        Message:<bean:write name="message"/>
-      </html:messages>
+        Messages:
+        <html:messages id="message" name="my-key" bundle="alternate">
+            Message:<bean:write name="message"/>
+        </html:messages>
     </bean:define>
 </logic:equal>
 
 
-<logic:equal name="runTest" value="testMessagesNamePropertyAlternateBundleEmpty">
+<logic:equal name="runTest"
+             value="testMessagesNamePropertyAlternateBundleEmpty">
     <bean:define id="EXPECTED_RESULTS" toScope="page">
-      Messages:
+        Messages:
     </bean:define>
 
-   <% 
-     ActionMessages messages = new ActionMessages();
-     request.setAttribute("my-key", messages);
-   %>
+    <%
+        ActionMessages messages = new ActionMessages();
+        request.setAttribute("my-key", messages);
+    %>
     <bean:define id="TEST_RESULTS" toScope="page">
-      Messages:
-      <html:messages id="message"  name="my-key" bundle="alternate" property="myproperty2">
-        Message:<bean:write name="message"/>
-      </html:messages>
+        Messages:
+        <html:messages id="message" name="my-key" bundle="alternate"
+                       property="myproperty2">
+            Message:<bean:write name="message"/>
+        </html:messages>
     </bean:define>
 </logic:equal>
 
 
-<logic:equal name="runTest" value="testMessagesNameActionMessageAlternateBundle">
+<logic:equal name="runTest"
+             value="testMessagesNameActionMessageAlternateBundle">
     <bean:define id="EXPECTED_RESULTS" toScope="page">
-      Messages:
-      
+        Messages:
+
         Message:Testing Message
-      
+
         Message:Testing Message
     </bean:define>
 
-   <% 
-     ActionMessages messages = new ActionMessages();
-     messages.add("myproperty1", new ActionMessage("alternate.bundle.message"));
-     messages.add("myproperty2", new ActionMessage("alternate.bundle.message"));
-     request.setAttribute("my-key", messages);
-   %>
+    <%
+        ActionMessages messages = new ActionMessages();
+        messages.add("myproperty1",
+                new ActionMessage("alternate.bundle.message"));
+        messages.add("myproperty2",
+                new ActionMessage("alternate.bundle.message"));
+        request.setAttribute("my-key", messages);
+    %>
     <bean:define id="TEST_RESULTS" toScope="page">
-      Messages:
-      <html:messages id="message"  name="my-key" bundle="alternate">
-        Message:<bean:write name="message"/>
-      </html:messages>
+        Messages:
+        <html:messages id="message" name="my-key" bundle="alternate">
+            Message:<bean:write name="message"/>
+        </html:messages>
     </bean:define>
 </logic:equal>
 
-<logic:equal name="runTest" value="testMessagesNamePropertyActionMessageAlternateBundle">
+<logic:equal name="runTest"
+             value="testMessagesNamePropertyActionMessageAlternateBundle">
     <bean:define id="EXPECTED_RESULTS" toScope="page">
-      Messages:
-      
+        Messages:
+
         Message:Testing Message
     </bean:define>
 
-   <% 
-     ActionMessages messages = new ActionMessages();
-     messages.add("myproperty1", new ActionMessage("alternate.bundle.message"));
-     messages.add("myproperty2", new ActionMessage("alternate.bundle.message"));
-     request.setAttribute("my-key", messages);
-   %>
+    <%
+        ActionMessages messages = new ActionMessages();
+        messages.add("myproperty1",
+                new ActionMessage("alternate.bundle.message"));
+        messages.add("myproperty2",
+                new ActionMessage("alternate.bundle.message"));
+        request.setAttribute("my-key", messages);
+    %>
     <bean:define id="TEST_RESULTS" toScope="page">
-      Messages:
-      <html:messages id="message"  name="my-key" bundle="alternate" property="myproperty2">
-        Message:<bean:write name="message"/>
-      </html:messages>
+        Messages:
+        <html:messages id="message" name="my-key" bundle="alternate"
+                       property="myproperty2">
+            Message:<bean:write name="message"/>
+        </html:messages>
     </bean:define>
 </logic:equal>
 
 
-<logic:equal name="runTest" value="testMessagesNameActionMessageAlternateBundleHeader">
+<logic:equal name="runTest"
+             value="testMessagesNameActionMessageAlternateBundleHeader">
     <bean:define id="EXPECTED_RESULTS" toScope="page">
-      Messages:
-      custom_alternate_error_header
+        Messages:
+        custom_alternate_error_header
         Message:Testing Message
-      
+
         Message:Testing Message
     </bean:define>
 
-  <% 
-     ActionMessages messages = new ActionMessages();
-     messages.add("myproperty1", new ActionMessage("alternate.bundle.message"));
-     messages.add("myproperty2", new ActionMessage("alternate.bundle.message"));
-     request.setAttribute("my-key", messages);
-   %>
+    <%
+        ActionMessages messages = new ActionMessages();
+        messages.add("myproperty1",
+                new ActionMessage("alternate.bundle.message"));
+        messages.add("myproperty2",
+                new ActionMessage("alternate.bundle.message"));
+        request.setAttribute("my-key", messages);
+    %>
     <bean:define id="TEST_RESULTS" toScope="page">
-      Messages:
-      <html:messages id="message"  name="my-key" header="custom.alternate.errors.header" bundle="alternate">
-        Message:<bean:write name="message"/>
-      </html:messages>
+        Messages:
+        <html:messages id="message" name="my-key"
+                       header="custom.alternate.errors.header"
+                       bundle="alternate">
+            Message:<bean:write name="message"/>
+        </html:messages>
     </bean:define>
 </logic:equal>
 
 
-<logic:equal name="runTest" value="testMessagesNamePropertyActionMessageAlternateBundleHeader">
+<logic:equal name="runTest"
+             value="testMessagesNamePropertyActionMessageAlternateBundleHeader">
     <bean:define id="EXPECTED_RESULTS" toScope="page">
-      Messages:
-      custom_alternate_error_header
+        Messages:
+        custom_alternate_error_header
         Message:Testing Message
     </bean:define>
 
-  <% 
-     ActionMessages messages = new ActionMessages();
-     messages.add("myproperty1", new ActionMessage("alternate.bundle.message"));
-     messages.add("myproperty2", new ActionMessage("alternate.bundle.message"));
-     request.setAttribute("my-key", messages);
-   %>
+    <%
+        ActionMessages messages = new ActionMessages();
+        messages.add("myproperty1",
+                new ActionMessage("alternate.bundle.message"));
+        messages.add("myproperty2",
+                new ActionMessage("alternate.bundle.message"));
+        request.setAttribute("my-key", messages);
+    %>
     <bean:define id="TEST_RESULTS" toScope="page">
-      Messages:
-      <html:messages id="message"  name="my-key" header="custom.alternate.errors.header" bundle="alternate" property="myproperty2">
-        Message:<bean:write name="message"/>
-      </html:messages>
+        Messages:
+        <html:messages id="message" name="my-key"
+                       header="custom.alternate.errors.header"
+                       bundle="alternate" property="myproperty2">
+            Message:<bean:write name="message"/>
+        </html:messages>
     </bean:define>
 </logic:equal>
 
-<logic:equal name="runTest" value="testMessagesNameActionMessageAlternateBundleHeaderFooter">
+<logic:equal name="runTest"
+             value="testMessagesNameActionMessageAlternateBundleHeaderFooter">
     <bean:define id="EXPECTED_RESULTS" toScope="page">
-      Messages:
-      custom_alternate_error_header
+        Messages:
+        custom_alternate_error_header
         Message:Testing Message
-      
+
         Message:Testing Message
-      custom_alternate_error_footer
+        custom_alternate_error_footer
     </bean:define>
 
-  <% 
-     ActionMessages messages = new ActionMessages();
-     messages.add("myproperty1", new ActionMessage("alternate.bundle.message"));
-     messages.add("myproperty2", new ActionMessage("alternate.bundle.message"));
-     request.setAttribute("my-key", messages);
-   %>
+    <%
+        ActionMessages messages = new ActionMessages();
+        messages.add("myproperty1",
+                new ActionMessage("alternate.bundle.message"));
+        messages.add("myproperty2",
+                new ActionMessage("alternate.bundle.message"));
+        request.setAttribute("my-key", messages);
+    %>
     <bean:define id="TEST_RESULTS" toScope="page">
-      Messages:
-      <html:messages id="message"  name="my-key" header="custom.alternate.errors.header" 
-             footer="custom.alternate.errors.footer" bundle="alternate">
-        Message:<bean:write name="message"/>
-      </html:messages>
+        Messages:
+        <html:messages id="message" name="my-key"
+                       header="custom.alternate.errors.header"
+                       footer="custom.alternate.errors.footer"
+                       bundle="alternate">
+            Message:<bean:write name="message"/>
+        </html:messages>
     </bean:define>
 </logic:equal>
 
 
-<logic:equal name="runTest" value="testMessagesNamePropertyActionMessageAlternateBundleHeaderFooter">
+<logic:equal name="runTest"
+             value="testMessagesNamePropertyActionMessageAlternateBundleHeaderFooter">
     <bean:define id="EXPECTED_RESULTS" toScope="page">
-      Messages:
-      custom_alternate_error_header
+        Messages:
+        custom_alternate_error_header
         Message:Testing Message
-      custom_alternate_error_footer
+        custom_alternate_error_footer
     </bean:define>
 
-  <% 
-     ActionMessages messages = new ActionMessages();
-     messages.add("myproperty1", new ActionMessage("alternate.bundle.message"));
-     messages.add("myproperty2", new ActionMessage("alternate.bundle.message"));
-     request.setAttribute("my-key", messages);
-   %>
+    <%
+        ActionMessages messages = new ActionMessages();
+        messages.add("myproperty1",
+                new ActionMessage("alternate.bundle.message"));
+        messages.add("myproperty2",
+                new ActionMessage("alternate.bundle.message"));
+        request.setAttribute("my-key", messages);
+    %>
     <bean:define id="TEST_RESULTS" toScope="page">
-      Messages:
-      <html:messages id="message"  name="my-key" header="custom.alternate.errors.header" 
-             footer="custom.alternate.errors.footer" bundle="alternate" property="myproperty2">
-        Message:<bean:write name="message"/>
-      </html:messages>
+        Messages:
+        <html:messages id="message" name="my-key"
+                       header="custom.alternate.errors.header"
+                       footer="custom.alternate.errors.footer"
+                       bundle="alternate" property="myproperty2">
+            Message:<bean:write name="message"/>
+        </html:messages>
     </bean:define>
 </logic:equal>
 
 
-
-
 <%
-   MessageResources messageResources  = 
-      MessageResources.getMessageResources("org.apache.struts.taglib.LocalStrings");
-
-String expected  = (String) pageContext.getAttribute("EXPECTED_RESULTS");
-String compareTo = (String) pageContext.getAttribute("TEST_RESULTS");
-
-if ((expected == null) || (compareTo == null)){
-    Assert.fail(messageResources.getMessage("tests.failure"));
-}
+    MessageResources messageResources =
+            MessageResources.getMessageResources(
+                    "org.apache.struts.taglib.LocalStrings");
+
+    String expected = (String) pageContext.getAttribute("EXPECTED_RESULTS");
+    String compareTo = (String) pageContext.getAttribute("TEST_RESULTS");
+
+    if ((expected == null) || (compareTo == null)) {
+        Assert.fail(messageResources.getMessage("tests.failure"));
+    }
 
-Assert.assertEquals(expected, compareTo);
+    Assert.assertEquals(expected, compareTo);
 %>

Modified: struts/taglib/trunk/src/webapp/org/apache/struts/taglib/html/TestMessagesTag5.jsp
URL: http://svn.apache.org/viewcvs/struts/taglib/trunk/src/webapp/org/apache/struts/taglib/html/TestMessagesTag5.jsp?rev=376852&r1=376851&r2=376852&view=diff
==============================================================================
--- struts/taglib/trunk/src/webapp/org/apache/struts/taglib/html/TestMessagesTag5.jsp (original)
+++ struts/taglib/trunk/src/webapp/org/apache/struts/taglib/html/TestMessagesTag5.jsp Fri Feb 10 13:08:44 2006
@@ -1,571 +1,637 @@
 <%@ page contentType="text/html;charset=UTF-8" language="java" %>
-<%@page import="junit.framework.Assert"%>
-<%@page import="java.util.HashMap"%>
-<%@page import="org.apache.struts.util.MessageResources"%>
-<%@page import="org.apache.struts.Globals"%>
-<%@page import="org.apache.struts.action.ActionMessage"%>
-<%@page import="org.apache.struts.action.ActionMessages"%>
-<%@page import="org.apache.struts.Globals"%>
+<%@ page import="junit.framework.Assert" %>
+<%@ page import="org.apache.struts.Globals" %>
+<%@ page import="org.apache.struts.action.ActionMessage" %>
+<%@ page import="org.apache.struts.action.ActionMessages" %>
+<%@ page import="org.apache.struts.util.MessageResources" %>
 
 <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
 <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
 <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
 
 <%
-/** 
-  * From the Docs:
-  * 
-  * <html:message>
-  * Displays a set of messages prepared by a business logic component and 
-  * stored as an ActionMessages  object, a String, or a String array in request 
-  * scope. If such a bean is not found, nothing will be rendered.
-  * 
-  * The tests are setup to test all possible scenarios with each ojbect listed.
-  * Using Globals.ERROR_KEY in the request
-  * TestMessagesTag1.jsp - uses ActionMessages to store any keys for testing
-  * TestMessagesTag2.jsp - uses a String to store any keys for testing
-  * TestMessagesTag3.jsp - uses a String Array to store any keys for testing
-  * TestMessagesTag4.jsp - uses ActionMessages to store any keys for testing
-  * 
-  * Using Globals.MESSAGE_KEY in the request
-  * TestMessagesTag5.jsp - uses ActionMessages to store any keys for testing
-  * TestMessagesTag6.jsp - uses a String to store any keys for testing
-  * TestMessagesTag7.jsp - uses a String Array to store any keys for testing
-  * TestMessagesTag8.jsp - uses ActionMessages to store any keys for testing
-  * 
-  **/
+    /**
+     * From the Docs:
+     *
+     * <html:message>
+     * Displays a set of messages prepared by a business logic component and
+     * stored as an ActionMessages  object, a String, or a String array in request
+     * scope. If such a bean is not found, nothing will be rendered.
+     *
+     * The tests are setup to test all possible scenarios with each ojbect listed.
+     * Using Globals.ERROR_KEY in the request
+     * TestMessagesTag1.jsp - uses ActionMessages to store any keys for testing
+     * TestMessagesTag2.jsp - uses a String to store any keys for testing
+     * TestMessagesTag3.jsp - uses a String Array to store any keys for testing
+     * TestMessagesTag4.jsp - uses ActionMessages to store any keys for testing
+     *
+     * Using Globals.MESSAGE_KEY in the request
+     * TestMessagesTag5.jsp - uses ActionMessages to store any keys for testing
+     * TestMessagesTag6.jsp - uses a String to store any keys for testing
+     * TestMessagesTag7.jsp - uses a String Array to store any keys for testing
+     * TestMessagesTag8.jsp - uses ActionMessages to store any keys for testing
+     *
+     **/
 %>
 
 <!-- --------Testing attributes using forward------ -->
 <logic:equal name="runTest" value="testMessages">
     <bean:define id="EXPECTED_RESULTS" toScope="page">
-      Messages:
+        Messages:
     </bean:define>
     <bean:define id="TEST_RESULTS" toScope="page">
-      Messages:
-      <html:messages id="message" message="true">
-        Message:<bean:write name="message"/>
-      </html:messages>
+        Messages:
+        <html:messages id="message" message="true">
+            Message:<bean:write name="message"/>
+        </html:messages>
     </bean:define>
 </logic:equal>
 
 
 <logic:equal name="runTest" value="testMessagesDefaultBundleEmpty">
     <bean:define id="EXPECTED_RESULTS" toScope="page">
-      Messages:
+        Messages:
     </bean:define>
-   <% 
-     ActionMessages messages = new ActionMessages();
-     request.setAttribute(Globals.MESSAGE_KEY, messages);
-   %>
-    <bean:define id="TEST_RESULTS" toScope="page">
-      Messages:
-      <html:messages id="message" message="true">
-        Message:<bean:write name="message"/>
-      </html:messages>
+    <%
+        ActionMessages messages = new ActionMessages();
+        request.setAttribute(Globals.MESSAGE_KEY, messages);
+    %>
+    <bean:define id="TEST_RESULTS" toScope="page">
+        Messages:
+        <html:messages id="message" message="true">
+            Message:<bean:write name="message"/>
+        </html:messages>
     </bean:define>
 </logic:equal>
 
 
 <logic:equal name="runTest" value="testMessagesActionMessageDefaultBundle">
     <bean:define id="EXPECTED_RESULTS" toScope="page">
-      Messages:
-      
+        Messages:
+
         Message:Testing Message
-      
+
         Message:Testing Message
     </bean:define>
 
-   <% 
-     ActionMessages messages = new ActionMessages();
-     messages.add("myproperty1", new ActionMessage("default.bundle.message"));
-     messages.add("myproperty2", new ActionMessage("default.bundle.message"));
-     request.setAttribute(Globals.MESSAGE_KEY, messages);
-   %>
+    <%
+        ActionMessages messages = new ActionMessages();
+        messages.add("myproperty1",
+                new ActionMessage("default.bundle.message"));
+        messages.add("myproperty2",
+                new ActionMessage("default.bundle.message"));
+        request.setAttribute(Globals.MESSAGE_KEY, messages);
+    %>
     <bean:define id="TEST_RESULTS" toScope="page">
-      Messages:
-      <html:messages id="message" message="true">
-        Message:<bean:write name="message"/>
-      </html:messages>
+        Messages:
+        <html:messages id="message" message="true">
+            Message:<bean:write name="message"/>
+        </html:messages>
     </bean:define>
 </logic:equal>
 
 
-<logic:equal name="runTest" value="testMessagesActionMessageDefaultBundleHeader">
+<logic:equal name="runTest"
+             value="testMessagesActionMessageDefaultBundleHeader">
     <bean:define id="EXPECTED_RESULTS" toScope="page">
-      Messages:
-      custom_error_header
+        Messages:
+        custom_error_header
         Message:Testing Message
-      
+
         Message:Testing Message
     </bean:define>
 
-  <% 
-     ActionMessages messages = new ActionMessages();
-     messages.add("myproperty1", new ActionMessage("default.bundle.message"));
-     messages.add("myproperty2", new ActionMessage("default.bundle.message"));
-     request.setAttribute(Globals.MESSAGE_KEY, messages);
-   %>
+    <%
+        ActionMessages messages = new ActionMessages();
+        messages.add("myproperty1",
+                new ActionMessage("default.bundle.message"));
+        messages.add("myproperty2",
+                new ActionMessage("default.bundle.message"));
+        request.setAttribute(Globals.MESSAGE_KEY, messages);
+    %>
     <bean:define id="TEST_RESULTS" toScope="page">
-      Messages:
-      <html:messages id="message" message="true" header="custom.errors.header">
-        Message:<bean:write name="message"/>
-      </html:messages>
+        Messages:
+        <html:messages id="message" message="true"
+                       header="custom.errors.header">
+            Message:<bean:write name="message"/>
+        </html:messages>
     </bean:define>
 </logic:equal>
 
 
-<logic:equal name="runTest" value="testMessagesActionMessageDefaultBundleHeaderFooter">
+<logic:equal name="runTest"
+             value="testMessagesActionMessageDefaultBundleHeaderFooter">
     <bean:define id="EXPECTED_RESULTS" toScope="page">
-      Messages:
-      custom_error_header
+        Messages:
+        custom_error_header
         Message:Testing Message
-      
+
         Message:Testing Message
-      custom_error_footer
+        custom_error_footer
     </bean:define>
 
-  <% 
-     ActionMessages messages = new ActionMessages();
-     messages.add("myproperty1", new ActionMessage("default.bundle.message"));
-     messages.add("myproperty2", new ActionMessage("default.bundle.message"));
-     request.setAttribute(Globals.MESSAGE_KEY, messages);
-   %>
+    <%
+        ActionMessages messages = new ActionMessages();
+        messages.add("myproperty1",
+                new ActionMessage("default.bundle.message"));
+        messages.add("myproperty2",
+                new ActionMessage("default.bundle.message"));
+        request.setAttribute(Globals.MESSAGE_KEY, messages);
+    %>
     <bean:define id="TEST_RESULTS" toScope="page">
-      Messages:
-      <html:messages id="message" message="true" header="custom.errors.header" footer="custom.errors.footer">
-        Message:<bean:write name="message"/>
-      </html:messages>
+        Messages:
+        <html:messages id="message" message="true"
+                       header="custom.errors.header"
+                       footer="custom.errors.footer">
+            Message:<bean:write name="message"/>
+        </html:messages>
     </bean:define>
 </logic:equal>
 
 
-
 <logic:equal name="runTest" value="testMessagesNameDefaultBundleEmpty">
     <bean:define id="EXPECTED_RESULTS" toScope="page">
-      Messages:
+        Messages:
     </bean:define>
 
-   <% 
-     ActionMessages messages = new ActionMessages();
-     request.setAttribute("my-key", messages);
-   %>
+    <%
+        ActionMessages messages = new ActionMessages();
+        request.setAttribute("my-key", messages);
+    %>
     <bean:define id="TEST_RESULTS" toScope="page">
-      Messages:
-      <html:messages id="message" message="true" name="my-key">
-        Message:<bean:write name="message"/>
-      </html:messages>
+        Messages:
+        <html:messages id="message" message="true" name="my-key">
+            Message:<bean:write name="message"/>
+        </html:messages>
     </bean:define>
 </logic:equal>
 
-<logic:equal name="runTest" value="testMessagesNamePropertyDefaultBundleEmpty">
+<logic:equal name="runTest"
+             value="testMessagesNamePropertyDefaultBundleEmpty">
     <bean:define id="EXPECTED_RESULTS" toScope="page">
-      Messages:
+        Messages:
     </bean:define>
 
-   <% 
-     ActionMessages messages = new ActionMessages();
-     request.setAttribute("my-key", messages);
-   %>
+    <%
+        ActionMessages messages = new ActionMessages();
+        request.setAttribute("my-key", messages);
+    %>
     <bean:define id="TEST_RESULTS" toScope="page">
-      Messages:
-      <html:messages id="message" message="true"name="my-key" property="myproperty2">
-        Message:<bean:write name="message"/>
-      </html:messages>
+        Messages:
+        <html:messages id="message" message="true" name="my-key"
+                       property="myproperty2">
+            Message:<bean:write name="message"/>
+        </html:messages>
     </bean:define>
 </logic:equal>
 
 
-
-<logic:equal name="runTest" value="testMessagesNameActionMessageDefaultBundle">
+<logic:equal name="runTest"
+             value="testMessagesNameActionMessageDefaultBundle">
     <bean:define id="EXPECTED_RESULTS" toScope="page">
-      Messages:
+        Messages:
     </bean:define>
 
-   <% 
-     ActionMessages messages = new ActionMessages();
-     messages.add("myproperty1", new ActionMessage("default.bundle.message"));
-     messages.add("myproperty2", new ActionMessage("default.bundle.message"));
-     request.setAttribute("my-key", messages);
-   %>
+    <%
+        ActionMessages messages = new ActionMessages();
+        messages.add("myproperty1",
+                new ActionMessage("default.bundle.message"));
+        messages.add("myproperty2",
+                new ActionMessage("default.bundle.message"));
+        request.setAttribute("my-key", messages);
+    %>
     <bean:define id="TEST_RESULTS" toScope="page">
-      Messages:
-      <html:messages id="message" message="true" name="my-key">
-        Message:<bean:write name="message"/>
-      </html:messages>
+        Messages:
+        <html:messages id="message" message="true" name="my-key">
+            Message:<bean:write name="message"/>
+        </html:messages>
     </bean:define>
 </logic:equal>
 
 
-
-<logic:equal name="runTest" value="testMessagesNamePropertyActionMessageDefaultBundle">
+<logic:equal name="runTest"
+             value="testMessagesNamePropertyActionMessageDefaultBundle">
     <bean:define id="EXPECTED_RESULTS" toScope="page">
-      Messages:
+        Messages:
     </bean:define>
 
-   <% 
-     ActionMessages messages = new ActionMessages();
-     messages.add("myproperty1", new ActionMessage("default.bundle.message"));
-     messages.add("myproperty2", new ActionMessage("default.bundle.message"));
-     request.setAttribute("my-key", messages);
-   %>
+    <%
+        ActionMessages messages = new ActionMessages();
+        messages.add("myproperty1",
+                new ActionMessage("default.bundle.message"));
+        messages.add("myproperty2",
+                new ActionMessage("default.bundle.message"));
+        request.setAttribute("my-key", messages);
+    %>
     <bean:define id="TEST_RESULTS" toScope="page">
-      Messages:
-      <html:messages id="message" message="true" name="my-key" property="myproperty2">
-        Message:<bean:write name="message"/>
-      </html:messages>
+        Messages:
+        <html:messages id="message" message="true" name="my-key"
+                       property="myproperty2">
+            Message:<bean:write name="message"/>
+        </html:messages>
     </bean:define>
 </logic:equal>
 
 
-
-<logic:equal name="runTest" value="testMessagesNameActionMessageDefaultBundleHeader">
+<logic:equal name="runTest"
+             value="testMessagesNameActionMessageDefaultBundleHeader">
     <bean:define id="EXPECTED_RESULTS" toScope="page">
-      Messages:
+        Messages:
     </bean:define>
 
-  <% 
-     ActionMessages messages = new ActionMessages();
-     messages.add("myproperty1", new ActionMessage("default.bundle.message"));
-     messages.add("myproperty2", new ActionMessage("default.bundle.message"));
-     request.setAttribute("my-key", messages);
-   %>
+    <%
+        ActionMessages messages = new ActionMessages();
+        messages.add("myproperty1",
+                new ActionMessage("default.bundle.message"));
+        messages.add("myproperty2",
+                new ActionMessage("default.bundle.message"));
+        request.setAttribute("my-key", messages);
+    %>
     <bean:define id="TEST_RESULTS" toScope="page">
-      Messages:
-      <html:messages id="message" message="true" name="my-key" header="custom.errors.header">
-        Message:<bean:write name="message"/>
-      </html:messages>
+        Messages:
+        <html:messages id="message" message="true" name="my-key"
+                       header="custom.errors.header">
+            Message:<bean:write name="message"/>
+        </html:messages>
     </bean:define>
 </logic:equal>
 
 
-<logic:equal name="runTest" value="testMessagesNamePropertyActionMessageDefaultBundleHeader">
+<logic:equal name="runTest"
+             value="testMessagesNamePropertyActionMessageDefaultBundleHeader">
     <bean:define id="EXPECTED_RESULTS" toScope="page">
-      Messages:
+        Messages:
     </bean:define>
 
-  <% 
-     ActionMessages messages = new ActionMessages();
-     messages.add("myproperty1", new ActionMessage("default.bundle.message"));
-     messages.add("myproperty2", new ActionMessage("default.bundle.message"));
-     request.setAttribute("my-key", messages);
-   %>
+    <%
+        ActionMessages messages = new ActionMessages();
+        messages.add("myproperty1",
+                new ActionMessage("default.bundle.message"));
+        messages.add("myproperty2",
+                new ActionMessage("default.bundle.message"));
+        request.setAttribute("my-key", messages);
+    %>
     <bean:define id="TEST_RESULTS" toScope="page">
-      Messages:
-      <html:messages id="message" message="true" name="my-key" header="custom.errors.header" property="myproperty2">
-        Message:<bean:write name="message"/>
-      </html:messages>
+        Messages:
+        <html:messages id="message" message="true" name="my-key"
+                       header="custom.errors.header" property="myproperty2">
+            Message:<bean:write name="message"/>
+        </html:messages>
     </bean:define>
 </logic:equal>
 
-<logic:equal name="runTest" value="testMessagesNameActionMessageDefaultBundleHeaderFooter">
+<logic:equal name="runTest"
+             value="testMessagesNameActionMessageDefaultBundleHeaderFooter">
     <bean:define id="EXPECTED_RESULTS" toScope="page">
-      Messages:
+        Messages:
     </bean:define>
 
-  <% 
-     ActionMessages messages = new ActionMessages();
-     messages.add("myproperty1", new ActionMessage("default.bundle.message"));
-     messages.add("myproperty2", new ActionMessage("default.bundle.message"));
-     request.setAttribute("my-key", messages);
-   %>
+    <%
+        ActionMessages messages = new ActionMessages();
+        messages.add("myproperty1",
+                new ActionMessage("default.bundle.message"));
+        messages.add("myproperty2",
+                new ActionMessage("default.bundle.message"));
+        request.setAttribute("my-key", messages);
+    %>
     <bean:define id="TEST_RESULTS" toScope="page">
-      Messages:
-      <html:messages id="message" message="true" name="my-key" header="custom.errors.header" footer="custom.errors.footer">
-        Message:<bean:write name="message"/>
-      </html:messages>
+        Messages:
+        <html:messages id="message" message="true" name="my-key"
+                       header="custom.errors.header"
+                       footer="custom.errors.footer">
+            Message:<bean:write name="message"/>
+        </html:messages>
     </bean:define>
 </logic:equal>
 
 
-<logic:equal name="runTest" value="testMessagesNamePropertyActionMessageDefaultBundleHeaderFooter">
+<logic:equal name="runTest"
+             value="testMessagesNamePropertyActionMessageDefaultBundleHeaderFooter">
     <bean:define id="EXPECTED_RESULTS" toScope="page">
-      Messages:
+        Messages:
     </bean:define>
 
-  <% 
-     ActionMessages messages = new ActionMessages();
-     messages.add("myproperty1", new ActionMessage("default.bundle.message"));
-     messages.add("myproperty2", new ActionMessage("default.bundle.message"));
-     request.setAttribute("my-key", messages);
-   %>
+    <%
+        ActionMessages messages = new ActionMessages();
+        messages.add("myproperty1",
+                new ActionMessage("default.bundle.message"));
+        messages.add("myproperty2",
+                new ActionMessage("default.bundle.message"));
+        request.setAttribute("my-key", messages);
+    %>
     <bean:define id="TEST_RESULTS" toScope="page">
-      Messages:
-      <html:messages id="message" message="true" name="my-key" header="custom.errors.header" 
-               footer="custom.errors.footer" property="myproperty2">
-        Message:<bean:write name="message"/>
-      </html:messages>
+        Messages:
+        <html:messages id="message" message="true" name="my-key"
+                       header="custom.errors.header"
+                       footer="custom.errors.footer" property="myproperty2">
+            Message:<bean:write name="message"/>
+        </html:messages>
     </bean:define>
 </logic:equal>
 
 
-
-
-
-
-
 <logic:equal name="runTest" value="testMessagesAlternateBundleEmpty">
     <bean:define id="EXPECTED_RESULTS" toScope="page">
-      Messages:
+        Messages:
     </bean:define>
 
-   <% 
-     ActionMessages messages = new ActionMessages();
-     request.setAttribute(Globals.MESSAGE_KEY, messages);
-   %>
-    <bean:define id="TEST_RESULTS" toScope="page">
-      Messages:
-      <html:messages id="message" message="true" bundle="alternate">
-        Message:<bean:write name="message"/>
-      </html:messages>
+    <%
+        ActionMessages messages = new ActionMessages();
+        request.setAttribute(Globals.MESSAGE_KEY, messages);
+    %>
+    <bean:define id="TEST_RESULTS" toScope="page">
+        Messages:
+        <html:messages id="message" message="true" bundle="alternate">
+            Message:<bean:write name="message"/>
+        </html:messages>
     </bean:define>
 </logic:equal>
 
 
 <logic:equal name="runTest" value="testMessagesActionMessageAlternateBundle">
     <bean:define id="EXPECTED_RESULTS" toScope="page">
-      Messages:
-      
+        Messages:
+
         Message:Testing Message
-      
+
         Message:Testing Message
     </bean:define>
 
-   <% 
-     ActionMessages messages = new ActionMessages();
-     messages.add("myproperty1", new ActionMessage("alternate.bundle.message"));
-     messages.add("myproperty2", new ActionMessage("alternate.bundle.message"));
-     request.setAttribute(Globals.MESSAGE_KEY, messages);
-   %>
+    <%
+        ActionMessages messages = new ActionMessages();
+        messages.add("myproperty1",
+                new ActionMessage("alternate.bundle.message"));
+        messages.add("myproperty2",
+                new ActionMessage("alternate.bundle.message"));
+        request.setAttribute(Globals.MESSAGE_KEY, messages);
+    %>
     <bean:define id="TEST_RESULTS" toScope="page">
-      Messages:
-      <html:messages id="message" message="true" bundle="alternate">
-        Message:<bean:write name="message"/>
-      </html:messages>
+        Messages:
+        <html:messages id="message" message="true" bundle="alternate">
+            Message:<bean:write name="message"/>
+        </html:messages>
     </bean:define>
 </logic:equal>
 
 
-<logic:equal name="runTest" value="testMessagesActionMessageAlternateBundleHeader">
+<logic:equal name="runTest"
+             value="testMessagesActionMessageAlternateBundleHeader">
     <bean:define id="EXPECTED_RESULTS" toScope="page">
-      Messages:
-      custom_alternate_error_header
+        Messages:
+        custom_alternate_error_header
         Message:Testing Message
-      
+
         Message:Testing Message
     </bean:define>
 
-  <% 
-     ActionMessages messages = new ActionMessages();
-     messages.add("myproperty1", new ActionMessage("alternate.bundle.message"));
-     messages.add("myproperty2", new ActionMessage("alternate.bundle.message"));
-     request.setAttribute(Globals.MESSAGE_KEY, messages);
-   %>
+    <%
+        ActionMessages messages = new ActionMessages();
+        messages.add("myproperty1",
+                new ActionMessage("alternate.bundle.message"));
+        messages.add("myproperty2",
+                new ActionMessage("alternate.bundle.message"));
+        request.setAttribute(Globals.MESSAGE_KEY, messages);
+    %>
     <bean:define id="TEST_RESULTS" toScope="page">
-      Messages:
-      <html:messages id="message" message="true" header="custom.alternate.errors.header" bundle="alternate">
-        Message:<bean:write name="message"/>
-      </html:messages>
+        Messages:
+        <html:messages id="message" message="true"
+                       header="custom.alternate.errors.header"
+                       bundle="alternate">
+            Message:<bean:write name="message"/>
+        </html:messages>
     </bean:define>
 </logic:equal>
 
 
-<logic:equal name="runTest" value="testMessagesActionMessageAlternateBundleHeaderFooter">
+<logic:equal name="runTest"
+             value="testMessagesActionMessageAlternateBundleHeaderFooter">
     <bean:define id="EXPECTED_RESULTS" toScope="page">
-      Messages:
-      custom_alternate_error_header
+        Messages:
+        custom_alternate_error_header
         Message:Testing Message
-      
+
         Message:Testing Message
-      custom_alternate_error_footer
+        custom_alternate_error_footer
     </bean:define>
 
-  <% 
-     ActionMessages messages = new ActionMessages();
-     messages.add("myproperty1", new ActionMessage("alternate.bundle.message"));
-     messages.add("myproperty2", new ActionMessage("alternate.bundle.message"));
-     request.setAttribute(Globals.MESSAGE_KEY, messages);
-   %>
+    <%
+        ActionMessages messages = new ActionMessages();
+        messages.add("myproperty1",
+                new ActionMessage("alternate.bundle.message"));
+        messages.add("myproperty2",
+                new ActionMessage("alternate.bundle.message"));
+        request.setAttribute(Globals.MESSAGE_KEY, messages);
+    %>
     <bean:define id="TEST_RESULTS" toScope="page">
-      Messages:
-      <html:messages id="message" message="true" header="custom.alternate.errors.header" 
-             footer="custom.alternate.errors.footer" bundle="alternate">
-        Message:<bean:write name="message"/>
-      </html:messages>
+        Messages:
+        <html:messages id="message" message="true"
+                       header="custom.alternate.errors.header"
+                       footer="custom.alternate.errors.footer"
+                       bundle="alternate">
+            Message:<bean:write name="message"/>
+        </html:messages>
     </bean:define>
 </logic:equal>
 
 
-
-
 <logic:equal name="runTest" value="testMessagesNameAlternateBundleEmpty">
     <bean:define id="EXPECTED_RESULTS" toScope="page">
-      Messages:
+        Messages:
     </bean:define>
 
-   <% 
-     ActionMessages messages = new ActionMessages();
-     request.setAttribute("my-key", messages);
-   %>
+    <%
+        ActionMessages messages = new ActionMessages();
+        request.setAttribute("my-key", messages);
+    %>
     <bean:define id="TEST_RESULTS" toScope="page">
-      Messages:
-      <html:messages id="message" message="true" name="my-key" bundle="alternate">
-        Message:<bean:write name="message"/>
-      </html:messages>
+        Messages:
+        <html:messages id="message" message="true" name="my-key"
+                       bundle="alternate">
+            Message:<bean:write name="message"/>
+        </html:messages>
     </bean:define>
 </logic:equal>
 
 
-<logic:equal name="runTest" value="testMessagesNamePropertyAlternateBundleEmpty">
+<logic:equal name="runTest"
+             value="testMessagesNamePropertyAlternateBundleEmpty">
     <bean:define id="EXPECTED_RESULTS" toScope="page">
-      Messages:
+        Messages:
     </bean:define>
 
-   <% 
-     ActionMessages messages = new ActionMessages();
-     request.setAttribute("my-key", messages);
-   %>
+    <%
+        ActionMessages messages = new ActionMessages();
+        request.setAttribute("my-key", messages);
+    %>
     <bean:define id="TEST_RESULTS" toScope="page">
-      Messages:
-      <html:messages id="message" message="true" name="my-key" bundle="alternate" property="myproperty2">
-        Message:<bean:write name="message"/>
-      </html:messages>
+        Messages:
+        <html:messages id="message" message="true" name="my-key"
+                       bundle="alternate" property="myproperty2">
+            Message:<bean:write name="message"/>
+        </html:messages>
     </bean:define>
 </logic:equal>
 
 
-<logic:equal name="runTest" value="testMessagesNameActionMessageAlternateBundle">
+<logic:equal name="runTest"
+             value="testMessagesNameActionMessageAlternateBundle">
     <bean:define id="EXPECTED_RESULTS" toScope="page">
-      Messages:
+        Messages:
     </bean:define>
 
-   <% 
-     ActionMessages messages = new ActionMessages();
-     messages.add("myproperty1", new ActionMessage("alternate.bundle.message"));
-     messages.add("myproperty2", new ActionMessage("alternate.bundle.message"));
-     request.setAttribute("my-key", messages);
-   %>
+    <%
+        ActionMessages messages = new ActionMessages();
+        messages.add("myproperty1",
+                new ActionMessage("alternate.bundle.message"));
+        messages.add("myproperty2",
+                new ActionMessage("alternate.bundle.message"));
+        request.setAttribute("my-key", messages);
+    %>
     <bean:define id="TEST_RESULTS" toScope="page">
-      Messages:
-      <html:messages id="message" message="true" name="my-key" bundle="alternate">
-        Message:<bean:write name="message"/>
-      </html:messages>
+        Messages:
+        <html:messages id="message" message="true" name="my-key"
+                       bundle="alternate">
+            Message:<bean:write name="message"/>
+        </html:messages>
     </bean:define>
 </logic:equal>
 
-<logic:equal name="runTest" value="testMessagesNamePropertyActionMessageAlternateBundle">
+<logic:equal name="runTest"
+             value="testMessagesNamePropertyActionMessageAlternateBundle">
     <bean:define id="EXPECTED_RESULTS" toScope="page">
-      Messages:
+        Messages:
     </bean:define>
 
-   <% 
-     ActionMessages messages = new ActionMessages();
-     messages.add("myproperty1", new ActionMessage("alternate.bundle.message"));
-     messages.add("myproperty2", new ActionMessage("alternate.bundle.message"));
-     request.setAttribute("my-key", messages);
-   %>
+    <%
+        ActionMessages messages = new ActionMessages();
+        messages.add("myproperty1",
+                new ActionMessage("alternate.bundle.message"));
+        messages.add("myproperty2",
+                new ActionMessage("alternate.bundle.message"));
+        request.setAttribute("my-key", messages);
+    %>
     <bean:define id="TEST_RESULTS" toScope="page">
-      Messages:
-      <html:messages id="message" message="true" name="my-key" bundle="alternate" property="myproperty2">
-        Message:<bean:write name="message"/>
-      </html:messages>
+        Messages:
+        <html:messages id="message" message="true" name="my-key"
+                       bundle="alternate" property="myproperty2">
+            Message:<bean:write name="message"/>
+        </html:messages>
     </bean:define>
 </logic:equal>
 
 
-<logic:equal name="runTest" value="testMessagesNameActionMessageAlternateBundleHeader">
+<logic:equal name="runTest"
+             value="testMessagesNameActionMessageAlternateBundleHeader">
     <bean:define id="EXPECTED_RESULTS" toScope="page">
-      Messages:
+        Messages:
     </bean:define>
 
-  <% 
-     ActionMessages messages = new ActionMessages();
-     messages.add("myproperty1", new ActionMessage("alternate.bundle.message"));
-     messages.add("myproperty2", new ActionMessage("alternate.bundle.message"));
-     request.setAttribute("my-key", messages);
-   %>
+    <%
+        ActionMessages messages = new ActionMessages();
+        messages.add("myproperty1",
+                new ActionMessage("alternate.bundle.message"));
+        messages.add("myproperty2",
+                new ActionMessage("alternate.bundle.message"));
+        request.setAttribute("my-key", messages);
+    %>
     <bean:define id="TEST_RESULTS" toScope="page">
-      Messages:
-      <html:messages id="message" message="true" name="my-key" header="custom.alternate.errors.header" bundle="alternate">
-        Message:<bean:write name="message"/>
-      </html:messages>
+        Messages:
+        <html:messages id="message" message="true" name="my-key"
+                       header="custom.alternate.errors.header"
+                       bundle="alternate">
+            Message:<bean:write name="message"/>
+        </html:messages>
     </bean:define>
 </logic:equal>
 
 
-<logic:equal name="runTest" value="testMessagesNamePropertyActionMessageAlternateBundleHeader">
+<logic:equal name="runTest"
+             value="testMessagesNamePropertyActionMessageAlternateBundleHeader">
     <bean:define id="EXPECTED_RESULTS" toScope="page">
-      Messages:
+        Messages:
     </bean:define>
 
-  <% 
-     ActionMessages messages = new ActionMessages();
-     messages.add("myproperty1", new ActionMessage("alternate.bundle.message"));
-     messages.add("myproperty2", new ActionMessage("alternate.bundle.message"));
-     request.setAttribute("my-key", messages);
-   %>
+    <%
+        ActionMessages messages = new ActionMessages();
+        messages.add("myproperty1",
+                new ActionMessage("alternate.bundle.message"));
+        messages.add("myproperty2",
+                new ActionMessage("alternate.bundle.message"));
+        request.setAttribute("my-key", messages);
+    %>
     <bean:define id="TEST_RESULTS" toScope="page">
-      Messages:
-      <html:messages id="message" message="true" name="my-key" header="custom.alternate.errors.header" bundle="alternate" property="myproperty2">
-        Message:<bean:write name="message"/>
-      </html:messages>
+        Messages:
+        <html:messages id="message" message="true" name="my-key"
+                       header="custom.alternate.errors.header"
+                       bundle="alternate" property="myproperty2">
+            Message:<bean:write name="message"/>
+        </html:messages>
     </bean:define>
 </logic:equal>
 
-<logic:equal name="runTest" value="testMessagesNameActionMessageAlternateBundleHeaderFooter">
+<logic:equal name="runTest"
+             value="testMessagesNameActionMessageAlternateBundleHeaderFooter">
     <bean:define id="EXPECTED_RESULTS" toScope="page">
-      Messages:
+        Messages:
     </bean:define>
 
-  <% 
-     ActionMessages messages = new ActionMessages();
-     messages.add("myproperty1", new ActionMessage("alternate.bundle.message"));
-     messages.add("myproperty2", new ActionMessage("alternate.bundle.message"));
-     request.setAttribute("my-key", messages);
-   %>
+    <%
+        ActionMessages messages = new ActionMessages();
+        messages.add("myproperty1",
+                new ActionMessage("alternate.bundle.message"));
+        messages.add("myproperty2",
+                new ActionMessage("alternate.bundle.message"));
+        request.setAttribute("my-key", messages);
+    %>
     <bean:define id="TEST_RESULTS" toScope="page">
-      Messages:
-      <html:messages id="message" message="true" name="my-key" header="custom.alternate.errors.header" 
-             footer="custom.alternate.errors.footer" bundle="alternate">
-        Message:<bean:write name="message"/>
-      </html:messages>
+        Messages:
+        <html:messages id="message" message="true" name="my-key"
+                       header="custom.alternate.errors.header"
+                       footer="custom.alternate.errors.footer"
+                       bundle="alternate">
+            Message:<bean:write name="message"/>
+        </html:messages>
     </bean:define>
 </logic:equal>
 
 
-<logic:equal name="runTest" value="testMessagesNamePropertyActionMessageAlternateBundleHeaderFooter">
+<logic:equal name="runTest"
+             value="testMessagesNamePropertyActionMessageAlternateBundleHeaderFooter">
     <bean:define id="EXPECTED_RESULTS" toScope="page">
-      Messages:
+        Messages:
     </bean:define>
 
-  <% 
-     ActionMessages messages = new ActionMessages();
-     messages.add("myproperty1", new ActionMessage("alternate.bundle.message"));
-     messages.add("myproperty2", new ActionMessage("alternate.bundle.message"));
-     request.setAttribute("my-key", messages);
-   %>
+    <%
+        ActionMessages messages = new ActionMessages();
+        messages.add("myproperty1",
+                new ActionMessage("alternate.bundle.message"));
+        messages.add("myproperty2",
+                new ActionMessage("alternate.bundle.message"));
+        request.setAttribute("my-key", messages);
+    %>
     <bean:define id="TEST_RESULTS" toScope="page">
-      Messages:
-      <html:messages id="message" message="true" name="my-key" header="custom.alternate.errors.header" 
-             footer="custom.alternate.errors.footer" bundle="alternate" property="myproperty2">
-        Message:<bean:write name="message"/>
-      </html:messages>
+        Messages:
+        <html:messages id="message" message="true" name="my-key"
+                       header="custom.alternate.errors.header"
+                       footer="custom.alternate.errors.footer"
+                       bundle="alternate" property="myproperty2">
+            Message:<bean:write name="message"/>
+        </html:messages>
     </bean:define>
 </logic:equal>
 
 
-
-
 <%
-   MessageResources messageResources  = 
-      MessageResources.getMessageResources("org.apache.struts.taglib.LocalStrings");
-
-String expected  = (String) pageContext.getAttribute("EXPECTED_RESULTS");
-String compareTo = (String) pageContext.getAttribute("TEST_RESULTS");
-
-if ((expected == null) || (compareTo == null)){
-    Assert.fail(messageResources.getMessage("tests.failure"));
-}
+    MessageResources messageResources =
+            MessageResources.getMessageResources(
+                    "org.apache.struts.taglib.LocalStrings");
+
+    String expected = (String) pageContext.getAttribute("EXPECTED_RESULTS");
+    String compareTo = (String) pageContext.getAttribute("TEST_RESULTS");
+
+    if ((expected == null) || (compareTo == null)) {
+        Assert.fail(messageResources.getMessage("tests.failure"));
+    }
 
-Assert.assertEquals(expected, compareTo);
+    Assert.assertEquals(expected, compareTo);
 %>



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Mime
View raw message