Package com.adito.boot

Examples of com.adito.boot.DefaultPropertyDefinition.validate()


    @Test
    public void defaultBooleanPropertyDefinitionWithNoValidator() {
        DefaultPropertyDefinition def = new DefaultPropertyDefinition(DefaultPropertyDefinition.TYPE_BOOLEAN, "bool1", "on,off",
                        10, "on", 50, "test", true, "com.adito.input.validators.BooleanValidator", null, null);
        try {
            def.validate("off", getClass().getClassLoader());
        } catch (CodedException ce) {
            Assert.fail("Validation failed when it shouldn't.");
        }
    }
View Full Code Here


    @Test
    public void defaultIntegerPropertyDefinitionWithDefaultValidator() {
        DefaultPropertyDefinition def = new DefaultPropertyDefinition(DefaultPropertyDefinition.TYPE_INTEGER, "int1", "", 10, "5",
                        50, "test", true, "com.adito.input.validators.IntegerValidator", null, null);
        try {
            def.validate("10", getClass().getClassLoader());
        }
        catch(CodedException ce) {
            Assert.fail("Validation failed when it shouldn't.");
        }       
        try {
View Full Code Here

        }
        catch(CodedException ce) {
            Assert.fail("Validation failed when it shouldn't.");
        }       
        try {
            def.validate("10000000000000", getClass().getClassLoader());
            Assert.fail("Validation didn't fail when it should.");
        }
        catch(CodedException ce) {
        }
    }
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.