first version of new validation algorithm, that is a lot faster

This commit is contained in:
2016-08-07 16:57:55 +02:00
parent 4c4d25f3b5
commit bc59f08bbb
19 changed files with 454 additions and 169 deletions

View File

@@ -55,6 +55,6 @@ public class CSVValueTest {
sut.setValue(VALUE);
// assertion
verify(validator).isValid(eq(COLUMN), eq(VALUE), anyInt());
verify(validator).isValid(anyInt(), eq(COLUMN), eq(VALUE));
}
}

View File

@@ -70,8 +70,10 @@ public class ValidatorTest {
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@Test
public void validation() {
System.out.println(column + " " + value + " " + expectedResult + " " + expectedError);
// execution
ValidationError result = sut.isValid(column, value, 0);
ValidationError result = sut.isValid(0, column, value);
// assertion
assertThat(result == null, is(expectedResult));
@@ -112,7 +114,7 @@ public class ValidatorTest {
}
public static String json(String column, String rule, Object value) {
String json = "{\"columns\":{\"" + column + "\":{\"" + rule + "\":";
String json = "{\"headers\": { \"list\": [\""+column+"\"]},\"columns\":{\"" + column + "\":{\"" + rule + "\":";
if (value instanceof String) {
json += "\""+ value + "\"";
} else if (value instanceof List) {