Examples of toTokenString()


Examples of org.zanata.webtrans.client.history.HistoryToken.toTokenString()

        token.setDocFilterText("doc filter test");
        token.setProjectSearchText("project search text");
        token.setDocumentPath("doc/path");
        token.setProjectSearchReplacement("replacement");
        token.setTextFlowId("1");
        when(historyChangeEvent.getValue()).thenReturn(token.toTokenString());
        DocumentInfo documentInfo = TestFixture.documentInfo(1, "doc/path");
        DocumentId documentId = documentInfo.getId();
        when(documentListPresenter.getDocumentId("doc/path")).thenReturn(
                documentId);
        when(documentListPresenter.getDocumentInfo(documentId)).thenReturn(
View Full Code Here

Examples of org.zanata.webtrans.client.history.HistoryToken.toTokenString()

        // doc key handler
        HistoryToken docToken = new HistoryToken();
        when(history.getHistoryToken()).thenReturn(docToken);
        docListKey.getHandler().onKeyShortcut(null);
        assertThat(docToken.getView(), Matchers.is(MainView.Documents));
        verify(history).newItem(docToken.toTokenString());

        // editor key handler on selected doc is null
        when(messages.noDocumentSelected()).thenReturn("no doc selected");
        editorKey.getHandler().onKeyShortcut(null);
        verify(eventBus).fireEvent(isA(NotificationEvent.class));
View Full Code Here

Examples of org.zanata.webtrans.client.history.HistoryToken.toTokenString()

        DocumentInfo selectedDocument = mock(DocumentInfo.class);
        presenter.setStatesForTest(null, null, MainView.Documents,
                selectedDocument);
        editorKey.getHandler().onKeyShortcut(null);
        assertThat(editorToken.getView(), Matchers.is(MainView.Editor));
        verify(history).newItem(editorToken.toTokenString());

        // search key handler
        HistoryToken searchToken = new HistoryToken();
        when(history.getHistoryToken()).thenReturn(searchToken);
        searchKey.getHandler().onKeyShortcut(null);
View Full Code Here

Examples of org.zanata.webtrans.client.history.HistoryToken.toTokenString()

        // search key handler
        HistoryToken searchToken = new HistoryToken();
        when(history.getHistoryToken()).thenReturn(searchToken);
        searchKey.getHandler().onKeyShortcut(null);
        assertThat(searchToken.getView(), Matchers.is(MainView.Search));
        verify(history).newItem(searchToken.toTokenString());
    }

    @Test
    public void onShowSideMenu() {
        presenter.onShowSideMenu(new ShowSideMenuEvent(true));
View Full Code Here

Examples of org.zanata.webtrans.client.history.HistoryToken.toTokenString()

        HistoryToken exactSearchToken = new HistoryToken();
        exactSearchToken.setDocFilterExact(true);
        assertThat(
                "checking the 'exact search' checkbox should be reflected in a new history token",
                capturedHistoryTokenString.getValue(),
                is(exactSearchToken.toTokenString()));
    }

    @Test
    public void uncheckExactSearchCheckboxGeneratesHistoryToken() {
        // history reflects checkbox already checked
View Full Code Here

Examples of org.zanata.webtrans.client.history.HistoryToken.toTokenString()

        // history reflects checkbox already checked
        HistoryToken exactSearchToken = new HistoryToken();
        exactSearchToken.setDocFilterExact(true);

        when(mockHistory.getToken()).thenReturn(
                exactSearchToken.toTokenString());

        documentListPresenter.bind();
        documentListPresenter.fireExactSearchToken(false);

        verify(mockHistory).newItem(capturedHistoryTokenString.capture());
View Full Code Here

Examples of org.zanata.webtrans.client.history.HistoryToken.toTokenString()

        HistoryToken inexactSearchToken = new HistoryToken();
        inexactSearchToken.setDocFilterExact(false);
        assertThat(
                "unchecking the 'exact search' checkbox should be reflected in a new history token",
                capturedHistoryTokenString.getValue(),
                is(inexactSearchToken.toTokenString()));
    }

    // TODO tests for check and uncheck case sensitive check

    @Test
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.