struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lukaszlen...@apache.org
Subject [07/17] struts git commit: Updates test
Date Mon, 13 Mar 2017 17:46:16 GMT
Updates test


Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/3dc84809
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/3dc84809
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/3dc84809

Branch: refs/heads/master
Commit: 3dc8480988f38f367f9965bad0ff60656d091fa9
Parents: d7cf060
Author: Lukasz Lenart <lukaszlenart@apache.org>
Authored: Fri Mar 10 09:20:57 2017 +0100
Committer: Lukasz Lenart <lukaszlenart@apache.org>
Committed: Fri Mar 10 09:20:57 2017 +0100

----------------------------------------------------------------------
 .../AnnotationActionValidatorManagerTest.java   | 20 +++++++++-------
 .../ConversionErrorFieldValidatorTest.java      |  5 ++--
 .../validator/DoubleRangeValidatorTest.java     | 12 ++++++----
 .../xwork2/validator/EmailValidatorTest.java    | 13 ++++++++--
 .../validator/ExpressionValidatorTest.java      | 10 +++++---
 .../validator/RegexFieldValidatorTest.java      | 20 +++++++++++-----
 ...onversionErrorFieldValidatorSupportTest.java | 11 +++++----
 .../validator/SimpleActionValidationTest.java   |  2 +-
 .../StringLengthFieldValidatorTest.java         |  3 ++-
 .../xwork2/validator/StringValidatorTest.java   | 21 +++++++++-------
 .../xwork2/validator/URLValidatorTest.java      | 15 +++++++-----
 .../AppendingValidatorContextTest.java          | 25 ++++++++++++++++----
 .../validators/DateRangeFieldValidatorTest.java | 10 +++++---
 .../validators/IntRangeFieldValidatorTest.java  | 14 ++++++++---
 .../validators/LongRangeFieldValidatorTest.java | 14 ++++++++---
 .../validators/RequiredStringValidatorTest.java | 12 ++++++++--
 .../ShortRangeFieldValidatorTest.java           | 14 ++++++++---
 17 files changed, 155 insertions(+), 66 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/3dc84809/core/src/test/java/com/opensymphony/xwork2/validator/AnnotationActionValidatorManagerTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/com/opensymphony/xwork2/validator/AnnotationActionValidatorManagerTest.java b/core/src/test/java/com/opensymphony/xwork2/validator/AnnotationActionValidatorManagerTest.java
index 7111150..10936f8 100644
--- a/core/src/test/java/com/opensymphony/xwork2/validator/AnnotationActionValidatorManagerTest.java
+++ b/core/src/test/java/com/opensymphony/xwork2/validator/AnnotationActionValidatorManagerTest.java
@@ -24,6 +24,7 @@ import com.opensymphony.xwork2.FileManager;
 import com.opensymphony.xwork2.FileManagerFactory;
 import com.opensymphony.xwork2.SimpleAction;
 import com.opensymphony.xwork2.SimpleAnnotationAction;
+import com.opensymphony.xwork2.TextProviderFactory;
 import com.opensymphony.xwork2.XWorkTestCase;
 import com.opensymphony.xwork2.config.entities.ActionConfig;
 import com.opensymphony.xwork2.test.AnnotationDataAware2;
