Examples of UpdateTransUnitResult


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

        when(
                translationServiceImpl.revertTranslations(LocaleId.EN_US,
                        action.getUpdatesToRevert())).thenReturn(
                Lists.newArrayList(translationResult));

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

        assertThat(result.getUpdateInfoList(), Matchers.hasSize(1));
        assertThat(result.getUpdateInfoList().get(0).getPreviousState(),
                Matchers.equalTo(ContentState.NeedReview));
    }
View Full Code Here

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

                        .setSources(firstTu.getNewContents()).build();
        TransUnitUpdateInfo updateInfo =
                new TransUnitUpdateInfo(true, true, new DocumentId(new Long(0),
                        ""), tu, 5, firstTu.getBaseTranslationVersion(),
                        ContentState.NeedReview);
        UpdateTransUnitResult result = new UpdateTransUnitResult(updateInfo);
        callback.onSuccess(result);
        Log.info("EXIT DummyUpdateTransUnitCommand.execute()");
    }
View Full Code Here

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

                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();
        verify(mockIdentity, atLeastOnce()).checkPermission(anyString(),
                any(HLocale.class), any(HProject.class));
        verify(transWorkspace).publish(any(SessionEventData.class));
    }
View Full Code Here

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

        AsyncCallback<UpdateTransUnitResult> callback = resultCaptor.getValue();
        TransUnit updatedTU =
                TestFixture.makeTransUnit(TRANS_UNIT_ID.getId(),
                        ContentState.NeedReview, "new content");
        UpdateTransUnitResult result =
                result(true, updatedTU, ContentState.NeedReview, null);

        // When:
        callback.onSuccess(result);
View Full Code Here

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

        AsyncCallback<UpdateTransUnitResult> callback = resultCaptor.getValue();
        TransUnit updatedTU =
                TestFixture.makeTransUnit(TRANS_UNIT_ID.getId(),
                        ContentState.NeedReview, "new content");
        UpdateTransUnitResult result =
                result(true, updatedTU, ContentState.NeedReview, null);

        // When:
        callback.onSuccess(result);
        verify(dispatcher, times(2)).execute(actionCaptor.capture(),
View Full Code Here

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

        AsyncCallback<UpdateTransUnitResult> callback = resultCaptor.getValue();
        TransUnit updatedTU =
                TestFixture.makeTransUnit(TRANS_UNIT_ID.getId(),
                        ContentState.NeedReview, "new content");
        UpdateTransUnitResult result =
                result(false, updatedTU, ContentState.NeedReview, errorMessage);

        // When:
        callback.onSuccess(result);
View Full Code Here

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

    }

    private static UpdateTransUnitResult
            result(boolean success, TransUnit transUnit,
                    ContentState previousState, String errorMessage) {
        return new UpdateTransUnitResult(new TransUnitUpdateInfo(success, true,
                new DocumentId(new Long(1), ""), transUnit, 9, VER_NUM,
                previousState, errorMessage));
    }
View Full Code Here

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

        verify(dispatcher).execute(transMemoryMergeCaptor.capture(),
                callbackCaptor.capture());
        AsyncCallback<UpdateTransUnitResult> callback =
                callbackCaptor.getValue();
        // rpc call success and result has some updated info
        UpdateTransUnitResult result = new UpdateTransUnitResult();
        result.addUpdateResult(new TransUnitUpdateInfo(true, true, documentId,
                currentPageRows.get(0), 0, 0, ContentState.Approved));
        // add an unsuccessful result
        result.addUpdateResult(new TransUnitUpdateInfo(false, true, documentId,
                currentPageRows.get(1), 0, 0, ContentState.Approved));
        result.addUpdateResult(new TransUnitUpdateInfo(true, true, documentId,
                currentPageRows.get(2), 0, 0, ContentState.Approved));
        result.addUpdateResult(new TransUnitUpdateInfo(true, true, documentId,
                currentPageRows.get(3), 0, 0, ContentState.Approved));
        callback.onSuccess(result);

        // Then:
        verify(messages).mergeTMSuccess(Lists.newArrayList("1", "3", "4"));
View Full Code Here

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

        verify(dispatcher).execute(transMemoryMergeCaptor.capture(),
                callbackCaptor.capture());
        AsyncCallback<UpdateTransUnitResult> callback =
                callbackCaptor.getValue();
        // rpc call success but result has no updated info
        UpdateTransUnitResult result = new UpdateTransUnitResult();
        callback.onSuccess(result);

        // Then:
        verify(messages).noTranslationToMerge();
        verify(eventBus).fireEvent(notificationEventCaptor.capture());
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.