Package com.netflix.config.validation

Examples of com.netflix.config.validation.ValidationException


   
    @Test
    public void testValidation() {
        DynamicStringProperty prop = new DynamicStringProperty("abc", "default") {
            public void validate(String newValue) {
                throw new ValidationException("failed");
            }
        };
        try {
            ConfigurationManager.getConfigInstance().setProperty("abc", "new");
            fail("ValidationException expected");
View Full Code Here


        DynamicIntProperty validatedProp = new DynamicIntProperty("abc", 0) {
            @Override
            public void validate(String newValue) {
                if (Integer.parseInt(newValue) < 0) {
                    throw new ValidationException("Cannot be negative");
                }
            }
        };
        assertEquals(0, validatedProp.get());
        assertFalse(propertyChanged);
View Full Code Here

            try {
                v.validate(newValue);
            } catch (ValidationException e) {
                throw e;
            } catch (Throwable e) {
                throw new ValidationException("Unexpected exception during validation", e);
            }
        }
    }
View Full Code Here

TOP

Related Classes of com.netflix.config.validation.ValidationException

Copyright © 2018 www.massapicom. 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.