You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2014/12/30 14:34:34 UTC
svn commit: r1648528 -
/commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/AbstractCheckDigitTest.java
Author: sebb
Date: Tue Dec 30 13:34:34 2014
New Revision: 1648528
URL: http://svn.apache.org/r1648528
Log:
Prepare for changing tests to try check letter failure as well
This change does not affect the output of the method
Modified:
commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/AbstractCheckDigitTest.java
Modified: commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/AbstractCheckDigitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/AbstractCheckDigitTest.java?rev=1648528&r1=1648527&r2=1648528&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/AbstractCheckDigitTest.java (original)
+++ commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/AbstractCheckDigitTest.java Tue Dec 30 13:34:34 2014
@@ -237,6 +237,9 @@ public abstract class AbstractCheckDigit
assertNotNull(result);
}
+ // Prepare for changing tests to try check letter failure as well
+// private static final String POSSIBLE_CHECK_DIGITS = "0123456789 ABCDEFHIJKLMNOPQRSTUVWXYZ\tabcdefghijklmnopqrstuvwxyz!@£$%^&*()_+";
+ private static final String POSSIBLE_CHECK_DIGITS = "0123456789";
/**
* Returns an array of codes with invalid check digits.
*
@@ -250,8 +253,8 @@ public abstract class AbstractCheckDigit
for (int i = 0; i < codes.length; i++) {
String code = removeCheckDigit(codes[i]);
String check = checkDigit(codes[i]);
- for (int j = 0; j < 10; j++) {
- String curr = "" + Character.forDigit(j, 10);
+ for (int j = 0; j < POSSIBLE_CHECK_DIGITS.length(); j++) {
+ String curr = POSSIBLE_CHECK_DIGITS.substring(j, j+1);//"" + Character.forDigit(j, 10);
if (!curr.equals(check)) {
list.add(code + curr);
}