Package org.zanata.webtrans.client.history

Examples of org.zanata.webtrans.client.history.HistoryToken


    }

    @Test
    public void processBookmarkedTextFlowWhenThereIsNoTextFlowInHistoryUrl() {
        // Given: no text flow
        HistoryToken token = new HistoryToken();

        // When:
        service.processForBookmarkedTextFlow(token);

        // Then:
View Full Code Here


    }

    @Test
    public void processBookmarkedTextFlowWithInvalidTextFlowId() {
        // Given: text flow not in current document
        HistoryToken token = new HistoryToken();
        token.setTextFlowId("111");
        when(stateHolder.getPageCount()).thenReturn(10);
        when(stateHolder.getTargetPage(new TransUnitId(111))).thenReturn(
                NavigationService.UNDEFINED);

        // When:
View Full Code Here

    @Test
    public void processBookmarkedTextFlow() {
        // Given: everything works
        contextHolder.updateContext(new GetTransUnitActionContext(TestFixture
                .documentInfo(99, "")));
        HistoryToken token = new HistoryToken();
        token.setTextFlowId("111");
        when(stateHolder.getPageCount()).thenReturn(10);
        when(stateHolder.getTargetPage(new TransUnitId(111))).thenReturn(2);

        // When:
        service.processForBookmarkedTextFlow(token);
View Full Code Here

        verify(eventBus).fireEvent(Mockito.isA(BookmarkedTextFlowEvent.class));
    }

    @Test
    public void processMessageFilterOptions() {
        HistoryToken token = new HistoryToken();
        token.setFilterUntranslated(true);

        service.processMessageFilterOptions(token);

        verify(eventBus).fireEvent(
                UserConfigChangeEvent.EDITOR_CONFIG_CHANGE_EVENT);
View Full Code Here

    }

    @Test
    public void
            onProcessForDocumentListPresenterWillDoNothingIfHistoryNotChanged() {
        HistoryToken token = new HistoryToken();

        service.processForDocumentListPresenter(token);

        verifyZeroInteractions(documentListPresenter);
    }
View Full Code Here

        verifyZeroInteractions(documentListPresenter);
    }

    @Test
    public void onProcessForDocumentListPresenter() {
        HistoryToken token = new HistoryToken();
        token.setDocFilterCaseSensitive(false);
        token.setDocFilterExact(true);
        token.setDocFilterText("something");

        service.processForDocumentListPresenter(token);

        verify(documentListPresenter).updateFilterAndRun(
                token.getDocFilterText(), token.getDocFilterExact(),
                token.isDocFilterCaseSensitive());
    }
View Full Code Here

        verifyZeroInteractions(appPresenter);
    }

    @Test
    public void onProcessForAppPresenter() {
        HistoryToken token = new HistoryToken();
        token.setDocumentPath("doc/a.po");
        DocumentInfo document = TestFixture.documentInfo(99, "doc/a.po");
        when(documentListPresenter.getDocumentId("doc/a.po")).thenReturn(
                document.getId());
        when(documentListPresenter.getDocumentInfo(document.getId()))
                .thenReturn(document);
View Full Code Here

    }

    @Test
    public void onProcessForProjectWideSearchWillDoNothingIfHistoryNotChanged() {
        HistoryToken token = new HistoryToken();

        service.processForProjectWideSearch(token);

        verifyZeroInteractions(searchResultsPresenter);
    }
View Full Code Here

        verifyZeroInteractions(searchResultsPresenter);
    }

    @Test
    public void onProcessForProjectWideSearchWithoutReplacementTextChange() {
        HistoryToken token = new HistoryToken();
        token.setProjectSearchCaseSensitive(true);
        token.setProjectSearchInSource(false);
        token.setProjectSearchInTarget(true);
        token.setProjectSearchText("something");

        service.processForProjectWideSearch(token);

        verify(searchResultsPresenter).updateViewAndRun("something",
                token.getProjectSearchCaseSensitive(),
                token.isProjectSearchInSource(),
                token.isProjectSearchInTarget());
        verifyNoMoreInteractions(searchResultsPresenter);
    }
View Full Code Here

        verifyNoMoreInteractions(searchResultsPresenter);
    }

    @Test
    public void onProcessForProjectWideSearchWithReplacementTextChange() {
        HistoryToken token = new HistoryToken();
        token.setProjectSearchCaseSensitive(true);
        token.setProjectSearchInSource(false);
        token.setProjectSearchInTarget(true);
        token.setProjectSearchText("something");
        token.setProjectSearchReplacement("something else");

        service.processForProjectWideSearch(token);

        verify(searchResultsPresenter).updateViewAndRun("something",
                token.getProjectSearchCaseSensitive(),
                token.isProjectSearchInSource(),
                token.isProjectSearchInTarget());
        verify(searchResultsPresenter).updateReplacementText("something else");
    }
View Full Code Here

TOP

Related Classes of org.zanata.webtrans.client.history.HistoryToken

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.