Examples of ValidatedDouble


Examples of net.sf.validatedattrib.attribute.primitive.ValidatedDouble

public class ValidatedDoubleTest extends TestCase {
   
    public void testSetValue() throws ValidationException {
        double value = 200;
       
        ValidatedDouble validatedDouble = new ValidatedDouble();
        validatedDouble.setValue(value);
        assertTrue(validatedDouble.getValue() == value);
       
        validatedDouble.addConstraint(new ValidatedDoubleMinMaxConstraint(10, 100));
        validatedDouble.setValue(10);
       
        try {
            validatedDouble.setValue(101);
            fail("This should throw an ValidationException!");
        } catch (ValidationException e) {
            // ok
        }
    }
View Full Code Here

Examples of net.sf.validatedattrib.attribute.primitive.ValidatedDouble

            // ok
        }
    }
   
    public void testAddConstraint() {
        ValidatedDouble validatedDouble = new ValidatedDouble();
        try {
            validatedDouble.addConstraint(null);
            fail("Should throw NullPointerException!");
        } catch (NullPointerException e) {
            // ok
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.