Package org.zanata.webtrans.shared.rpc

Examples of org.zanata.webtrans.shared.rpc.UpdateGlossaryTermAction


            // check if there's any changes on the target term or the target
            // comments and save
            if (!display.getTargetText().getText()
                    .equals(selectedDetailEntry.getTarget())) {
                display.showLoading(true);
                UpdateGlossaryTermAction action =
                        new UpdateGlossaryTermAction(selectedDetailEntry,
                                display.getTargetText().getText(),
                                display.getCurrentTargetComments());

                dispatcher.execute(action,
                        new AsyncCallback<UpdateGlossaryTermResult>() {
View Full Code Here


    public void testExecute() throws Exception {
        GlossaryDetails selectedDetailEntry =
                new GlossaryDetails("source", "target", null, null,
                        "sourceRef", srcLocale.getLocaleId(),
                        targetHLocale.getLocaleId(), 0, new Date());
        UpdateGlossaryTermAction action =
                new UpdateGlossaryTermAction(selectedDetailEntry, "new target",
                        Lists.newArrayList("new comment"));
        when(
                glossaryDAO.getEntryBySrcLocaleAndContent(
                        selectedDetailEntry.getSrcLocale(),
                        selectedDetailEntry.getSource())).thenReturn(
View Full Code Here

    public void testExecuteWhenTargetTermNotFound() throws Exception {
        GlossaryDetails selectedDetailEntry =
                new GlossaryDetails("source", "target", null, null,
                        "sourceRef", srcLocale.getLocaleId(),
                        targetHLocale.getLocaleId(), 0, new Date());
        UpdateGlossaryTermAction action =
                new UpdateGlossaryTermAction(selectedDetailEntry, "new target",
                        Lists.newArrayList("new comment"));
        when(
                glossaryDAO.getEntryBySrcLocaleAndContent(
                        selectedDetailEntry.getSrcLocale(),
                        selectedDetailEntry.getSource())).thenReturn(
View Full Code Here

    public void testExecuteWhenTargetTermVersionNotMatch() throws Exception {
        GlossaryDetails selectedDetailEntry =
                new GlossaryDetails("source", "target", null, null,
                        "sourceRef", srcLocale.getLocaleId(),
                        targetHLocale.getLocaleId(), 0, new Date());
        UpdateGlossaryTermAction action =
                new UpdateGlossaryTermAction(selectedDetailEntry, "new target",
                        Lists.newArrayList("new comment"));
        when(
                glossaryDAO.getEntryBySrcLocaleAndContent(
                        selectedDetailEntry.getSrcLocale(),
                        selectedDetailEntry.getSource())).thenReturn(
View Full Code Here

        glossaryDetailsPresenter.onSaveClick();

        verify(display).showLoading(true);
        verify(mockDispatcher).execute(updateGlossaryTermCaptor.capture(),
                updateGlossarycallbackCaptor.capture());
        UpdateGlossaryTermAction glossaryTermAction =
                updateGlossaryTermCaptor.getValue();
        assertThat(glossaryTermAction.getNewTargetComment(),
                Matchers.equalTo(targetComments));
        assertThat(glossaryTermAction.getNewTargetTerm(),
                Matchers.equalTo(newTargetText));
        assertThat(glossaryTermAction.getSelectedDetailEntry(),
                Matchers.equalTo(glossaryDetails));
    }
View Full Code Here

TOP

Related Classes of org.zanata.webtrans.shared.rpc.UpdateGlossaryTermAction

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.