Skip to content

Commit

Permalink
Renames class to match its purpose
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszlenart committed Mar 10, 2017
1 parent c063704 commit 57106cc
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public void testDefaultMessageInterpolation() {
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());
Expand Down Expand Up @@ -256,7 +256,7 @@ public void testMessageInterpolation() {
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());
Expand Down Expand Up @@ -294,7 +294,7 @@ public void testSkipUserMarkerActionLevelShortCircuit() {
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());

Expand Down Expand Up @@ -336,7 +336,7 @@ public void testSkipAllActionLevelShortCircuit2() {
user.setEmail("[email protected]");
user.setEmail2("[email protected]");

ValidatorContext context = new GenericValidatorContext(user, tpf);
ValidatorContext context = new DummyValidatorContext(user, tpf);
annotationActionValidatorManager.validate(user, null, context);
assertTrue(context.hasFieldErrors());

Expand Down Expand Up @@ -374,7 +374,7 @@ public void testActionLevelShortCircuit() throws Exception {
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
Expand Down Expand Up @@ -405,7 +405,7 @@ public void testShortCircuitNoErrors() {
user.setEmail("[email protected]");
user.setEmail2("[email protected]");

ValidatorContext context = new GenericValidatorContext(user, tpf);
ValidatorContext context = new DummyValidatorContext(user, tpf);
annotationActionValidatorManager.validate(user, null, context);
assertFalse(context.hasErrors());
} catch (ValidationException ex) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void testMatch() throws Exception {

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);
Expand All @@ -74,7 +74,7 @@ public void testMatchNoTrim() throws Exception {
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);
Expand All @@ -94,7 +94,7 @@ public void testFail() throws Exception {

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);
Expand All @@ -119,7 +119,7 @@ public void testNoFieldName() throws Exception {

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);
Expand Down Expand Up @@ -152,7 +152,7 @@ public void testEmptyName() throws Exception {

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);
Expand All @@ -172,7 +172,7 @@ public void testNoStringField() throws Exception {

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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -56,7 +56,7 @@ public void testAcceptNullValueForMutualExclusionOfValidators() throws Exception
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());
Expand All @@ -70,7 +70,7 @@ public void testInvalidEmptyValue() throws Exception {
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());
Expand All @@ -85,7 +85,7 @@ public void testInvalidValue() throws Exception {
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());
Expand All @@ -99,7 +99,7 @@ public void testValidUrl1() throws Exception {
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());
Expand Down

0 comments on commit 57106cc

Please sign in to comment.