Package org.zanata.webtrans.client.events

Examples of org.zanata.webtrans.client.events.NotificationEvent


        ArgumentCaptor<NotificationEvent> notificationEventCaptor =
                ArgumentCaptor.forClass(NotificationEvent.class);
        verify(targetContentsPresenter).setEditingState(TRANS_UNIT_ID,
                TargetContentsDisplay.EditingState.UNSAVED);
        verify(eventBus).fireEvent(notificationEventCaptor.capture());
        NotificationEvent event = notificationEventCaptor.getValue();
        assertThat(event.getSeverity(), is(NotificationEvent.Severity.Error));
        assertThat(event.getMessage(), equalTo("update failed"));
        assertThat(event.getInlineLink(),
                Matchers.<InlineLink> sameInstance(goToLink));
    }
View Full Code Here


        int msgCount = 5;
        String msg = "Test message";
        String details = "Test details";
        Severity severity = Severity.Info;

        NotificationEvent mockEvent = mock(NotificationEvent.class);
        InlineLink mockInlineLink = mock(InlineLink.class);

        when(mockDisplay.getMessageCount()).thenReturn(msgCount);
        when(mockEvent.getSeverity()).thenReturn(severity);
        when(mockEvent.getMessage()).thenReturn(msg);
        when(mockEvent.getDetails()).thenReturn(details);
        when(mockEvent.getInlineLink()).thenReturn(mockInlineLink);

        notificationPresenter.bind();
        notificationPresenter.setNotificationListener(mockListener);
        notificationPresenter.onNotification(mockEvent);
View Full Code Here

        int msgCount = 5;
        String msg = "Test message";
        String details = "Test details";
        Severity severity = Severity.Error;

        NotificationEvent mockEvent = mock(NotificationEvent.class);
        InlineLink mockInlineLink = mock(InlineLink.class);

        when(mockDisplay.getMessageCount()).thenReturn(msgCount);
        when(mockEvent.getSeverity()).thenReturn(severity);
        when(mockEvent.getMessage()).thenReturn(msg);
        when(mockEvent.getDetails()).thenReturn(details);
        when(mockEvent.getInlineLink()).thenReturn(mockInlineLink);

        notificationPresenter.setNotificationListener(mockListener);
        notificationPresenter.onNotification(mockEvent);

        verify(mockDisplay).appendMessage(mockEvent);
View Full Code Here

        int msgCount = 200;
        String msg = "Test message";
        String details = "Msg details";
        Severity severity = Severity.Info;

        NotificationEvent mockEvent = mock(NotificationEvent.class);
        InlineLink mockInlineLink = mock(InlineLink.class);

        // when(mockDisplay.getMessageCount()).thenReturn(msgCount);
        when(mockEvent.getSeverity()).thenReturn(severity);
        when(mockEvent.getMessage()).thenReturn(msg);
        when(mockEvent.getDetails()).thenReturn(details);
        when(mockEvent.getInlineLink()).thenReturn(mockInlineLink);

        notificationPresenter.setNotificationListener(mockListener);
        for (int i = 0; i < msgCount; i++) {
            notificationPresenter.onNotification(mockEvent);
        }
View Full Code Here

        // Then:
        verify(messages).mergeTMFailed();
        verify(eventBus).fireEvent(notificationEventCaptor.capture());
        verify(display).hide();
        NotificationEvent event = notificationEventCaptor.getValue();
        assertThat(event.getSeverity(),
                Matchers.equalTo(NotificationEvent.Severity.Error));
        assertThat(event.getMessage(),
                Matchers.sameInstance(messages.mergeTMFailed()));
    }
View Full Code Here

        // Then:
        verify(messages).mergeTMSuccess(Lists.newArrayList("1", "3", "4"));
        verify(eventBus).fireEvent(notificationEventCaptor.capture());
        verify(display).hide();
        NotificationEvent event = notificationEventCaptor.getValue();
        assertThat(event.getSeverity(),
                Matchers.equalTo(NotificationEvent.Severity.Info));
        assertThat(event.getMessage(), Matchers.sameInstance(messages
                .mergeTMSuccess(Lists.newArrayList("1", "3", "4"))));
        assertThat(event.getInlineLink(),
                Matchers.<InlineLink> sameInstance(undoLink));
        verify(undoLink).prepareUndoFor(result);
    }
View Full Code Here

        // Then:
        verify(messages).noTranslationToMerge();
        verify(eventBus).fireEvent(notificationEventCaptor.capture());
        verify(display).hide();
        NotificationEvent event = notificationEventCaptor.getValue();
        assertThat(event.getSeverity(),
                Matchers.equalTo(NotificationEvent.Severity.Info));
        assertThat(event.getMessage(),
                Matchers.sameInstance(messages.noTranslationToMerge()));
        assertThat(event.getInlineLink(), Matchers.nullValue());
    }
View Full Code Here

TOP

Related Classes of org.zanata.webtrans.client.events.NotificationEvent

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.