Package org.zanata.webtrans.shared.model

Examples of org.zanata.webtrans.shared.model.TransUnitId


        when(panelSessionItem.getPerson()).thenReturn(person);
        EditorClientId ourClientId = new EditorClientId("another client id", 2);
        when(identity.getEditorClientId()).thenReturn(ourClientId);

        // When:
        editorTranslators.updateTranslator(display, new TransUnitId(1));

        // Then:
        verify(display).addTranslator("admin", "red");
        verify(display).addTranslator("admin", "red");
    }
View Full Code Here


        when(panelSessionItem.getPerson()).thenReturn(person);
        EditorClientId ourClientId = new EditorClientId("another client id", 2);
        when(identity.getEditorClientId()).thenReturn(ourClientId);

        // When:
        editorTranslators.updateTranslator(display, new TransUnitId(2)); // different
                                                                         // id

        // Then:
        verify(display).removeTranslator("admin", "red");
        verify(display).removeTranslator("admin", "red");
View Full Code Here

                        .put(editorClientId, panelSessionItem).build();
        when(sessionService.getUserSessionMap()).thenReturn(sessionMap);
        when(panelSessionItem.getSelectedId()).thenReturn(null);

        // When:
        editorTranslators.updateTranslator(display, new TransUnitId(1));

        // Then:
        verifyZeroInteractions(editor1, editor2);
    }
View Full Code Here

    }

    @Test
    public void onSaveChangeAndFilter() {
        when(targetContentsPresenter.getCurrentTransUnitIdOrNull()).thenReturn(
                new TransUnitId(1));

        presenter.saveAsTranslatedAndFilter();

        verify(targetContentsPresenter).saveCurrentIfValid(
                ContentState.Translated);
View Full Code Here

    }

    @Test
    public void onSaveAsFuzzyAndFilter() {
        when(targetContentsPresenter.getCurrentTransUnitIdOrNull()).thenReturn(
                new TransUnitId(1));

        presenter.saveAsFuzzyAndFilter();

        verify(targetContentsPresenter).saveCurrentIfValid(
                ContentState.NeedReview);
View Full Code Here

        verify(navigationService).execute(Mockito.isA(FilterViewEvent.class));
    }

    @Test
    public void onDiscardChangeAndFilter() {
        TransUnitId currentId = new TransUnitId(1);
        when(targetContentsPresenter.getCurrentTransUnitIdOrNull()).thenReturn(
                currentId);

        presenter.discardChangesAndFilter();
View Full Code Here

        // from another user
        EditorClientId editorClientId = new EditorClientId("session", 1);
        when(translatorService.getCurrentEditorClientId()).thenReturn(
                editorClientId);
        TransUnit updatedTransUnit = TestFixture.makeTransUnit(1);
        presenter.setStateForTesting(new TransUnitId(99));

        // When: update type is save and done by different user
        presenter.refreshRow(updatedTransUnit,
                new EditorClientId("session", 2),
                TransUnitUpdated.UpdateType.WebEditorSave);
View Full Code Here

    @Test
    public void onTableRowSelectingSameRow() {
        // Given: selecting id is on row index 2, and current selected row index
        // is also 2
        TransUnitId selectingId = new TransUnitId(1);
        when(navigationService.findRowIndexById(selectingId)).thenReturn(2);
        when(navigationService.getCurrentRowIndexOnPage()).thenReturn(2);

        // When:
        presenter.onTableRowSelected(new TableRowSelectedEvent(selectingId));
View Full Code Here

    @Test
    public void onTableRowSelectingDifferentRow() {
        // Given: selecting id is on row index 2, and current selected row index
        // is 3
        TransUnitId selectingId = new TransUnitId(1);
        when(navigationService.findRowIndexById(selectingId)).thenReturn(2);
        when(navigationService.getCurrentRowIndexOnPage()).thenReturn(3);

        // When:
        presenter.onTableRowSelected(new TableRowSelectedEvent(selectingId));
View Full Code Here

    @Test
    public void onTableRowSelectingDifferentRowAndSuppressSavePending() {
        // Given: selecting id is on row index 2, and current selected row index
        // is 3
        TransUnitId selectingId = new TransUnitId(1);
        when(navigationService.findRowIndexById(selectingId)).thenReturn(2);
        when(navigationService.getCurrentRowIndexOnPage()).thenReturn(3);

        // When:
        presenter.onTableRowSelected(new TableRowSelectedEvent(selectingId)
View Full Code Here

TOP

Related Classes of org.zanata.webtrans.shared.model.TransUnitId

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.