mirror of
https://github.com/apache/struts.git
synced 2026-08-31 19:35:40 +00:00
Renames class to match its purpose
This commit is contained in:
+6
-6
@@ -128,7 +128,7 @@ public class AnnotationActionValidatorManagerTest extends XWorkTestCase {
|
||||
bean.setName("foo");
|
||||
bean.setCount(99);
|
||||
|
||||
ValidatorContext context = new GenericValidatorContext(bean, tpf);
|
||||
ValidatorContext context = new DummyValidatorContext(bean, tpf);
|
||||
annotationActionValidatorManager.validate(bean, "beanMessageBundle", context);
|
||||
assertTrue(context.hasErrors());
|
||||
assertTrue(context.hasFieldErrors());
|
||||
@@ -256,7 +256,7 @@ public class AnnotationActionValidatorManagerTest extends XWorkTestCase {
|
||||
bean.setName("foo");
|
||||
bean.setCount(150);
|
||||
|
||||
ValidatorContext context = new GenericValidatorContext(bean, tpf);
|
||||
ValidatorContext context = new DummyValidatorContext(bean, tpf);
|
||||
annotationActionValidatorManager.validate(bean, "beanMessageBundle", context);
|
||||
assertTrue(context.hasErrors());
|
||||
assertTrue(context.hasFieldErrors());
|
||||
@@ -294,7 +294,7 @@ public class AnnotationActionValidatorManagerTest extends XWorkTestCase {
|
||||
user.setEmail("bad_email");
|
||||
user.setEmail2("bad_email");
|
||||
|
||||
ValidatorContext context = new GenericValidatorContext(user, tpf);
|
||||
ValidatorContext context = new DummyValidatorContext(user, tpf);
|
||||
annotationActionValidatorManager.validate(user, null, context);
|
||||
assertTrue(context.hasFieldErrors());
|
||||
|
||||
@@ -336,7 +336,7 @@ 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, tpf);
|
||||
ValidatorContext context = new DummyValidatorContext(user, tpf);
|
||||
annotationActionValidatorManager.validate(user, null, context);
|
||||
assertTrue(context.hasFieldErrors());
|
||||
|
||||
@@ -374,7 +374,7 @@ public class AnnotationActionValidatorManagerTest extends XWorkTestCase {
|
||||
user.setEmail("rainer_h(at)example.com");
|
||||
|
||||
|
||||
ValidatorContext context = new GenericValidatorContext(user, tpf);
|
||||
ValidatorContext context = new DummyValidatorContext(user, tpf);
|
||||
annotationActionValidatorManager.validate(user, null, context);
|
||||
|
||||
// check field level errors
|
||||
@@ -405,7 +405,7 @@ public class AnnotationActionValidatorManagerTest extends XWorkTestCase {
|
||||
user.setEmail("mark@mycompany.com");
|
||||
user.setEmail2("mark@mycompany.com");
|
||||
|
||||
ValidatorContext context = new GenericValidatorContext(user, tpf);
|
||||
ValidatorContext context = new DummyValidatorContext(user, tpf);
|
||||
annotationActionValidatorManager.validate(user, null, context);
|
||||
assertFalse(context.hasErrors());
|
||||
} catch (ValidationException ex) {
|
||||
|
||||
@@ -53,7 +53,7 @@ public class RegexFieldValidatorTest extends XWorkTestCase {
|
||||
|
||||
RegexFieldValidator validator = new RegexFieldValidator();
|
||||
validator.setRegex("^Sec.*");
|
||||
validator.setValidatorContext(new GenericValidatorContext(new Object(), tpf));
|
||||
validator.setValidatorContext(new DummyValidatorContext(new Object(), tpf));
|
||||
validator.setFieldName("username");
|
||||
validator.setValueStack(ActionContext.getContext().getValueStack());
|
||||
validator.validate(testPerson);
|
||||
@@ -74,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(), tpf));
|
||||
validator.setValidatorContext(new DummyValidatorContext(new Object(), tpf));
|
||||
validator.setFieldName("username");
|
||||
validator.setValueStack(ActionContext.getContext().getValueStack());
|
||||
validator.validate(testPerson);
|
||||
@@ -94,7 +94,7 @@ public class RegexFieldValidatorTest extends XWorkTestCase {
|
||||
|
||||
RegexFieldValidator validator = new RegexFieldValidator();
|
||||
validator.setRegex("^Sec.*");
|
||||
validator.setValidatorContext(new GenericValidatorContext(new Object(), tpf));
|
||||
validator.setValidatorContext(new DummyValidatorContext(new Object(), tpf));
|
||||
validator.setFieldName("username");
|
||||
validator.setValueStack(ActionContext.getContext().getValueStack());
|
||||
validator.validate(testPerson);
|
||||
@@ -119,7 +119,7 @@ public class RegexFieldValidatorTest extends XWorkTestCase {
|
||||
|
||||
RegexFieldValidator validator = new RegexFieldValidator();
|
||||
validator.setRegex("^Sec.*");
|
||||
validator.setValidatorContext(new GenericValidatorContext(new Object(), tpf));
|
||||
validator.setValidatorContext(new DummyValidatorContext(new Object(), tpf));
|
||||
validator.setFieldName(null);
|
||||
validator.setValueStack(ActionContext.getContext().getValueStack());
|
||||
validator.validate(testPerson);
|
||||
@@ -152,7 +152,7 @@ public class RegexFieldValidatorTest extends XWorkTestCase {
|
||||
|
||||
RegexFieldValidator validator = new RegexFieldValidator();
|
||||
validator.setRegex("^Sec.*");
|
||||
validator.setValidatorContext(new GenericValidatorContext(new Object(), tpf));
|
||||
validator.setValidatorContext(new DummyValidatorContext(new Object(), tpf));
|
||||
validator.setFieldName("username");
|
||||
validator.setValueStack(ActionContext.getContext().getValueStack());
|
||||
validator.validate(testPerson);
|
||||
@@ -172,7 +172,7 @@ public class RegexFieldValidatorTest extends XWorkTestCase {
|
||||
|
||||
RegexFieldValidator validator = new RegexFieldValidator();
|
||||
validator.setRegex("[0-9][0-9]");
|
||||
validator.setValidatorContext(new GenericValidatorContext(new Object(), tpf));
|
||||
validator.setValidatorContext(new DummyValidatorContext(new Object(), tpf));
|
||||
validator.setFieldName("age");
|
||||
validator.setValueStack(ActionContext.getContext().getValueStack());
|
||||
validator.validate(testPerson);
|
||||
|
||||
@@ -42,7 +42,7 @@ public class URLValidatorTest extends XWorkTestCase {
|
||||
public void testAcceptNullValueForMutualExclusionOfValidators() throws Exception {
|
||||
|
||||
URLValidator validator = new URLValidator();
|
||||
validator.setValidatorContext(new GenericValidatorContext(new Object(), tpf));
|
||||
validator.setValidatorContext(new DummyValidatorContext(new Object(), tpf));
|
||||
validator.setFieldName("testingUrl1");
|
||||
validator.setValueStack(ActionContext.getContext().getValueStack());
|
||||
validator.validate(new MyObject());
|
||||
@@ -56,7 +56,7 @@ public class URLValidatorTest extends XWorkTestCase {
|
||||
public void testInvalidEmptyValue() throws Exception {
|
||||
|
||||
URLValidator validator = new URLValidator();
|
||||
validator.setValidatorContext(new GenericValidatorContext(new Object(), tpf));
|
||||
validator.setValidatorContext(new DummyValidatorContext(new Object(), tpf));
|
||||
validator.setFieldName("testingUrl2");
|
||||
validator.setValueStack(ActionContext.getContext().getValueStack());
|
||||
validator.validate(new MyObject());
|
||||
@@ -70,7 +70,7 @@ public class URLValidatorTest extends XWorkTestCase {
|
||||
public void testInvalidValue() throws Exception {
|
||||
|
||||
URLValidator validator = new URLValidator();
|
||||
validator.setValidatorContext(new GenericValidatorContext(new Object(), tpf));
|
||||
validator.setValidatorContext(new DummyValidatorContext(new Object(), tpf));
|
||||
validator.setFieldName("testingUrl3");
|
||||
validator.setValueStack(ActionContext.getContext().getValueStack());
|
||||
validator.validate(new MyObject());
|
||||
@@ -85,7 +85,7 @@ public class URLValidatorTest extends XWorkTestCase {
|
||||
public void testValidUrl1() throws Exception {
|
||||
|
||||
URLValidator validator = new URLValidator();
|
||||
validator.setValidatorContext(new GenericValidatorContext(new Object(), tpf));
|
||||
validator.setValidatorContext(new DummyValidatorContext(new Object(), tpf));
|
||||
validator.setFieldName("testingUrl4");
|
||||
validator.setValueStack(ActionContext.getContext().getValueStack());
|
||||
validator.validate(new MyObject());
|
||||
@@ -99,7 +99,7 @@ public class URLValidatorTest extends XWorkTestCase {
|
||||
public void testValidUrl2() throws Exception {
|
||||
|
||||
URLValidator validator = new URLValidator();
|
||||
validator.setValidatorContext(new GenericValidatorContext(new Object(), tpf));
|
||||
validator.setValidatorContext(new DummyValidatorContext(new Object(), tpf));
|
||||
validator.setFieldName("testingUrl5");
|
||||
validator.setValueStack(ActionContext.getContext().getValueStack());
|
||||
validator.validate(new MyObject());
|
||||
|
||||
Reference in New Issue
Block a user