mirror of
https://github.com/frosch95/SmartCSV.fx.git
synced 2026-04-11 21:48:22 +02:00
i18n parameterized validation error messages
This commit is contained in:
@@ -108,9 +108,9 @@ public class HeaderValidationTest {
|
||||
return asList(new Object[][] {
|
||||
{ new String[] {}, new String[] {}, true, null },
|
||||
{ new String[] {"a"}, new String[] {"a"}, true, null },
|
||||
{ new String[] {"a"}, new String[] {"b"}, false, singletonList(new ValidationMessage("header number 0 does not match \"a\" should be \"b\""))},
|
||||
{ new String[] {"a"}, new String[] {"a","b"}, false, singletonList(new ValidationMessage("number of headers is not correct! there are 2 but there should be 1"))},
|
||||
{ new String[] {"a", "b"}, new String[] {"b", "a"}, false, asList(new ValidationMessage("header number 0 does not match \"a\" should be \"b\""), new ValidationMessage("header number 1 does not match \"b\" should be \"a\"")) }
|
||||
{ new String[] {"a"}, new String[] {"b"}, false, singletonList(new ValidationMessage("validation.message.header.match", "0", "a", "b"))},
|
||||
{ new String[] {"a"}, new String[] {"a","b"}, false, singletonList(new ValidationMessage("validation.message.header.length", "2", "1"))},
|
||||
{ new String[] {"a", "b"}, new String[] {"b", "a"}, false, asList(new ValidationMessage("validation.message.header.match", "0", "a", "b"), new ValidationMessage("validation.message.header.match", "1", "b", "a")) }
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,15 +90,15 @@ public class ValidatorTest {
|
||||
{ "column", "integer", true, "column", "999", true, null },
|
||||
{ "column", "integer", true, "column", "a", false, new ValidationMessage("validation.message.integer") },
|
||||
{ "column", "minlength", 2, "column", "12", true, null },
|
||||
{ "column", "minlength", 2, "column", "1", false, new ValidationMessage("has not min length of 2") },
|
||||
{ "column", "minlength", 2, "column", "1", false, new ValidationMessage("validation.message.min.length", "2") },
|
||||
{ "column", "maxlength", 2, "column", "12", true, null },
|
||||
{ "column", "maxlength", 2, "column", "123", false, new ValidationMessage("has not max length of 2") },
|
||||
{ "column", "maxlength", 2, "column", "123", false, new ValidationMessage("validation.message.max.length", "2") },
|
||||
{ "column", "date", "yyyyMMdd", "column", "20151127", true, null },
|
||||
{ "column", "date", "yyyyMMdd", "column", "27.11.2015", false, new ValidationMessage("is not a date of format yyyyMMdd") },
|
||||
{ "column", "date", "yyyyMMdd", "column", "27.11.2015", false, new ValidationMessage("validation.message.date.format", "yyyyMMdd") },
|
||||
{ "column", "alphanumeric", true, "column", "abcABC123", true, null },
|
||||
{ "column", "alphanumeric", true, "column", "-abcABC123", false, new ValidationMessage("validation.message.alphanumeric") },
|
||||
{ "column", "regexp", "[a-z]*", "column", "abc", true, null },
|
||||
{ "column", "regexp", "[a-z]*", "column", "abcA", false, new ValidationMessage("does not match [a-z]*") },
|
||||
{ "column", "regexp", "[a-z]*", "column", "abcA", false, new ValidationMessage("validation.message.regexp", "[a-z]*") },
|
||||
{ "column", "groovy", "value.contains('a')? 'true' : 'no a inside'", "column", "abcdef", true, null },
|
||||
{ "column", "groovy", "value.contains('a')? 'true' : 'no a inside'", "column", "bcdefg", false, new ValidationMessage("no a inside") },
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user