@@ -58,6 +59,7 @@ public class AnnotationActionValidatorManagerTest extends XWorkTestCase {
     protected final String alias = "annotationValidationAlias";
 
     AnnotationActionValidatorManager annotationActionValidatorManager;
+    private TextProviderFactory tpf;
 
     @Override protected void setUp() throws Exception {
         super.setUp();
@@ -78,6 +80,8 @@ public class AnnotationActionValidatorManagerTest extends XWorkTestCase {
         EasyMock.replay(proxy);
 
         ActionContext.getContext().setActionInvocation(invocation);
+
+        tpf = container.getInstance(TextProviderFactory.class);
     }
 
     @Override protected void tearDown() throws Exception {
@@ -124,7 +128,7 @@ public class AnnotationActionValidatorManagerTest extends XWorkTestCase {
             bean.setName("foo");
             bean.setCount(99);
 
-            ValidatorContext context = new GenericValidatorContext(bean);
+            ValidatorContext context = new GenericValidatorContext(bean, tpf);
             annotationActionValidatorManager.validate(bean, "beanMessageBundle", context);
             assertTrue(context.hasErrors());
             assertTrue(context.hasFieldErrors());
@@ -252,7 +256,7 @@ public class AnnotationActionValidatorManagerTest extends XWorkTestCase {
             bean.setName("foo");
             bean.setCount(150);
 
-            ValidatorContext context = new GenericValidatorContext(bean);
+            ValidatorContext context = new GenericValidatorContext(bean, tpf);
             annotationActionValidatorManager.validate(bean, "beanMessageBundle", context);
             assertTrue(context.hasErrors());
             assertTrue(context.hasFieldErrors());
@@ -290,7 +294,7 @@ public class AnnotationActionValidatorManagerTest extends XWorkTestCase {
             user.setEmail("bad_email");
             user.setEmail2("bad_email");
 
-            ValidatorContext context = new GenericValidatorContext(user);
+            ValidatorContext context = new GenericValidatorContext(user, tpf);
             annotationActionValidatorManager.validate(user, null, context);
             assertTrue(context.hasFieldErrors());
 
@@ -332,13 +336,13 @@ public class AnnotationActionValidatorManagerTest extends XWorkTestCase {
             user.setEmail("mark_bad_email_for_field_val@foo.com");
             user.setEmail2("mark_bad_email_for_field_val@foo.com");
 
-            ValidatorContext context = new GenericValidatorContext(user);
+            ValidatorContext context = new GenericValidatorContext(user, tpf);
             annotationActionValidatorManager.validate(user, null, context);
             assertTrue(context.hasFieldErrors());
 
             // check field errors
             // we have an error in this field level, email does not ends with mycompany.com
-            List l = (List) context.getFieldErrors().get("email");
+            List l = context.getFieldErrors().get("email");
             assertNotNull(l);
             assertEquals(1, l.size()); // because email-field-val is short-circuit
             assertEquals("Email not from the right company.", l.get(0));
@@ -370,12 +374,12 @@ public class AnnotationActionValidatorManagerTest extends XWorkTestCase {
         user.setEmail("rainer_h(at)example.com");
 
 
-        ValidatorContext context = new GenericValidatorContext(user);
+        ValidatorContext context = new GenericValidatorContext(user, tpf);
         annotationActionValidatorManager.validate(user, null, context);
     	
     	// check field level errors
         // shouldn't have any because action error prevents validation of anything else
-        List l = (List) context.getFieldErrors().get("email2");
+        List l = context.getFieldErrors().get("email2");
         assertNull(l);
     	
     	
@@ -401,7 +405,7 @@ public class AnnotationActionValidatorManagerTest extends XWorkTestCase {
             user.setEmail("mark@mycompany.com");
             user.setEmail2("mark@mycompany.com");
 
-            ValidatorContext context = new GenericValidatorContext(user);
+            ValidatorContext context = new GenericValidatorContext(user, tpf);
             annotationActionValidatorManager.validate(user, null, context);
             assertFalse(context.hasErrors());
         } catch (ValidationException ex) {

http://git-wip-us.apache.org/repos/asf/struts/blob/3dc84809/core/src/test/java/com/opensymphony/xwork2/validator/ConversionErrorFieldValidatorTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/com/opensymphony/xwork2/validator/ConversionErrorFieldValidatorTest.java b/core/src/test/java/com/opensymphony/xwork2/validator/ConversionErrorFieldValidatorTest.java
index d686131..8182d77 100644
--- a/core/src/test/java/com/opensymphony/xwork2/validator/ConversionErrorFieldValidatorTest.java
+++ b/core/src/test/java/com/opensymphony/xwork2/validator/ConversionErrorFieldValidatorTest.java
@@ -16,6 +16,7 @@
 package com.opensymphony.xwork2.validator;
 
 import com.opensymphony.xwork2.ActionContext;
+import com.opensymphony.xwork2.TextProviderFactory;
 import com.opensymphony.xwork2.interceptor.ValidationAware;
 import com.opensymphony.xwork2.ValidationAwareSupport;
 import com.opensymphony.xwork2.XWorkTestCase;
@@ -37,11 +38,9 @@ public class ConversionErrorFieldValidatorTest extends XWorkTestCase {
 
     private static final String defaultFooMessage = "Invalid field value for field \"foo\".";
 
-
     private ConversionErrorFieldValidator validator;
     private ValidationAware validationAware;
 
-
     @Override
     public void setUp() throws Exception {
         super.setUp();
@@ -54,7 +53,7 @@ public class ConversionErrorFieldValidatorTest extends XWorkTestCase {
         validator = new ConversionErrorFieldValidator();
         validationAware = new ValidationAwareSupport();
 
-        DelegatingValidatorContext validatorContext = new DelegatingValidatorContext(validationAware);
+        DelegatingValidatorContext validatorContext = new DelegatingValidatorContext(validationAware, container.inject(TextProviderFactory.class));
         stack.push(validatorContext);
         validator.setValidatorContext(validatorContext);
         validator.setFieldName("foo");

http://git-wip-us.apache.org/repos/asf/struts/blob/3dc84809/core/src/test/java/com/opensymphony/xwork2/validator/DoubleRangeValidatorTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/com/opensymphony/xwork2/validator/DoubleRangeValidatorTest.java b/core/src/test/java/com/opensymphony/xwork2/validator/DoubleRangeValidatorTest.java
index 64e4c2c..3f75a14 100644
--- a/core/src/test/java/com/opensymphony/xwork2/validator/DoubleRangeValidatorTest.java
+++ b/core/src/test/java/com/opensymphony/xwork2/validator/DoubleRangeValidatorTest.java
@@ -21,6 +21,7 @@ import java.util.Map;
  */
 public class DoubleRangeValidatorTest extends XWorkTestCase {
     private DoubleRangeFieldValidator val;
+    private TextProviderFactory tpf;
 
     public void testRangeValidationWithError() throws Exception {
         //Explicitly set an out-of-range double for DoubleRangeValidatorTest
@@ -107,7 +108,7 @@ public class DoubleRangeValidatorTest extends XWorkTestCase {
         val.setMaxInclusive(10d);
         val.setFieldName("name");
 
-        DelegatingValidatorContext context = new DelegatingValidatorContext(new ValidationAwareSupport());
+        DelegatingValidatorContext context = new DelegatingValidatorContext(new ValidationAwareSupport(), tpf);
         val.setValidatorContext(context);
 
         val.validate(prod);
@@ -127,7 +128,7 @@ public class DoubleRangeValidatorTest extends XWorkTestCase {
 
         val.setFieldName("price");
 
-        DelegatingValidatorContext context = new DelegatingValidatorContext(new ValidationAwareSupport());
+        DelegatingValidatorContext context = new DelegatingValidatorContext(new ValidationAwareSupport(), tpf);
         val.setValidatorContext(context);
 
         val.setMaxInclusive(9.95d);
@@ -152,7 +153,7 @@ public class DoubleRangeValidatorTest extends XWorkTestCase {
 
         val.setFieldName("price");
 
-        DelegatingValidatorContext context = new DelegatingValidatorContext(new ValidationAwareSupport());
+        DelegatingValidatorContext context = new DelegatingValidatorContext(new ValidationAwareSupport(), tpf);
         val.setValidatorContext(context);
 
         val.setMinInclusive(9.95d);
@@ -170,7 +171,7 @@ public class DoubleRangeValidatorTest extends XWorkTestCase {
 
         val.setFieldName("price");
 
-        DelegatingValidatorContext context = new DelegatingValidatorContext(new ValidationAwareSupport());
+        DelegatingValidatorContext context = new DelegatingValidatorContext(new ValidationAwareSupport(), tpf);
         val.setValidatorContext(context);
 
         val.setMinInclusive(9.95d);
@@ -220,7 +221,7 @@ public class DoubleRangeValidatorTest extends XWorkTestCase {
         val.setFieldName("price");
         val.setDefaultMessage("Price is wrong!");
 
-        DelegatingValidatorContext context = new DelegatingValidatorContext(action);
+        DelegatingValidatorContext context = new DelegatingValidatorContext(action, tpf);
         val.setValidatorContext(context);
 
         val.validate(action);
@@ -236,6 +237,7 @@ public class DoubleRangeValidatorTest extends XWorkTestCase {
         val = new DoubleRangeFieldValidator();
         val.setValueStack(ActionContext.getContext().getValueStack());
         ActionContext.getContext().setParameters(HttpParameters.create().build());
+        tpf = container.inject(TextProviderFactory.class);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/struts/blob/3dc84809/core/src/test/java/com/opensymphony/xwork2/validator/EmailValidatorTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/com/opensymphony/xwork2/validator/EmailValidatorTest.java b/core/src/test/java/com/opensymphony/xwork2/validator/EmailValidatorTest.java
index 721ce08..ae8c036 100644
--- a/core/src/test/java/com/opensymphony/xwork2/validator/EmailValidatorTest.java
+++ b/core/src/test/java/com/opensymphony/xwork2/validator/EmailValidatorTest.java
@@ -17,6 +17,7 @@ package com.opensymphony.xwork2.validator;
 
 import com.opensymphony.xwork2.ActionContext;
 import com.opensymphony.xwork2.ActionSupport;
+import com.opensymphony.xwork2.TextProviderFactory;
 import com.opensymphony.xwork2.XWorkTestCase;
 import com.opensymphony.xwork2.util.ValueStack;
 import com.opensymphony.xwork2.validator.validators.EmailValidator;
@@ -29,6 +30,8 @@ import com.opensymphony.xwork2.validator.validators.EmailValidator;
  */
 public class EmailValidatorTest extends XWorkTestCase {
 
+    private TextProviderFactory tpf;
+
     public void testEmailValidity() throws Exception {
         assertTrue(verifyEmailValidity("TmJee@Yahoo.com"));
         assertTrue(verifyEmailValidity("tmjee@yahoo.com"));
@@ -70,7 +73,7 @@ public class EmailValidatorTest extends XWorkTestCase {
         };
 
         EmailValidator validator = new EmailValidator();
-        validator.setValidatorContext(new DelegatingValidatorContext(action));
+        validator.setValidatorContext(new DelegatingValidatorContext(action, tpf));
         validator.setFieldName("myEmail");
         validator.setDefaultMessage("invalid email");
         validator.setValueStack(ActionContext.getContext().getValueStack());
@@ -95,7 +98,7 @@ public class EmailValidatorTest extends XWorkTestCase {
         valueStack.push(action);
         validator.setValueStack(valueStack);
 
-        validator.setValidatorContext(new DelegatingValidatorContext(action));
+        validator.setValidatorContext(new DelegatingValidatorContext(action, tpf));
         validator.setFieldName("myEmail");
         validator.setDefaultMessage("invalid email");
         validator.setRegexExpression("${emailExpression}");
@@ -155,4 +158,10 @@ public class EmailValidatorTest extends XWorkTestCase {
         return validator;
     }
 
+    @Override
+    public void setUp() throws Exception {
+        super.setUp();
+
+        tpf = container.inject(TextProviderFactory.class);
+    }
 }

http://git-wip-us.apache.org/repos/asf/struts/blob/3dc84809/core/src/test/java/com/opensymphony/xwork2/validator/ExpressionValidatorTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/com/opensymphony/xwork2/validator/ExpressionValidatorTest.java b/core/src/test/java/com/opensymphony/xwork2/validator/ExpressionValidatorTest.java
index 3ae8076..30613a4 100644
--- a/core/src/test/java/com/opensymphony/xwork2/validator/ExpressionValidatorTest.java
+++ b/core/src/test/java/com/opensymphony/xwork2/validator/ExpressionValidatorTest.java
@@ -38,12 +38,14 @@ import java.util.Map;
  */
 public class ExpressionValidatorTest extends XWorkTestCase {
 
+    private TextProviderFactory tpf;
+
     public void testExpressionValidationOfStringLength() throws ValidationException {
         TestBean bean = new TestBean();
         bean.setName("abc");
         ActionContext.getContext().getValueStack().push(bean);
 
-        DelegatingValidatorContext context = new DelegatingValidatorContext(new ValidationAwareSupport());
+        DelegatingValidatorContext context = new DelegatingValidatorContext(new ValidationAwareSupport(), tpf);
         container.getInstance(ActionValidatorManager.class).validate(bean, "expressionValidation", context);
         assertTrue(context.hasFieldErrors());
 
@@ -55,7 +57,7 @@ public class ExpressionValidatorTest extends XWorkTestCase {
         assertEquals("Name must be greater than 5 characters, it is currently 'abc'", nameErrors.get(0));
 
         bean.setName("abcdefg");
-        context = new DelegatingValidatorContext(new ValidationAwareSupport());
+        context = new DelegatingValidatorContext(new ValidationAwareSupport(), tpf);
         container.getInstance(ActionValidatorManager.class).validate(bean, "expressionValidation", context);
         assertFalse(context.hasFieldErrors());
     }
@@ -108,7 +110,7 @@ public class ExpressionValidatorTest extends XWorkTestCase {
         mock.expect("addActionError", C.ANY_ARGS);
 
         ExpressionValidator ev = new ExpressionValidator();
-        ev.setValidatorContext(new DelegatingValidatorContext(mock.proxy()));
+        ev.setValidatorContext(new DelegatingValidatorContext(mock.proxy(), tpf));
         ev.setExpression("{top}");
         ev.setValueStack(ActionContext.getContext().getValueStack());
         ev.validate("Hello"); // {top} will evaluate to Hello that is not a Boolean
@@ -136,6 +138,8 @@ public class ExpressionValidatorTest extends XWorkTestCase {
         EasyMock.replay(proxy);
 
         ActionContext.getContext().setActionInvocation(invocation);
+
+        tpf = container.inject(TextProviderFactory.class);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/struts/blob/3dc84809/core/src/test/java/com/opensymphony/xwork2/validator/RegexFieldValidatorTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/com/opensymphony/xwork2/validator/RegexFieldValidatorTest.java b/core/src/test/java/com/opensymphony/xwork2/validator/RegexFieldValidatorTest.java
index 6aa5873..bbb9588 100644
--- a/core/src/test/java/com/opensymphony/xwork2/validator/RegexFieldValidatorTest.java
+++ b/core/src/test/java/com/opensymphony/xwork2/validator/RegexFieldValidatorTest.java
@@ -16,6 +16,7 @@
 package com.opensymphony.xwork2.validator;
 
 import com.opensymphony.xwork2.ActionContext;
+import com.opensymphony.xwork2.TextProviderFactory;
 import com.opensymphony.xwork2.XWorkTestCase;
 import com.opensymphony.xwork2.util.ValueStack;
 import com.opensymphony.xwork2.validator.validators.RegexFieldValidator;
@@ -36,6 +37,13 @@ import java.util.List;
  */
 public class RegexFieldValidatorTest extends XWorkTestCase {
 
+    private TextProviderFactory tpf;
+
+    public void setUp() throws Exception {
+        super.setUp();
+        tpf = container.inject(TextProviderFactory.class);
+    }
+
     public void testMatch() throws Exception {
         MyTestPerson testPerson = new MyTestPerson();
         testPerson.setUsername("Secret");
@@ -45,7 +53,7 @@ public class RegexFieldValidatorTest extends XWorkTestCase {
 
         RegexFieldValidator validator = new RegexFieldValidator();
         validator.setRegex("^Sec.*");
-        validator.setValidatorContext(new GenericValidatorContext(new Object()));
+        validator.setValidatorContext(new GenericValidatorContext(new Object(), tpf));
         validator.setFieldName("username");
         validator.setValueStack(ActionContext.getContext().getValueStack());
         validator.validate(testPerson);
@@ -66,7 +74,7 @@ public class RegexFieldValidatorTest extends XWorkTestCase {
         RegexFieldValidator validator = new RegexFieldValidator();
         validator.setTrim(false);
         validator.setRegex("^Sec.*\\s");
-        validator.setValidatorContext(new GenericValidatorContext(new Object()));
+        validator.setValidatorContext(new GenericValidatorContext(new Object(), tpf));
         validator.setFieldName("username");
         validator.setValueStack(ActionContext.getContext().getValueStack());
         validator.validate(testPerson);
@@ -86,7 +94,7 @@ public class RegexFieldValidatorTest extends XWorkTestCase {
 
         RegexFieldValidator validator = new RegexFieldValidator();
         validator.setRegex("^Sec.*");
-        validator.setValidatorContext(new GenericValidatorContext(new Object()));
+        validator.setValidatorContext(new GenericValidatorContext(new Object(), tpf));
         validator.setFieldName("username");
         validator.setValueStack(ActionContext.getContext().getValueStack());
         validator.validate(testPerson);
@@ -111,7 +119,7 @@ public class RegexFieldValidatorTest extends XWorkTestCase {
 
         RegexFieldValidator validator = new RegexFieldValidator();
         validator.setRegex("^Sec.*");
-        validator.setValidatorContext(new GenericValidatorContext(new Object()));
+        validator.setValidatorContext(new GenericValidatorContext(new Object(), tpf));
         validator.setFieldName(null);
         validator.setValueStack(ActionContext.getContext().getValueStack());
         validator.validate(testPerson);
@@ -144,7 +152,7 @@ public class RegexFieldValidatorTest extends XWorkTestCase {
 
         RegexFieldValidator validator = new RegexFieldValidator();
         validator.setRegex("^Sec.*");
-        validator.setValidatorContext(new GenericValidatorContext(new Object()));
+        validator.setValidatorContext(new GenericValidatorContext(new Object(), tpf));
         validator.setFieldName("username");
         validator.setValueStack(ActionContext.getContext().getValueStack());
         validator.validate(testPerson);
@@ -164,7 +172,7 @@ public class RegexFieldValidatorTest extends XWorkTestCase {
 
         RegexFieldValidator validator = new RegexFieldValidator();
         validator.setRegex("[0-9][0-9]");
-        validator.setValidatorContext(new GenericValidatorContext(new Object()));
+        validator.setValidatorContext(new GenericValidatorContext(new Object(), tpf));
         validator.setFieldName("age");
         validator.setValueStack(ActionContext.getContext().getValueStack());
         validator.validate(testPerson);

http://git-wip-us.apache.org/repos/asf/struts/blob/3dc84809/core/src/test/java/com/opensymphony/xwork2/validator/RepopulateConversionErrorFieldValidatorSupportTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/com/opensymphony/xwork2/validator/RepopulateConversionErrorFieldValidatorSupportTest.java b/core/src/test/java/com/opensymphony/xwork2/validator/RepopulateConversionErrorFieldValidatorSupportTest.java
index 308ed2a..c4aa178 100644
--- a/core/src/test/java/com/opensymphony/xwork2/validator/RepopulateConversionErrorFieldValidatorSupportTest.java
+++ b/core/src/test/java/com/opensymphony/xwork2/validator/RepopulateConversionErrorFieldValidatorSupportTest.java
@@ -17,6 +17,7 @@ package com.opensymphony.xwork2.validator;
 
 import com.opensymphony.xwork2.ActionContext;
 import com.opensymphony.xwork2.ActionSupport;
+import com.opensymphony.xwork2.TextProviderFactory;
 import com.opensymphony.xwork2.XWorkTestCase;
 import com.opensymphony.xwork2.mock.MockActionInvocation;
 import com.opensymphony.xwork2.util.ValueStack;
@@ -90,17 +91,19 @@ public class RepopulateConversionErrorFieldValidatorSupportTest extends XWorkTes
 		Map<String, Object> conversionErrors = ActionContext.getContext().getConversionErrors();
 		conversionErrors.put("someFieldName", conversionErrorValue);
 		conversionErrors.put("xxxsomeFieldName", conversionErrorValue);
-		
-		action = new ActionSupport();
+
+		TextProviderFactory tpf = container.inject(TextProviderFactory.class);
+
+		action = container.inject(ActionSupport.class);
 		validator1 = 
 			new InternalRepopulateConversionErrorFieldValidatorSupport();
 		validator1.setFieldName("someFieldName");
-		validator1.setValidatorContext(new DelegatingValidatorContext(action));
+		validator1.setValidatorContext(new DelegatingValidatorContext(action, tpf));
 		
 		validator2 = 
 			new InternalRepopulateConversionErrorFieldValidatorSupport();
 		validator2.setFieldName("someFieldName");
-		validator2.setValidatorContext(new DelegatingValidatorContext(action) {
+		validator2.setValidatorContext(new DelegatingValidatorContext(action, tpf) {
 			@Override
             public String getFullFieldName(String fieldName) {
 				return "xxx"+fieldName;

http://git-wip-us.apache.org/repos/asf/struts/blob/3dc84809/core/src/test/java/com/opensymphony/xwork2/validator/SimpleActionValidationTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/com/opensymphony/xwork2/validator/SimpleActionValidationTest.java b/core/src/test/java/com/opensymphony/xwork2/validator/SimpleActionValidationTest.java
index 3365715..991a75e 100644
--- a/core/src/test/java/com/opensymphony/xwork2/validator/SimpleActionValidationTest.java
+++ b/core/src/test/java/com/opensymphony/xwork2/validator/SimpleActionValidationTest.java
@@ -153,7 +153,7 @@ public class SimpleActionValidationTest extends XWorkTestCase {
         SimpleAction action = new SimpleAction();
         container.inject(action);
 
-        ValidatorContext validatorContext = new DelegatingValidatorContext(action);
+        ValidatorContext validatorContext = new DelegatingValidatorContext(action, container.inject(TextProviderFactory.class));
         validator.setValidatorContext(validatorContext);
         validator.validate(this);
         assertTrue(validatorContext.hasActionErrors());

http://git-wip-us.apache.org/repos/asf/struts/blob/3dc84809/core/src/test/java/com/opensymphony/xwork2/validator/StringLengthFieldValidatorTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/com/opensymphony/xwork2/validator/StringLengthFieldValidatorTest.java b/core/src/test/java/com/opensymphony/xwork2/validator/StringLengthFieldValidatorTest.java
index b8cf182..884d495 100644
--- a/core/src/test/java/com/opensymphony/xwork2/validator/StringLengthFieldValidatorTest.java
+++ b/core/src/test/java/com/opensymphony/xwork2/validator/StringLengthFieldValidatorTest.java
@@ -17,6 +17,7 @@ package com.opensymphony.xwork2.validator;
 
 import com.opensymphony.xwork2.ActionContext;
 import com.opensymphony.xwork2.ActionSupport;
+import com.opensymphony.xwork2.TextProviderFactory;
 import com.opensymphony.xwork2.XWorkTestCase;
 import com.opensymphony.xwork2.util.ValueStack;
 import com.opensymphony.xwork2.validator.validators.StringLengthFieldValidator;
@@ -162,7 +163,7 @@ public class StringLengthFieldValidatorTest extends XWorkTestCase {
 		validator = new StringLengthFieldValidator();
 		validator.setFieldName("myField");
 		validator.setMessageKey("error");
-		validator.setValidatorContext(new DelegatingValidatorContext(action));
+		validator.setValidatorContext(new DelegatingValidatorContext(action, container.inject(TextProviderFactory.class)));
 		validator.setMaxLength(5);
 		validator.setMinLength(2);
         validator.setValueStack(valueStack);

http://git-wip-us.apache.org/repos/asf/struts/blob/3dc84809/core/src/test/java/com/opensymphony/xwork2/validator/StringValidatorTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/com/opensymphony/xwork2/validator/StringValidatorTest.java b/core/src/test/java/com/opensymphony/xwork2/validator/StringValidatorTest.java
index 9742b5a..c737d97 100644
--- a/core/src/test/java/com/opensymphony/xwork2/validator/StringValidatorTest.java
+++ b/core/src/test/java/com/opensymphony/xwork2/validator/StringValidatorTest.java
@@ -19,6 +19,7 @@ import com.opensymphony.xwork2.Action;
 import com.opensymphony.xwork2.ActionContext;
 import com.opensymphony.xwork2.ActionInvocation;
 import com.opensymphony.xwork2.ActionProxy;
+import com.opensymphony.xwork2.TextProviderFactory;
 import com.opensymphony.xwork2.ValidationAwareSupport;
 import com.opensymphony.xwork2.XWorkTestCase;
 import com.opensymphony.xwork2.config.entities.ActionConfig;
@@ -36,11 +37,13 @@ import java.util.Map;
  */
 public class StringValidatorTest extends XWorkTestCase {
 
+    private TextProviderFactory tpf;
+
     public void testRequiredStringWithNullValue() throws Exception {
         Equidae equidae = new Equidae();
         equidae.setHorse(null);
 
-        DelegatingValidatorContext context = new DelegatingValidatorContext(new ValidationAwareSupport());
+        DelegatingValidatorContext context = new DelegatingValidatorContext(new ValidationAwareSupport(), tpf);
         container.getInstance(ActionValidatorManager.class).validate(equidae, null, context);
 
         assertTrue(context.hasFieldErrors());
@@ -54,7 +57,7 @@ public class StringValidatorTest extends XWorkTestCase {
         equidae.setHorse("");
         ActionContext.getContext().getValueStack().push(equidae);
 
-        DelegatingValidatorContext context = new DelegatingValidatorContext(new ValidationAwareSupport());
+        DelegatingValidatorContext context = new DelegatingValidatorContext(new ValidationAwareSupport(), tpf);
         container.getInstance(ActionValidatorManager.class).validate(equidae, null, context);
 
         assertTrue(context.hasFieldErrors());
@@ -66,7 +69,7 @@ public class StringValidatorTest extends XWorkTestCase {
         // trim = false should fail
         equidae.setHorse("  ");
         ActionContext.getContext().getValueStack().push(equidae);
-        context = new DelegatingValidatorContext(new ValidationAwareSupport());
+        context = new DelegatingValidatorContext(new ValidationAwareSupport(), tpf);
         container.getInstance(ActionValidatorManager.class).validate(equidae, null, context);
 
         assertTrue(context.hasFieldErrors());
@@ -85,7 +88,7 @@ public class StringValidatorTest extends XWorkTestCase {
         equidae.setDonkey("asdf");
         ActionContext.getContext().getValueStack().push(equidae);
 
-        DelegatingValidatorContext context = new DelegatingValidatorContext(new ValidationAwareSupport());
+        DelegatingValidatorContext context = new DelegatingValidatorContext(new ValidationAwareSupport(), tpf);
         container.getInstance(ActionValidatorManager.class).validate(equidae, null, context);
         assertTrue(context.hasFieldErrors());
 
@@ -109,7 +112,7 @@ public class StringValidatorTest extends XWorkTestCase {
         equidae.setCow("asdf  ");
         equidae.setDonkey("asdf  ");
         ActionContext.getContext().getValueStack().push(equidae);
-        context = new DelegatingValidatorContext(new ValidationAwareSupport());
+        context = new DelegatingValidatorContext(new ValidationAwareSupport(), tpf);
         container.getInstance(ActionValidatorManager.class).validate(equidae, null, context);
         assertTrue(context.hasFieldErrors());
 
@@ -128,7 +131,7 @@ public class StringValidatorTest extends XWorkTestCase {
         equidae.setCow("asdfasdf");
         equidae.setDonkey("asdfasdf");
         ActionContext.getContext().getValueStack().push(equidae);
-        context = new DelegatingValidatorContext(new ValidationAwareSupport());
+        context = new DelegatingValidatorContext(new ValidationAwareSupport(), tpf);
         container.getInstance(ActionValidatorManager.class).validate(equidae, null, context);
         assertTrue(context.hasFieldErrors());
 
@@ -143,7 +146,7 @@ public class StringValidatorTest extends XWorkTestCase {
         equidae.setCow("asdfasdf   ");
         equidae.setDonkey("asdfasdf   ");
         ActionContext.getContext().getValueStack().push(equidae);
-        context = new DelegatingValidatorContext(new ValidationAwareSupport());
+        context = new DelegatingValidatorContext(new ValidationAwareSupport(), tpf);
         container.getInstance(ActionValidatorManager.class).validate(equidae, null, context);
         assertTrue(context.hasFieldErrors());
 
@@ -162,7 +165,7 @@ public class StringValidatorTest extends XWorkTestCase {
         equidae.setCow("asdfasdfasdf");
         equidae.setDonkey("asdfasdfasdf");
         ActionContext.getContext().getValueStack().push(equidae);
-        context = new DelegatingValidatorContext(new ValidationAwareSupport());
+        context = new DelegatingValidatorContext(new ValidationAwareSupport(), tpf);
         container.getInstance(ActionValidatorManager.class).validate(equidae, null, context);
         assertTrue(context.hasFieldErrors());
 
@@ -213,5 +216,7 @@ public class StringValidatorTest extends XWorkTestCase {
         EasyMock.replay(proxy);
 
         ActionContext.getContext().setActionInvocation(invocation);
+
+        tpf = container.inject(TextProviderFactory.class);
     }
 }

http://git-wip-us.apache.org/repos/asf/struts/blob/3dc84809/core/src/test/java/com/opensymphony/xwork2/validator/URLValidatorTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/com/opensymphony/xwork2/validator/URLValidatorTest.java b/core/src/test/java/com/opensymphony/xwork2/validator/URLValidatorTest.java
index 438173a..9f995d8 100644
--- a/core/src/test/java/com/opensymphony/xwork2/validator/URLValidatorTest.java
+++ b/core/src/test/java/com/opensymphony/xwork2/validator/URLValidatorTest.java
@@ -16,6 +16,7 @@
 package com.opensymphony.xwork2.validator;
 
 import com.opensymphony.xwork2.ActionContext;
+import com.opensymphony.xwork2.TextProviderFactory;
 import com.opensymphony.xwork2.XWorkTestCase;
 import com.opensymphony.xwork2.util.ValueStack;
 import com.opensymphony.xwork2.validator.validators.URLValidator;
@@ -36,11 +37,12 @@ public class URLValidatorTest extends XWorkTestCase {
 	
 	ValueStack stack;
 	ActionContext actionContext;
-	
+	private TextProviderFactory tpf;
+
 	public void testAcceptNullValueForMutualExclusionOfValidators() throws Exception {
 		
 		URLValidator validator = new URLValidator();
-		validator.setValidatorContext(new GenericValidatorContext(new Object()));
+		validator.setValidatorContext(new GenericValidatorContext(new Object(), tpf));
 		validator.setFieldName("testingUrl1");
         validator.setValueStack(ActionContext.getContext().getValueStack());
         validator.validate(new MyObject());
@@ -54,7 +56,7 @@ public class URLValidatorTest extends XWorkTestCase {
 	public void testInvalidEmptyValue() throws Exception {
 		
 		URLValidator validator = new URLValidator();
-		validator.setValidatorContext(new GenericValidatorContext(new Object()));
+		validator.setValidatorContext(new GenericValidatorContext(new Object(), tpf));
 		validator.setFieldName("testingUrl2");
         validator.setValueStack(ActionContext.getContext().getValueStack());
         validator.validate(new MyObject());
@@ -68,7 +70,7 @@ public class URLValidatorTest extends XWorkTestCase {
 	public void testInvalidValue() throws Exception {
 		
 		URLValidator validator = new URLValidator();
-		validator.setValidatorContext(new GenericValidatorContext(new Object()));
+		validator.setValidatorContext(new GenericValidatorContext(new Object(), tpf));
 		validator.setFieldName("testingUrl3");
         validator.setValueStack(ActionContext.getContext().getValueStack());
         validator.validate(new MyObject());
@@ -83,7 +85,7 @@ public class URLValidatorTest extends XWorkTestCase {
 	public void testValidUrl1() throws Exception {
 		
 		URLValidator validator = new URLValidator();
-		validator.setValidatorContext(new GenericValidatorContext(new Object()));
+		validator.setValidatorContext(new GenericValidatorContext(new Object(), tpf));
 		validator.setFieldName("testingUrl4");
         validator.setValueStack(ActionContext.getContext().getValueStack());
         validator.validate(new MyObject());
@@ -97,7 +99,7 @@ public class URLValidatorTest extends XWorkTestCase {
 	public void testValidUrl2() throws Exception {
 		
 		URLValidator validator = new URLValidator();
-		validator.setValidatorContext(new GenericValidatorContext(new Object()));
+		validator.setValidatorContext(new GenericValidatorContext(new Object(), tpf));
 		validator.setFieldName("testingUrl5");
         validator.setValueStack(ActionContext.getContext().getValueStack());
         validator.validate(new MyObject());
@@ -203,6 +205,7 @@ public class URLValidatorTest extends XWorkTestCase {
 	    super.setUp();
 		stack = ActionContext.getContext().getValueStack();
 		actionContext = ActionContext.getContext();
+		tpf = container.inject(TextProviderFactory.class);
 	}
 	
 	@Override

http://git-wip-us.apache.org/repos/asf/struts/blob/3dc84809/core/src/test/java/com/opensymphony/xwork2/validator/validators/AppendingValidatorContextTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/com/opensymphony/xwork2/validator/validators/AppendingValidatorContextTest.java b/core/src/test/java/com/opensymphony/xwork2/validator/validators/AppendingValidatorContextTest.java
index 8ce3fb8..0446e97 100644
--- a/core/src/test/java/com/opensymphony/xwork2/validator/validators/AppendingValidatorContextTest.java
+++ b/core/src/test/java/com/opensymphony/xwork2/validator/validators/AppendingValidatorContextTest.java
@@ -1,8 +1,12 @@
 package com.opensymphony.xwork2.validator.validators;
 
+import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 
+import com.opensymphony.xwork2.CompositeTextProvider;
+import com.opensymphony.xwork2.TextProvider;
+import com.opensymphony.xwork2.TextProviderFactory;
 import com.opensymphony.xwork2.XWorkTestCase;
 import com.opensymphony.xwork2.validator.DelegatingValidatorContext;
 import com.opensymphony.xwork2.validator.ValidatorContext;
@@ -23,12 +27,12 @@ public class AppendingValidatorContextTest extends XWorkTestCase {
     protected void setUp() throws Exception {
         super.setUp();
 
-        action = new VisitorValidatorTestAction();
-        ValidatorContext vc1 = new DelegatingValidatorContext(action);
+        action = container.inject(VisitorValidatorTestAction.class);
+        TextProviderFactory tpf = container.getInstance(TextProviderFactory.class);
+        ValidatorContext vc1 = new DelegatingValidatorContext(action, tpf);
 
-        VisitorFieldValidator.AppendingValidatorContext vc2 = new AppendingValidatorContext(
-                vc1, "value", FIRST_NAME, "");
-        validatorContext = new AppendingValidatorContext(vc2, "value", SECOND_NAME, "");
+        VisitorFieldValidator.AppendingValidatorContext vc2 = new AppendingValidatorContext(vc1, createTextProvider(action, vc1), FIRST_NAME, "");
+        validatorContext = new AppendingValidatorContext(vc2, createTextProvider(action, vc2), SECOND_NAME, "");
     }
 
     public void testGetFullFieldName() throws Exception {
@@ -44,4 +48,15 @@ public class AppendingValidatorContextTest extends XWorkTestCase {
         assertEquals(1, fieldErrors.size());
         assertTrue(fieldErrors.containsKey(FULL_FIELD_NAME));
     }
+
+    private CompositeTextProvider createTextProvider(Object o, ValidatorContext parent) {
+        List<TextProvider> textProviders = new LinkedList<>();
+        if (o instanceof TextProvider) {
+            textProviders.add((TextProvider) o);
+        }
+        textProviders.add(parent);
+
+        return new CompositeTextProvider(textProviders);
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/struts/blob/3dc84809/core/src/test/java/com/opensymphony/xwork2/validator/validators/DateRangeFieldValidatorTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/com/opensymphony/xwork2/validator/validators/DateRangeFieldValidatorTest.java b/core/src/test/java/com/opensymphony/xwork2/validator/validators/DateRangeFieldValidatorTest.java
index 9103169..fd4a480 100644
--- a/core/src/test/java/com/opensymphony/xwork2/validator/validators/DateRangeFieldValidatorTest.java
+++ b/core/src/test/java/com/opensymphony/xwork2/validator/validators/DateRangeFieldValidatorTest.java
@@ -1,6 +1,7 @@
 package com.opensymphony.xwork2.validator.validators;
 
 import com.opensymphony.xwork2.ActionContext;
+import com.opensymphony.xwork2.TextProviderFactory;
 import com.opensymphony.xwork2.XWorkTestCase;
 import com.opensymphony.xwork2.util.ValueStack;
 import com.opensymphony.xwork2.util.ValueStackFactory;
@@ -13,10 +14,12 @@ import java.util.Locale;
 
 public class DateRangeFieldValidatorTest extends XWorkTestCase {
 
+    private TextProviderFactory tpf;
+
     public void testPassValidation() throws Exception {
         // given
         ValidationAction action = prepareAction(createDate(2013, 6, 6));
-        ValidatorContext context = new GenericValidatorContext(action);
+        ValidatorContext context = new GenericValidatorContext(action, tpf);
         DateRangeFieldValidator validator = prepareValidator(action, context);
 
         // when
@@ -29,7 +32,7 @@ public class DateRangeFieldValidatorTest extends XWorkTestCase {
     public void testMinValidation() throws Exception {
         // given
         ValidationAction action = prepareAction(createDate(2012, Calendar.MARCH, 3));
-        ValidatorContext context = new GenericValidatorContext(action);
+        ValidatorContext context = new GenericValidatorContext(action, tpf);
         DateRangeFieldValidator validator = prepareValidator(action, context);
 
         // when
@@ -43,7 +46,7 @@ public class DateRangeFieldValidatorTest extends XWorkTestCase {
     public void testMaxValidation() throws Exception {
         // given
         ValidationAction action = prepareAction(createDate(2014, Calendar.APRIL, 4));
-        ValidatorContext context = new GenericValidatorContext(action);
+        ValidatorContext context = new GenericValidatorContext(action, tpf);
         DateRangeFieldValidator validator = prepareValidator(action, context);
 
         // when
@@ -88,6 +91,7 @@ public class DateRangeFieldValidatorTest extends XWorkTestCase {
     public void setUp() throws Exception {
         super.setUp();
         ActionContext.getContext().setLocale(new Locale("DE"));
+        tpf = container.inject(TextProviderFactory.class);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/struts/blob/3dc84809/core/src/test/java/com/opensymphony/xwork2/validator/validators/IntRangeFieldValidatorTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/com/opensymphony/xwork2/validator/validators/IntRangeFieldValidatorTest.java b/core/src/test/java/com/opensymphony/xwork2/validator/validators/IntRangeFieldValidatorTest.java
index 680ea08..a729ec8 100644
--- a/core/src/test/java/com/opensymphony/xwork2/validator/validators/IntRangeFieldValidatorTest.java
+++ b/core/src/test/java/com/opensymphony/xwork2/validator/validators/IntRangeFieldValidatorTest.java
@@ -1,5 +1,6 @@
 package com.opensymphony.xwork2.validator.validators;
 
+import com.opensymphony.xwork2.TextProviderFactory;
 import com.opensymphony.xwork2.XWorkTestCase;
 import com.opensymphony.xwork2.util.ValueStack;
 import com.opensymphony.xwork2.util.ValueStackFactory;
@@ -8,10 +9,17 @@ import com.opensymphony.xwork2.validator.ValidatorContext;
 
 public class IntRangeFieldValidatorTest extends XWorkTestCase {
 
+    private TextProviderFactory tpf;
+
+    public void setUp() throws Exception {
+        super.setUp();
+        tpf = container.inject(TextProviderFactory.class);
+    }
+
     public void testPassValidation() throws Exception {
         // given
         ValidationAction action = prepareAction(100);
-        ValidatorContext context = new GenericValidatorContext(action);
+        ValidatorContext context = new GenericValidatorContext(action, tpf);
         IntRangeFieldValidator validator = prepareValidator(action, context);
 
         // when
@@ -24,7 +32,7 @@ public class IntRangeFieldValidatorTest extends XWorkTestCase {
     public void testMinValidation() throws Exception {
         // given
         ValidationAction action = prepareAction(98);
-        ValidatorContext context = new GenericValidatorContext(action);
+        ValidatorContext context = new GenericValidatorContext(action, tpf);
         IntRangeFieldValidator validator = prepareValidator(action, context);
 
         // when
@@ -38,7 +46,7 @@ public class IntRangeFieldValidatorTest extends XWorkTestCase {
     public void testMaxValidation() throws Exception {
         // given
         ValidationAction action = prepareAction(102);
-        ValidatorContext context = new GenericValidatorContext(action);
+        ValidatorContext context = new GenericValidatorContext(action, tpf);
         IntRangeFieldValidator validator = prepareValidator(action, context);
 
         // when

http://git-wip-us.apache.org/repos/asf/struts/blob/3dc84809/core/src/test/java/com/opensymphony/xwork2/validator/validators/LongRangeFieldValidatorTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/com/opensymphony/xwork2/validator/validators/LongRangeFieldValidatorTest.java b/core/src/test/java/com/opensymphony/xwork2/validator/validators/LongRangeFieldValidatorTest.java
index e8187d7..b2e5ad3 100644
--- a/core/src/test/java/com/opensymphony/xwork2/validator/validators/LongRangeFieldValidatorTest.java
+++ b/core/src/test/java/com/opensymphony/xwork2/validator/validators/LongRangeFieldValidatorTest.java
@@ -1,5 +1,6 @@
 package com.opensymphony.xwork2.validator.validators;
 
+import com.opensymphony.xwork2.TextProviderFactory;
 import com.opensymphony.xwork2.XWorkTestCase;
 import com.opensymphony.xwork2.util.ValueStack;
 import com.opensymphony.xwork2.util.ValueStackFactory;
@@ -8,10 +9,17 @@ import com.opensymphony.xwork2.validator.ValidatorContext;
 
 public class LongRangeFieldValidatorTest extends XWorkTestCase {
 
+    private TextProviderFactory tpf;
+
+    public void setUp() throws Exception {
+        super.setUp();
+        tpf = container.inject(TextProviderFactory.class);
+    }
+
     public void testPassValidation() throws Exception {
         // given
         ValidationAction action = prepareAction(100);
-        ValidatorContext context = new GenericValidatorContext(action);
+        ValidatorContext context = new GenericValidatorContext(action, tpf);
         LongRangeFieldValidator validator = prepareValidator(action, context);
 
         // when
@@ -24,7 +32,7 @@ public class LongRangeFieldValidatorTest extends XWorkTestCase {
     public void testMinValidation() throws Exception {
         // given
         ValidationAction action = prepareAction(98);
-        ValidatorContext context = new GenericValidatorContext(action);
+        ValidatorContext context = new GenericValidatorContext(action, tpf);
         LongRangeFieldValidator validator = prepareValidator(action, context);
 
         // when
@@ -38,7 +46,7 @@ public class LongRangeFieldValidatorTest extends XWorkTestCase {
     public void testMaxValidation() throws Exception {
         // given
         ValidationAction action = prepareAction(102);
-        ValidatorContext context = new GenericValidatorContext(action);
+        ValidatorContext context = new GenericValidatorContext(action, tpf);
         LongRangeFieldValidator validator = prepareValidator(action, context);
 
         // when

http://git-wip-us.apache.org/repos/asf/struts/blob/3dc84809/core/src/test/java/com/opensymphony/xwork2/validator/validators/RequiredStringValidatorTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/com/opensymphony/xwork2/validator/validators/RequiredStringValidatorTest.java b/core/src/test/java/com/opensymphony/xwork2/validator/validators/RequiredStringValidatorTest.java
index 2e33a7f..906fcd3 100644
--- a/core/src/test/java/com/opensymphony/xwork2/validator/validators/RequiredStringValidatorTest.java
+++ b/core/src/test/java/com/opensymphony/xwork2/validator/validators/RequiredStringValidatorTest.java
@@ -2,6 +2,7 @@ package com.opensymphony.xwork2.validator.validators;
 
 import com.opensymphony.xwork2.ActionContext;
 import com.opensymphony.xwork2.ActionSupport;
+import com.opensymphony.xwork2.TextProviderFactory;
 import com.opensymphony.xwork2.XWorkTestCase;
 import com.opensymphony.xwork2.util.ValueStack;
 import com.opensymphony.xwork2.validator.GenericValidatorContext;
@@ -9,6 +10,13 @@ import com.opensymphony.xwork2.validator.ValidatorContext;
 
 public class RequiredStringValidatorTest extends XWorkTestCase {
 
+    private TextProviderFactory tpf;
+
+    public void setUp() throws Exception {
+        super.setUp();
+        tpf = container.inject(TextProviderFactory.class);
+    }
+
     public void testRequiredStringPass() throws Exception {
         // given
         ValueStack valueStack = ActionContext.getContext().getValueStack();
@@ -17,7 +25,7 @@ public class RequiredStringValidatorTest extends XWorkTestCase {
         action.setStringValue("a string");
         valueStack.push(action);
 
-        ValidatorContext context = new GenericValidatorContext(action);
+        ValidatorContext context = new GenericValidatorContext(action, tpf);
         RequiredStringValidator validator = new RequiredStringValidator();
         validator.setValidatorContext(context);
         validator.setFieldName("stringValue");
@@ -37,7 +45,7 @@ public class RequiredStringValidatorTest extends XWorkTestCase {
         ValidationAction action = new ValidationAction();
         valueStack.push(action);
 
-        ValidatorContext context = new GenericValidatorContext(action);
+        ValidatorContext context = new GenericValidatorContext(action, tpf);
         RequiredStringValidator validator = new RequiredStringValidator();
         validator.setValidatorContext(context);
         validator.setFieldName("stringValue");

http://git-wip-us.apache.org/repos/asf/struts/blob/3dc84809/core/src/test/java/com/opensymphony/xwork2/validator/validators/ShortRangeFieldValidatorTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/com/opensymphony/xwork2/validator/validators/ShortRangeFieldValidatorTest.java b/core/src/test/java/com/opensymphony/xwork2/validator/validators/ShortRangeFieldValidatorTest.java
index 0011ced..18c450c 100644
--- a/core/src/test/java/com/opensymphony/xwork2/validator/validators/ShortRangeFieldValidatorTest.java
+++ b/core/src/test/java/com/opensymphony/xwork2/validator/validators/ShortRangeFieldValidatorTest.java
@@ -1,5 +1,6 @@
 package com.opensymphony.xwork2.validator.validators;
 
+import com.opensymphony.xwork2.TextProviderFactory;
 import com.opensymphony.xwork2.XWorkTestCase;
 import com.opensymphony.xwork2.util.ValueStack;
 import com.opensymphony.xwork2.util.ValueStackFactory;
@@ -8,10 +9,17 @@ import com.opensymphony.xwork2.validator.ValidatorContext;
 
 public class ShortRangeFieldValidatorTest extends XWorkTestCase {
 
+    private TextProviderFactory tpf;
+
+    public void setUp() throws Exception {
+        super.setUp();
+        tpf = container.inject(TextProviderFactory.class);
+    }
+
     public void testPassValidation() throws Exception {
         // given
         ValidationAction action = prepareAction((short) 5);
-        ValidatorContext context = new GenericValidatorContext(action);
+        ValidatorContext context = new GenericValidatorContext(action, tpf);
         ShortRangeFieldValidator validator = prepareValidator(action, context);
 
         // when
@@ -24,7 +32,7 @@ public class ShortRangeFieldValidatorTest extends XWorkTestCase {
     public void testMinValidation() throws Exception {
         // given
         ValidationAction action = prepareAction((short) 1);
-        ValidatorContext context = new GenericValidatorContext(action);
+        ValidatorContext context = new GenericValidatorContext(action, tpf);
         ShortRangeFieldValidator validator = prepareValidator(action, context);
 
         // when
@@ -38,7 +46,7 @@ public class ShortRangeFieldValidatorTest extends XWorkTestCase {
     public void testMaxValidation() throws Exception {
         // given
         ValidationAction action = prepareAction((short) 11);
-        ValidatorContext context = new GenericValidatorContext(action);
+        ValidatorContext context = new GenericValidatorContext(action, tpf);
         ShortRangeFieldValidator validator = prepareValidator(action, context);
 
         // when


Mime
View raw message