Examples of InvalidDataException


Examples of com.cedarsolutions.exception.InvalidDataException

    /** 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

Examples of com.cedarsolutions.exception.InvalidDataException

    /** 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());
        assertEquals("__detailKey1", view.validationErrorWidget.getErrorList().get(0));
View Full Code Here

Examples of com.cedarsolutions.exception.InvalidDataException

    /** Test showValidationError(), with message, with summary but no fields. */
    public void testShowValidationError7() {
        View view = new View();
        ValidationErrors details = new ValidationErrors();
        details.setSummary(new LocalizableMessage("summaryKey1", "summaryText1"));
        InvalidDataException error = new InvalidDataException("message", details);
        ValidationUtils.getInstance().showValidationError(view, error, "style");
        assertTrue(view.validationErrorWidget.isVisible());
        assertEquals("__summaryKey1", view.validationErrorWidget.getErrorSummary());
        assertTrue(view.validationErrorWidget.getErrorList().isEmpty());

        view = new View();
        details = new ValidationErrors();
        details.setSummary(new LocalizableMessage("", "summaryText1"));
        error = new InvalidDataException("message", details);
        ValidationUtils.getInstance().showValidationError(view, error, "style");
        assertTrue(view.validationErrorWidget.isVisible());
        assertEquals("summaryText1", view.validationErrorWidget.getErrorSummary());
        assertTrue(view.validationErrorWidget.getErrorList().isEmpty());
    }
View Full Code Here

Examples of com.cedarsolutions.exception.InvalidDataException

    public void testShowValidationError8() {
        View view = new View();
        ValidationErrors details = new ValidationErrors();
        details.setSummary(new LocalizableMessage("summaryKey1", "summaryText1"));
        details.addMessage("detailKey1", "fieldX", "detailText1");
        InvalidDataException error = new InvalidDataException("message", details);
        ValidationUtils.getInstance().showValidationError(view, error, "style");
        assertTrue(view.validationErrorWidget.isVisible());
        assertEquals("__summaryKey1", view.validationErrorWidget.getErrorSummary());
        assertEquals(1, view.validationErrorWidget.getErrorList().size());
        assertEquals("__detailKey1", view.validationErrorWidget.getErrorList().get(0));    }
View Full Code Here

Examples of com.cedarsolutions.exception.InvalidDataException

    public void testShowValidationError9() {
        View view = new View();
        ValidationErrors details = new ValidationErrors();
        details.setSummary(new LocalizableMessage("summaryKey1", "summaryText1"));
        details.addMessage("detailKey1", "field1", "detailText1");
        InvalidDataException error = new InvalidDataException("message", details);
        ValidationUtils.getInstance().showValidationError(view, error, "style");
        assertTrue(view.validationErrorWidget.isVisible());
        assertEquals("__summaryKey1", view.validationErrorWidget.getErrorSummary());
        assertEquals(1, view.validationErrorWidget.getErrorList().size());
        assertEquals("__detailKey1", view.validationErrorWidget.getErrorList().get(0));
View Full Code Here

Examples of com.cedarsolutions.exception.InvalidDataException

        View view = new View();
        ValidationErrors details = new ValidationErrors();
        details.setSummary(new LocalizableMessage("summaryKey1", "summaryText1"));
        details.addMessage("detailKey1", "field1", "detailText1");
        details.addMessage("detailKey2", "field2", "detailText2");
        InvalidDataException error = new InvalidDataException("message", details);
        ValidationUtils.getInstance().showValidationError(view, error, "style");
        assertTrue(view.validationErrorWidget.isVisible());
        assertEquals("__summaryKey1", view.validationErrorWidget.getErrorSummary());
        assertEquals(2, view.validationErrorWidget.getErrorList().size());
        assertEquals("__detailKey1", view.validationErrorWidget.getErrorList().get(0));
View Full Code Here

Examples of com.cedarsolutions.exception.InvalidDataException

        ValidationErrors details = new ValidationErrors();
        details.setSummary(new LocalizableMessage("summaryKey1", "summaryText1"));
        details.addMessage("detailKey1", "field1", "detailText1");
        details.addMessage("detailKey2", "field2", "detailText2");
        details.addMessage("detailKey3", "field3", "detailText3");
        InvalidDataException error = new InvalidDataException("message", details);
        ValidationUtils.getInstance().showValidationError(view, error, "style");
        assertTrue(view.validationErrorWidget.isVisible());
        assertEquals("__summaryKey1", view.validationErrorWidget.getErrorSummary());
        assertEquals(3, view.validationErrorWidget.getErrorList().size());
        assertEquals("__detailKey1", view.validationErrorWidget.getErrorList().get(0));
View Full Code Here

Examples of com.cedarsolutions.exception.InvalidDataException

        verify(caller).onSuccessResult("hello");
    }

    /** Test onFailure(), validation error, handled by child. */
    @Test public void testOnFailureValidationHandled() {
        InvalidDataException caught = new InvalidDataException("caught");

        IRpcCaller<String> caller = mock(IRpcCaller.class);
        when(caller.getDescriptiveCallerId()).thenReturn("Caller");
        when(caller.getDescriptiveCallState()).thenReturn(" (1 of 2)");
        when(caller.getElapsedTime()).thenReturn(", elapsed");
View Full Code Here

Examples of com.cedarsolutions.exception.InvalidDataException

        verify(caller).log("Caller: validation error (1 of 2), elapsed");
    }

    /** Test onFailure(), validation error, not handled by child, no retry allowed. */
    @Test public void testOnFailureValidationNotHandledNoRetryAllowed() {
        InvalidDataException caught = new InvalidDataException("caught");

        IRpcCaller<String> caller = mock(IRpcCaller.class);
        when(caller.getDescriptiveCallerId()).thenReturn("Caller");
        when(caller.getDescriptiveCallState()).thenReturn(" (1 of 2)");
        when(caller.getElapsedTime()).thenReturn(", elapsed");
View Full Code Here

Examples of com.cedarsolutions.exception.InvalidDataException

        verify(caller).onUnhandledError(caught);
    }

    /** Test onFailure(), validation error, not handled by child, retry allowed. */
    @Test public void testOnFailureValidationNotHandledRetryAllowed() {
        InvalidDataException caught = new InvalidDataException("caught");

        IRpcCaller<String> caller = mock(IRpcCaller.class);
        when(caller.getDescriptiveCallerId()).thenReturn("Caller");
        when(caller.getDescriptiveCallState()).thenReturn(" (1 of 2)");
        when(caller.getElapsedTime()).thenReturn(", elapsed");
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.