Package org.openengsb.ui.common.editor

Examples of org.openengsb.ui.common.editor.NumberValidator.validate()


public class NumberValidatorTest {

    @Test
    public void testPassLetterInsteadOfNumber_shouldNotValidateAndGiveErrorMessage() throws Exception {
        NumberValidator numberValidator = new NumberValidator();
        SingleAttributeValidationResult validate = numberValidator.validate("A");
        assertFalse(validate.isValid());
        assertEquals("validation.number.formating", validate.getErrorMessageId());
    }

    // TODO: [OPENENGSB-1250] public void testUsingGermanLocale_shouldReturnGermanMessage() {
View Full Code Here


    // TODO: [OPENENGSB-1250] public void testUsingEnglishLocale_shouldReturnEnglishMessage()

    @Test
    public void testValidateNumber_shouldReturnValidAndNoErrorMessage() throws Exception {
        NumberValidator validator = new NumberValidator();
        SingleAttributeValidationResult validate = validator.validate("123");
        assertTrue(validate.isValid());
        assertEquals("", validate.getErrorMessageId());
    }
}
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.