Package com.cedarsolutions.shared.domain

Examples of com.cedarsolutions.shared.domain.ValidationErrors.addMessage()


    }

    /** Test assertOnlyMessage(). */
    @Test public void testAssertOnlyMessage() {
        ValidationErrors details1 = new ValidationErrors();
        details1.addMessage("key1", null);
        InvalidDataException e1 = new InvalidDataException("message1", details1);

        ValidationErrors details2 = new ValidationErrors();
        details2.addMessage("key2", "context2", null);
        InvalidDataException e2 = new InvalidDataException("message2", details2);
View Full Code Here


        ValidationErrors details1 = new ValidationErrors();
        details1.addMessage("key1", null);
        InvalidDataException e1 = new InvalidDataException("message1", details1);

        ValidationErrors details2 = new ValidationErrors();
        details2.addMessage("key2", "context2", null);
        InvalidDataException e2 = new InvalidDataException("message2", details2);

        ValidationErrors details3 = new ValidationErrors();
        details3.addMessage("key3a", "context3a", null);
        details3.addMessage("key3b", null);
View Full Code Here

        ValidationErrors details2 = new ValidationErrors();
        details2.addMessage("key2", "context2", null);
        InvalidDataException e2 = new InvalidDataException("message2", details2);

        ValidationErrors details3 = new ValidationErrors();
        details3.addMessage("key3a", "context3a", null);
        details3.addMessage("key3b", null);
        InvalidDataException e3 = new InvalidDataException("message3", details3);

        assertOnlyMessage(e1, "key1");
        assertOnlyMessage(e1, "key1", null);
View Full Code Here

        details2.addMessage("key2", "context2", null);
        InvalidDataException e2 = new InvalidDataException("message2", details2);

        ValidationErrors details3 = new ValidationErrors();
        details3.addMessage("key3a", "context3a", null);
        details3.addMessage("key3b", null);
        InvalidDataException e3 = new InvalidDataException("message3", details3);

        assertOnlyMessage(e1, "key1");
        assertOnlyMessage(e1, "key1", null);
        assertOnlyMessage(e2, "key2", "context2");
View Full Code Here

    }

    /** Test assertContainsMessage(). */
    @Test public void testAssertContainsMessage() {
        ValidationErrors details1 = new ValidationErrors();
        details1.addMessage("key1", null);
        InvalidDataException e1 = new InvalidDataException("message1", details1);

        ValidationErrors details2 = new ValidationErrors();
        details2.addMessage("key2", "context2", null);
        InvalidDataException e2 = new InvalidDataException("message2", details2);
View Full Code Here

        ValidationErrors details1 = new ValidationErrors();
        details1.addMessage("key1", null);
        InvalidDataException e1 = new InvalidDataException("message1", details1);

        ValidationErrors details2 = new ValidationErrors();
        details2.addMessage("key2", "context2", null);
        InvalidDataException e2 = new InvalidDataException("message2", details2);

        ValidationErrors details3 = new ValidationErrors();
        details3.addMessage("key3a", "context3a", null);
        details3.addMessage("key3b", null);
View Full Code Here

        ValidationErrors details2 = new ValidationErrors();
        details2.addMessage("key2", "context2", null);
        InvalidDataException e2 = new InvalidDataException("message2", details2);

        ValidationErrors details3 = new ValidationErrors();
        details3.addMessage("key3a", "context3a", null);
        details3.addMessage("key3b", null);
        InvalidDataException e3 = new InvalidDataException("message3", details3);

        assertContainsMessage(e1, "key1");
        assertContainsMessage(e1, "key1", null);
View Full Code Here

        details2.addMessage("key2", "context2", null);
        InvalidDataException e2 = new InvalidDataException("message2", details2);

        ValidationErrors details3 = new ValidationErrors();
        details3.addMessage("key3a", "context3a", null);
        details3.addMessage("key3b", null);
        InvalidDataException e3 = new InvalidDataException("message3", details3);

        assertContainsMessage(e1, "key1");
        assertContainsMessage(e1, "key1", null);
        assertContainsMessage(e2, "key2", "context2");
View Full Code Here

    /** Test showValidationError(), with message, no summary and unknown field. */
    public void testShowValidationError5() {
        View view = new View();
        ValidationErrors details = new ValidationErrors();
        details.addMessage("detailKey1", "fieldX", "detailText1");
        InvalidDataException error = new InvalidDataException("message", details);
        ValidationUtils.getInstance().showValidationError(view, error, "style");
        assertTrue(view.validationErrorWidget.isVisible());
        assertEquals(1, view.validationErrorWidget.getErrorList().size());
        assertEquals("__detailKey1", view.validationErrorWidget.getErrorList().get(0));
View Full Code Here

    /** Test showValidationError(), with message, no summary but valid field. */
    public void testShowValidationError6() {
        View view = new View();
        ValidationErrors details = new ValidationErrors();
        details.addMessage("detailKey1", "field1", "detailText1");
        InvalidDataException error = new InvalidDataException("message", details);
        ValidationUtils.getInstance().showValidationError(view, error, "style");
        assertTrue(view.validationErrorWidget.isVisible());
        assertEquals("", view.validationErrorWidget.getErrorSummary());
        assertEquals(1, view.validationErrorWidget.getErrorList().size());
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.