Package org.zanata.webtrans.shared.rpc

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


        }

        targetContentsPresenter.setEditingState(idToSave,
                TargetContentsDisplay.EditingState.SAVING);

        UpdateTransUnit updateTransUnit =
                new UpdateTransUnit(new TransUnitUpdateRequest(idToSave,
                        forSaving.getTargets(), forSaving.getAdjustedStatus(),
                        forSaving.getVerNum()),
                        TransUnitUpdated.UpdateType.WebEditorSave);
        Log.info("about to save translation: " + updateTransUnit);
        dispatcher.execute(
View Full Code Here


            AsyncCallback<GetGlossaryResult> _callback =
                    (AsyncCallback<GetGlossaryResult>) callback;
            Scheduler.get().scheduleDeferred(
                    new DummyGetGlossaryCommand(_action, _callback));
        } else if (action instanceof UpdateTransUnit) {
            final UpdateTransUnit _action = (UpdateTransUnit) action;
            AsyncCallback<UpdateTransUnitResult> _callback =
                    (AsyncCallback<UpdateTransUnitResult>) callback;
            Scheduler.get().scheduleDeferred(
                    new DummyUpdateTransUnitCommand(_action, _callback));
        } else if (action instanceof GetTransMemoryDetailsAction) {
View Full Code Here

        // Then:
        verify(dispatcher).execute(actionCaptor.capture(),
                resultCaptor.capture());

        UpdateTransUnit updateTransUnit = actionCaptor.getValue();
        assertThat(updateTransUnit.getUpdateRequests(), hasSize(1));
        assertThat(updateTransUnit.getUpdateType(),
                equalTo(TransUnitUpdated.UpdateType.WebEditorSave));

        TransUnitUpdateRequest request =
                updateTransUnit.getUpdateRequests().get(0);
        assertThat(request.getTransUnitId(), equalTo(TRANS_UNIT_ID));
        assertThat(request.getNewContents(), Matchers.contains("new content"));
        assertThat(request.getBaseTranslationVersion(), equalTo(VER_NUM));
        assertThat(request.getNewContentState(), equalTo(ContentState.Approved));
    }
View Full Code Here

        // Then:
        verify(dispatcher).execute(actionCaptor.capture(),
                resultCaptor.capture());

        UpdateTransUnit updateTransUnit = actionCaptor.getValue();
        assertThat(updateTransUnit.getUpdateRequests(), hasSize(1));
        assertThat(updateTransUnit.getUpdateType(),
                equalTo(TransUnitUpdated.UpdateType.WebEditorSave));

        TransUnitUpdateRequest request =
                updateTransUnit.getUpdateRequests().get(0);
        assertThat(request.getTransUnitId(), equalTo(TRANS_UNIT_ID));
        assertThat(request.getNewContents(), Matchers.contains("new content"));
        assertThat(request.getBaseTranslationVersion(), equalTo(VER_NUM));
        assertThat(request.getNewContentState(), equalTo(ContentState.Approved));
View Full Code Here

        Long textFlowId = hTextFlow.getId();
        int versionNum = 0; // no previous translation

        // Translate using webtrans
        UpdateType updateType = UpdateType.WebEditorSave;
        UpdateTransUnit action =
                new UpdateTransUnit(new TransUnitUpdateRequest(new TransUnitId(
                        textFlowId), Lists.newArrayList(translation),
                        translationState, versionNum), updateType);
        action.setWorkspaceId(workspaceId);

        UpdateTransUnitResult result = transUnitHandler.execute(action, null);

        assertThat(result.isSingleSuccess(), is(true));
        verify(mockIdentity).checkLoggedIn();
View Full Code Here

        verify(dispatcher, times(2)).execute(actionCaptor.capture(),
                resultCaptor.capture());

        // Then: we have 3 action here just because we verify dispatcher twice
        assertThat(actionCaptor.getAllValues(), Matchers.hasSize(3));
        UpdateTransUnit secondRequest = actionCaptor.getAllValues().get(2);
        assertThat(secondRequest.getUpdateRequests().get(0).getNewContents(),
                Matchers.contains("newer content"));
    }
View Full Code Here

TOP

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

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.