Package org.zanata.webtrans.client.events

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


            factories.put(TransUnitUpdated.class,
                    new EventFactory<TransUnitUpdatedEvent>() {
                        @Override
                        public TransUnitUpdatedEvent create(
                                SessionEventData event) {
                            return new TransUnitUpdatedEvent(
                                    (HasTransUnitUpdatedData) event);
                        }
                    });

            factories.put(ExitWorkspace.class,
View Full Code Here


        when(updatedData.getEditorClientId()).thenReturn(editorClientId);
        when(updatedData.getUpdateType()).thenReturn(
                TransUnitUpdated.UpdateType.WebEditorSave);

        // When:
        service.onTransUnitUpdated(new TransUnitUpdatedEvent(updatedData));

        // Then:
        verify(pageDataChangeListener).refreshRow(updatedTU, editorClientId,
                TransUnitUpdated.UpdateType.WebEditorSave);
View Full Code Here

                TransUnit.Builder.from(data.get(data.size() - 1))
                        .setSourceComment("different").build();
        when(updatedData.getUpdateInfo().getTransUnit()).thenReturn(updatedTU);

        // When:
        service.onTransUnitUpdated(new TransUnitUpdatedEvent(updatedData));

        // Then:
        verifyZeroInteractions(pageDataChangeListener);
        assertThat(data.get(data.size() - 1).getSourceComment(),
                Matchers.not(Matchers.equalTo(updatedTU.getSourceComment())));
View Full Code Here

                        .defaultAnswer(RETURNS_DEEP_STUBS));
        when(updatedData.getUpdateInfo().getDocumentId()).thenReturn(
                initContext.getDocument().getId());

        // When:
        service.onTransUnitUpdated(new TransUnitUpdatedEvent(updatedData));

        // Then:
        verifyZeroInteractions(pageDataChangeListener);

    }
View Full Code Here

        when(display1.getId()).thenReturn(transUnits.get(0).getId());
        when(display2.getId()).thenReturn(transUnits.get(1).getId());
        presenter.showData(transUnits);

        // When:
        TransUnitUpdatedEvent event =
                mock(TransUnitUpdatedEvent.class, Mockito.RETURNS_DEEP_STUBS);
        TransUnit updated = TestFixture.makeTransUnit(1);
        when(event.getUpdateInfo().getTransUnit()).thenReturn(updated);

        presenter.onTransUnitUpdated(event);

        verify(display1).updateTransUnitDetails(updated);
        verify(display1).refresh();
View Full Code Here

                        .setVerNum(1).build();
        TransUnitUpdateInfo updateInfo =
                new TransUnitUpdateInfo(true, true, new DocumentId(2222L,
                        "match/exact/filter"), newTransUnit, 3, 0,
                        ContentState.NeedReview);
        TransUnitUpdatedEvent mockEvent = mock(TransUnitUpdatedEvent.class);

        when(mockEvent.getUpdateInfo()).thenReturn(updateInfo);

        documentListPresenter.bind();
        documentListPresenter.setDocuments(buildSampleDocumentArray());
        documentListPresenter.onTransUnitUpdated(mockEvent);
View Full Code Here

TOP

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

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.