Uses more direct message to link with proper resource bundle
Project: http://git-wip-us.apache.org/repos/asf/struts/repo Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/2b3082ee Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/2b3082ee Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/2b3082ee Branch: refs/heads/master Commit: 2b3082ee40360740b8d5221cc08cc428043e5caf Parents: 55ea82c Author: Lukasz Lenart <lukaszlen...@apache.org> Authored: Mon Mar 13 06:45:37 2017 +0100 Committer: Lukasz Lenart <lukaszlen...@apache.org> Committed: Mon Mar 13 06:45:37 2017 +0100 ---------------------------------------------------------------------- .../xwork2/validator/VisitorFieldValidatorTest.java | 7 +++---- .../resources/com/opensymphony/xwork2/TestBean.properties | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/struts/blob/2b3082ee/core/src/test/java/com/opensymphony/xwork2/validator/VisitorFieldValidatorTest.java ---------------------------------------------------------------------- diff --git a/core/src/test/java/com/opensymphony/xwork2/validator/VisitorFieldValidatorTest.java b/core/src/test/java/com/opensymphony/xwork2/validator/VisitorFieldValidatorTest.java index 70e4b3b..a38764e 100644 --- a/core/src/test/java/com/opensymphony/xwork2/validator/VisitorFieldValidatorTest.java +++ b/core/src/test/java/com/opensymphony/xwork2/validator/VisitorFieldValidatorTest.java @@ -35,11 +35,10 @@ public class VisitorFieldValidatorTest extends XWorkTestCase { public void setUp() throws Exception { super.setUp(); - action = new VisitorValidatorTestAction(); - container.inject(action); + action = container.inject(VisitorValidatorTestAction.class); TestBean bean = action.getBean(); - Calendar cal = new GregorianCalendar(1900, 01, 01); + Calendar cal = new GregorianCalendar(1900, 1, 1); bean.setBirth(cal.getTime()); bean.setCount(-1); @@ -98,7 +97,7 @@ public class VisitorFieldValidatorTest extends XWorkTestCase { assertEquals(1, beanCountMessages.size()); String beanCountMessage = beanCountMessages.get(0); - assertEquals("bean: Model: Count must be between 1 and 100, current value is -1.", beanCountMessage); + assertEquals("bean: TestBean model: Count must be between 1 and 100, current value is -1.", beanCountMessage); } public void testCollectionValidation() throws Exception { http://git-wip-us.apache.org/repos/asf/struts/blob/2b3082ee/core/src/test/resources/com/opensymphony/xwork2/TestBean.properties ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/TestBean.properties b/core/src/test/resources/com/opensymphony/xwork2/TestBean.properties index 86eab13..83a3aa9 100644 --- a/core/src/test/resources/com/opensymphony/xwork2/TestBean.properties +++ b/core/src/test/resources/com/opensymphony/xwork2/TestBean.properties @@ -1 +1 @@ -invalid.count=Model: Count must be between ${min} and ${max}, current value is ${count}. +invalid.count=TestBean model: Count must be between ${min} and ${max}, current value is ${count}.