org.apache.bval.extras.constraints.checkdigit
Class IBANCheckDigitTest

java.lang.Object
  extended by org.apache.bval.extras.constraints.checkdigit.AbstractCheckDigitTest
      extended by org.apache.bval.extras.constraints.checkdigit.IBANCheckDigitTest

public class IBANCheckDigitTest
extends AbstractCheckDigitTest

IVAN Check Digit Test.


Constructor Summary
IBANCheckDigitTest()
           
 
Method Summary
protected  String checkDigit(String code)
          Returns the check digit (i.e.
protected  String[] createInvalidCodes(String[] codes)
          Returns an array of codes with invalid check digits.
 int getCheckDigitLth()
           
protected  ConstraintValidator<? extends Annotation,String> getConstraint()
           
protected  String[] getInvalid()
           
 String getMissingMessage()
           
protected  String[] getValid()
           
protected  String getZeroSum()
           
protected  String removeCheckDigit(String code)
          Returns a code with the Check Digit (i.e.
 void testZeroSum()
          Test zero sum
 
Methods inherited from class org.apache.bval.extras.constraints.checkdigit.AbstractCheckDigitTest
setUp, tearDown, testIsValidFalse, testIsValidTrue, testMissingCode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IBANCheckDigitTest

public IBANCheckDigitTest()
Method Detail

getCheckDigitLth

public int getCheckDigitLth()
Overrides:
getCheckDigitLth in class AbstractCheckDigitTest

getConstraint

protected ConstraintValidator<? extends Annotation,String> getConstraint()
Specified by:
getConstraint in class AbstractCheckDigitTest

getValid

protected String[] getValid()
Specified by:
getValid in class AbstractCheckDigitTest

getInvalid

protected String[] getInvalid()
Overrides:
getInvalid in class AbstractCheckDigitTest

getZeroSum

protected String getZeroSum()
Overrides:
getZeroSum in class AbstractCheckDigitTest

getMissingMessage

public String getMissingMessage()
Overrides:
getMissingMessage in class AbstractCheckDigitTest

testZeroSum

public void testZeroSum()
Test zero sum

Overrides:
testZeroSum in class AbstractCheckDigitTest

createInvalidCodes

protected String[] createInvalidCodes(String[] codes)
Description copied from class: AbstractCheckDigitTest
Returns an array of codes with invalid check digits.

Overrides:
createInvalidCodes in class AbstractCheckDigitTest
Parameters:
codes - Codes with valid check digits
Returns:
Codes with invalid check digits

removeCheckDigit

protected String removeCheckDigit(String code)
Returns a code with the Check Digit (i.e. last character) removed.

Overrides:
removeCheckDigit in class AbstractCheckDigitTest
Parameters:
code - The code
Returns:
The code without the check digit

checkDigit

protected String checkDigit(String code)
Returns the check digit (i.e. last character) for a code.

Overrides:
checkDigit in class AbstractCheckDigitTest
Parameters:
code - The code
Returns:
The check digit


Copyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.