Commits

Anonymous committed 455be1c

o use ActionValidatorManagerFactory to retrieve concrete instance of ActionValidatorManager

git-svn-id: http://svn.opensymphony.com/svn/xwork/trunk@651e221344d-f017-0410-9bd5-d282ab1896d7

  • Participants
  • Parent commits 2085a1c

Comments (0)

Files changed (7)

File src/java/com/opensymphony/xwork/validator/ActionValidatorManager.java

  * @author Jason Carreira
  * @author Mark Woon
  * @author James House
+ * @author Rainer Hermanns
  */
 public class ActionValidatorManager {
 
             Validator validator = ValidatorFactory.getValidator(cfg);
             validators.add(validator);
         }
-        
+
         return validators;
     }
 
     }
 
     /**
-     * <p>This method 'collects' all the validator configurations for a given 
+     * <p>This method 'collects' all the validator configurations for a given
      * action invocation.</p>
      *
      * <p>It will traverse up the class hierarchy looking for validators for every super class
 
         return retList;
     }
-}
+}

File src/java/com/opensymphony/xwork/validator/ValidationInterceptor.java

  * </pre>
  *
  * @author Jason Carreira
+ * @author Rainer Hermanns
  * @see ActionValidatorManager
  * @see com.opensymphony.xwork.interceptor.DefaultWorkflowInterceptor
  */
                     + invocation.getProxy().getNamespace() + "/" + invocation.getProxy().getActionName() + ".");
         }
 
-        ActionValidatorManager.validate(action, context);
+        ActionValidatorManagerFactory.getInstance().validate(action, context);
     }
 }

File src/java/com/opensymphony/xwork/validator/validators/VisitorFieldValidator.java

 
 import com.opensymphony.xwork.ActionContext;
 import com.opensymphony.xwork.util.OgnlValueStack;
-import com.opensymphony.xwork.validator.ActionValidatorManager;
-import com.opensymphony.xwork.validator.DelegatingValidatorContext;
-import com.opensymphony.xwork.validator.ValidationException;
-import com.opensymphony.xwork.validator.ValidatorContext;
+import com.opensymphony.xwork.validator.*;
 
 import java.util.Collection;
 
             validatorContext = new DelegatingValidatorContext(parent, DelegatingValidatorContext.makeTextProvider(o, parent), parent);
         }
 
-        ActionValidatorManager.validate(o, visitorContext, validatorContext);
+        ActionValidatorManagerFactory.getInstance().validate(o, visitorContext, validatorContext);
         stack.pop();
     }
 

File src/test/com/opensymphony/xwork/validator/ExpressionValidatorTest.java

         ActionContext.getContext().getValueStack().push(bean);
 
         DelegatingValidatorContext context = new DelegatingValidatorContext(new ValidationAwareSupport());
-        ActionValidatorManager.validate(bean, "expressionValidation", context);
+        ActionValidatorManagerFactory.getInstance().validate(bean, "expressionValidation", context);
         assertTrue(context.hasFieldErrors());
 
         final Map fieldErrors = context.getFieldErrors();
 
         bean.setName("abcdefg");
         context = new DelegatingValidatorContext(new ValidationAwareSupport());
-        ActionValidatorManager.validate(bean, "expressionValidation", context);
+        ActionValidatorManagerFactory.getInstance().validate(bean, "expressionValidation", context);
         assertFalse(context.hasFieldErrors());
     }
 

File src/test/com/opensymphony/xwork/validator/StringValidatorTest.java

         ActionContext.getContext().getValueStack().push(equidae);
 
         DelegatingValidatorContext context = new DelegatingValidatorContext(new ValidationAwareSupport());
-        ActionValidatorManager.validate(equidae, null, context);
+        ActionValidatorManagerFactory.getInstance().validate(equidae, null, context);
 
         assertTrue(context.hasFieldErrors());
 
         equidae.setHorse("  ");
         ActionContext.getContext().getValueStack().push(equidae);
         context = new DelegatingValidatorContext(new ValidationAwareSupport());
-        ActionValidatorManager.validate(equidae, null, context);
+        ActionValidatorManagerFactory.getInstance().validate(equidae, null, context);
 
         assertTrue(context.hasFieldErrors());
         fieldErrors = context.getFieldErrors();
             ActionContext.getContext().getValueStack().push(equidae);
 
             DelegatingValidatorContext context = new DelegatingValidatorContext(new ValidationAwareSupport());
-            ActionValidatorManager.validate(equidae, null, context);
+            ActionValidatorManagerFactory.getInstance().validate(equidae, null, context);
             assertTrue(context.hasFieldErrors());
 
             Map fieldErrors = context.getFieldErrors();
             equidae.setDonkey("asdf  ");
             ActionContext.getContext().getValueStack().push(equidae);
             context = new DelegatingValidatorContext(new ValidationAwareSupport());
-            ActionValidatorManager.validate(equidae, null, context);
+            ActionValidatorManagerFactory.getInstance().validate(equidae, null, context);
             assertTrue(context.hasFieldErrors());
 
             fieldErrors = context.getFieldErrors();
             equidae.setDonkey("asdfasdf");
             ActionContext.getContext().getValueStack().push(equidae);
             context = new DelegatingValidatorContext(new ValidationAwareSupport());
-            ActionValidatorManager.validate(equidae, null, context);
+            ActionValidatorManagerFactory.getInstance().validate(equidae, null, context);
             assertTrue(context.hasFieldErrors());
 
             fieldErrors = context.getFieldErrors();
             equidae.setDonkey("asdfasdf   ");
             ActionContext.getContext().getValueStack().push(equidae);
             context = new DelegatingValidatorContext(new ValidationAwareSupport());
-            ActionValidatorManager.validate(equidae, null, context);
+            ActionValidatorManagerFactory.getInstance().validate(equidae, null, context);
             assertTrue(context.hasFieldErrors());
 
             fieldErrors = context.getFieldErrors();
             equidae.setDonkey("asdfasdfasdf");
             ActionContext.getContext().getValueStack().push(equidae);
             context = new DelegatingValidatorContext(new ValidationAwareSupport());
-            ActionValidatorManager.validate(equidae, null, context);
+            ActionValidatorManagerFactory.getInstance().validate(equidae, null, context);
             assertTrue(context.hasFieldErrors());
 
             fieldErrors = context.getFieldErrors();

File src/test/com/opensymphony/xwork/validator/VisitorFieldValidatorModelTest.java

     }
 
     public void testModelFieldErrorsAddedWithoutFieldPrefix() throws Exception {
-        ActionValidatorManager.validate(action, null);
+        ActionValidatorManagerFactory.getInstance().validate(action, null);
         assertTrue(action.hasFieldErrors());
 
         Map fieldErrors = action.getFieldErrors();
         action.setBean(bean);
         assertTrue(action.getBean() instanceof TestBean2);
 
-        ActionValidatorManager.validate(action, null);
+        ActionValidatorManagerFactory.getInstance().validate(action, null);
         assertTrue(action.hasFieldErrors());
 
         Map fieldErrors = action.getFieldErrors();

File src/test/com/opensymphony/xwork/validator/VisitorFieldValidatorTest.java

     private void validate(String context) throws ValidationException {
         ActionContext actionContext = ActionContext.getContext();
         actionContext.setName(context);
-        ActionValidatorManager.validate(action, context);
+        ActionValidatorManagerFactory.getInstance().validate(action, context);
     }
 }