Examples of RevertTransUnitUpdates


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

            this.updateInfoList = updateInfoList;
        }

        @Override
        public void onClick(ClickEvent event) {
            RevertTransUnitUpdates revertAction =
                    new RevertTransUnitUpdates(updateInfoList);

            if (!canUndo) {
                return;
            }
            if (userWorkspaceContext.hasReadOnlyAccess()) {
View Full Code Here

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

        // TODO only fire undo for flows that are undoable?
        // rpc method should cope with this anyway, so no big deal

        eventBus.fireEvent(new NotificationEvent(Severity.Info, messages
                .undoInProgress()));
        RevertTransUnitUpdates action = new RevertTransUnitUpdates();
        executePreUndo(updateInfoList);
        dispatcher.execute(action, new AsyncCallback<UpdateTransUnitResult>() {
            @Override
            public void onFailure(Throwable caught) {
                eventBus.fireEvent(new NotificationEvent(Severity.Error,
View Full Code Here

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

    public void testExecute() throws Exception {
        List<TransUnitUpdateInfo> updatesToRevert =
                Lists.newArrayList(new TransUnitUpdateInfo(true, true,
                        new DocumentId(new Long(1), ""), TestFixture
                                .makeTransUnit(1), 0, 0, ContentState.Approved));
        RevertTransUnitUpdates action =
                new RevertTransUnitUpdates(updatesToRevert);
        action.setWorkspaceId(new WorkspaceId(new ProjectIterationId("", "",
                ProjectType.File), LocaleId.EN_US));

        TranslationService.TranslationResult translationResult =
                mockTranslationResult(ContentState.NeedReview, 0);
        when(
                translationServiceImpl.revertTranslations(LocaleId.EN_US,
                        action.getUpdatesToRevert())).thenReturn(
                Lists.newArrayList(translationResult));

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

        assertThat(result.getUpdateInfoList(), Matchers.hasSize(1));
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.