Author: craigmcc
Date: Mon Jun 26 15:36:38 2006
New Revision: 417306

URL: http://svn.apache.org/viewvc?rev=417306&view=rev
Log:
Fix issue SHALE-182 (token tag would not allow resubmit after validation
error was corrected).  Re-enable the system integration test that verifies
this behavior.

Modified:
    
struts/shale/trunk/shale-apps/shale-usecases/src/test/java/org/apache/shale/usecases/systest/TokenTestCase.java
    
struts/shale/trunk/shale-core/src/main/java/org/apache/shale/component/Token.java

Modified: 
struts/shale/trunk/shale-apps/shale-usecases/src/test/java/org/apache/shale/usecases/systest/TokenTestCase.java
URL: 
http://svn.apache.org/viewvc/struts/shale/trunk/shale-apps/shale-usecases/src/test/java/org/apache/shale/usecases/systest/TokenTestCase.java?rev=417306&r1=417305&r2=417306&view=diff
==============================================================================
--- 
struts/shale/trunk/shale-apps/shale-usecases/src/test/java/org/apache/shale/usecases/systest/TokenTestCase.java
 (original)
+++ 
struts/shale/trunk/shale-apps/shale-usecases/src/test/java/org/apache/shale/usecases/systest/TokenTestCase.java
 Mon Jun 26 15:36:38 2006
@@ -218,7 +218,6 @@
         submit(submit);
 
         // Verify that we were returned to the main menu
-/* FIXME - Comment out remaining assertions due to SHALE-182 until it is fixed
         assertEquals("Shale Framework Use Cases", title());
 
         // Restore the saved page and submit it again
@@ -240,7 +239,6 @@
         assertNotNull(message);
 // FIXME - for some reason the text is not displayed???  MyFaces issue???
 //        assertTrue(message.asText().contains("Invalid resubmit of the same 
form"));
-*/
 
     }
 

Modified: 
struts/shale/trunk/shale-core/src/main/java/org/apache/shale/component/Token.java
URL: 
http://svn.apache.org/viewvc/struts/shale/trunk/shale-core/src/main/java/org/apache/shale/component/Token.java?rev=417306&r1=417305&r2=417306&view=diff
==============================================================================
--- 
struts/shale/trunk/shale-core/src/main/java/org/apache/shale/component/Token.java
 (original)
+++ 
struts/shale/trunk/shale-core/src/main/java/org/apache/shale/component/Token.java
 Mon Jun 26 15:36:38 2006
@@ -162,6 +162,18 @@
      */
     public void validate(FacesContext context) {
 
+        // If any of the other input components in this form triggered
+        // validation errors, we do NOT want to validate the token component
+        // here, because that would erase the saved token and prevent the
+        // subsequent valid resubmit from succeeding.
+        //
+        // WARNING - for this test to be successful, the token component must
+        // be the last input component child of the parent form to be
+        // processed
+        if (context.getMaximumSeverity() != null) {
+            return;
+        }
+
         super.validate(context);
         String token = (String) getValue();
         if (log.isDebugEnabled()) {


Reply via email to