struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From musa...@apache.org
Subject svn commit: r533386 - in /struts/struts2/trunk/core/src: main/java/org/apache/struts2/interceptor/validation/JSONValidationInterceptor.java test/java/org/apache/struts2/interceptor/validation/JSONValidationInterceptorTest.java
Date Sat, 28 Apr 2007 16:37:45 GMT
Author: musachy
Date: Sat Apr 28 09:37:44 2007
New Revision: 533386

URL: http://svn.apache.org/viewvc?view=rev&rev=533386
Log:
WW-1897 Create JSONValidationInterceptor

Modified:
    struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/validation/JSONValidationInterceptor.java
    struts/struts2/trunk/core/src/test/java/org/apache/struts2/interceptor/validation/JSONValidationInterceptorTest.java

Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/validation/JSONValidationInterceptor.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/validation/JSONValidationInterceptor.java?view=diff&rev=533386&r1=533385&r2=533386
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/validation/JSONValidationInterceptor.java
(original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/validation/JSONValidationInterceptor.java
Sat Apr 28 09:37:44 2007
@@ -80,11 +80,13 @@
                     response.setStatus(validationFailedStatus);
                 response.getWriter().print(buildResponse(validationAware));
                 return Action.NONE;
-            }
+            } 
         }
 
         String validateOnly = request.getParameter("validateOnly");
         if (validateOnly != null && "true".equals(validateOnly)) {
+            //there were no errors
+            response.getWriter().print("/* {} */");
             return Action.NONE;
         } else {
             return invocation.invoke();

Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/interceptor/validation/JSONValidationInterceptorTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/interceptor/validation/JSONValidationInterceptorTest.java?view=diff&rev=533386&r1=533385&r2=533386
==============================================================================
--- struts/struts2/trunk/core/src/test/java/org/apache/struts2/interceptor/validation/JSONValidationInterceptorTest.java
(original)
+++ struts/struts2/trunk/core/src/test/java/org/apache/struts2/interceptor/validation/JSONValidationInterceptorTest.java
Sat Apr 28 09:37:44 2007
@@ -104,7 +104,7 @@
         String json = stringWriter.toString();
 
         String normalizedActual = TestUtils.normalize(json, true);
-        assertEquals("", normalizedActual);
+        assertEquals("/*{}*/", normalizedActual);
         assertFalse(invocation.isExecuted());
     }
 



Mime
View raw message