/** * Tests the double validation failure. */ public void testDoubleFailure() throws ValidatorException { // Create bean to run test on. ValueBean info = new ValueBean(); valueTest(info, false); }
/** * Tests the int validation failure. */ public void testIntFailure() throws ValidatorException { // Create bean to run test on. ValueBean info = new ValueBean(); valueTest(info, false); }
/** * Tests the long validation failure. */ public void testLongFailure() throws ValidatorException { // Create bean to run test on. ValueBean info = new ValueBean(); valueTest(info, false); }
/** * Tests the double validation. */ public void testDoubleMax() throws ValidatorException { // Create bean to run test on. ValueBean info = new ValueBean(); info.setValue(new Double(Double.MAX_VALUE).toString()); valueTest(info, true); }
/** * Tests the long validation. */ public void testLongMin() throws ValidatorException { // Create bean to run test on. ValueBean info = new ValueBean(); info.setValue(new Long(Long.MIN_VALUE).toString()); valueTest(info, true); }
/** * Tests the byte validation. */ public void testByteMax() throws ValidatorException { // Create bean to run test on. ValueBean info = new ValueBean(); info.setValue(new Byte(Byte.MAX_VALUE).toString()); valueTest(info, true); }
/** * Tests the int validation. */ public void testIntMin() throws ValidatorException { // Create bean to run test on. ValueBean info = new ValueBean(); info.setValue(new Integer(Integer.MIN_VALUE).toString()); valueTest(info, true); }
/** * Tests the float validation. */ public void testFloatMax() throws ValidatorException { // Create bean to run test on. ValueBean info = new ValueBean(); info.setValue(new Float(Float.MAX_VALUE).toString()); valueTest(info, true); }
/** * Tests the long validation failure. */ public void testLongBeyondMin() throws ValidatorException { // Create bean to run test on. ValueBean info = new ValueBean(); info.setValue(Long.MIN_VALUE + "1"); valueTest(info, false); }
/** * Tests the e-mail validation with a dot at the end of * the address. */ public void testEmailWithDotEnd() throws ValidatorException { // Create bean to run test on. ValueBean info = new ValueBean(); info.setValue("andy.noble@data-workshop.com."); valueTest(info, false); }
/** * Tests the double validation. */ public void testDouble() throws ValidatorException { // Create bean to run test on. ValueBean info = new ValueBean(); info.setValue("0"); valueTest(info, true); }
/** * Tests the short validation failure. */ public void testShortBeyondMin() throws ValidatorException { // Create bean to run test on. ValueBean info = new ValueBean(); info.setValue(Short.MIN_VALUE + "1"); valueTest(info, false); }
/** * Tests the int validation failure. */ public void testIntBeyondMin() throws ValidatorException { // Create bean to run test on. ValueBean info = new ValueBean(); info.setValue(Integer.MIN_VALUE + "1"); valueTest(info, false); }
/** * Tests the int validation failure. */ public void testIntBeyondMax() throws ValidatorException { // Create bean to run test on. ValueBean info = new ValueBean(); info.setValue(Integer.MAX_VALUE + "1"); valueTest(info, false); }
/** * Tests the long validation failure. */ public void testLongBeyondMax() throws ValidatorException { // Create bean to run test on. ValueBean info = new ValueBean(); info.setValue(Long.MAX_VALUE + "1"); valueTest(info, false); }
/** * Tests the float validation. */ public void testFloat() throws ValidatorException { // Create bean to run test on. ValueBean info = new ValueBean(); info.setValue("0"); valueTest(info, true); }
/** * Tests the date validation. */ public void testInvalidDate() throws ValidatorException { // Create bean to run test on. ValueBean info = new ValueBean(); info.setValue("12/01as/2005"); valueTest(info, false); }
/** * Test that @localhost and @localhost.localdomain * addresses aren't declared valid by default */ public void testEmailLocalhost() throws ValidatorException { ValueBean info = new ValueBean(); info.setValue("joe@localhost"); valueTest(info, false); info.setValue("joe@localhost.localdomain"); valueTest(info, false); }
/** * Tests the email validation with numeric domains. */ public void testEmailWithNumericAddress() throws ValidatorException { ValueBean info = new ValueBean(); info.setValue("someone@[216.109.118.76]"); valueTest(info, true); info.setValue("someone@yahoo.com"); valueTest(info, true); }
/** * Tests the email validation with commas. */ public void testEmailWithCommas() throws ValidatorException { ValueBean info = new ValueBean(); info.setValue("joeblow@apa,che.org"); valueTest(info, false); info.setValue("joeblow@apache.o,rg"); valueTest(info, false); info.setValue("joeblow@apache,org"); valueTest(info, false); }