Package org.zanata.webtrans.shared.rpc

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


                getSelectedMergeOptions());
    }

    private MergeOptions getSelectedMergeOptions() {
        // default to most conservative option
        MergeOptions opts = MergeOptions.allReject();
        opts.setDifferentDocument(docIdOptionGroup.getSelected());
        opts.setDifferentProject(projectOptionGroup.getSelected());
        opts.setDifferentResId(contextOptionGroup.getSelected());
        opts.setImportedMatch(importedMatchOptionGroup.getSelected());
        return opts;
    }
View Full Code Here


        // we have TransMemoryMergeStatusResolverTest to cover various different
        // merge options so here we don't test that
        MergeRule importedTMOption =
                acceptImportedTMResults ? MergeRule.IGNORE_CHECK
                        : MergeRule.REJECT;
        MergeOptions opts = MergeOptions.allIgnore();
        opts.setImportedMatch(importedTMOption);

        return prepareAction(threshold, requests, opts);
    }
View Full Code Here

            .build();
      // @formatter:on
        mockCurrentPageToReturn(currentPageRows);

        // When:
        MergeOptions opts = MergeOptions.allFuzzy();
        opts.setDifferentProject(MergeRule.IGNORE_CHECK);
        opts.setDifferentDocument(MergeRule.REJECT);
        presenter.proceedToMergeTM(80, opts);

        // Then:
        verify(eventBus).fireEvent(notificationEventCaptor.capture());
        verify(messages).noTranslationToMerge();
View Full Code Here

            .build();
      // @formatter:on
        mockCurrentPageToReturn(currentPageRows);

        // When:
        MergeOptions opts = MergeOptions.allFuzzy();
        opts.setDifferentProject(MergeRule.IGNORE_CHECK);
        opts.setDifferentDocument(MergeRule.REJECT);
        presenter.proceedToMergeTM(80, opts);

        // Then:
        InOrder inOrder = inOrder(display, dispatcher);
        inOrder.verify(display).showProcessing();
View Full Code Here

        List<TransUnit> currentPageRows =
                Lists.newArrayList(makeTransUnit(1, ContentState.New));
        mockCurrentPageToReturn(currentPageRows);

        // When:
        MergeOptions opts = MergeOptions.allFuzzy();
        opts.setDifferentProject(MergeRule.REJECT);
        opts.setDifferentDocument(MergeRule.IGNORE_CHECK);
        presenter.proceedToMergeTM(100, opts);

        verify(dispatcher).execute(transMemoryMergeCaptor.capture(),
                callbackCaptor.capture());
        AsyncCallback<UpdateTransUnitResult> callback =
View Full Code Here

        UndoLink undoLink = mock(UndoLink.class);
        DocumentId documentId = new DocumentId(new Long(0), "");
        when(undoLinkProvider.get()).thenReturn(undoLink);

        // When:
        MergeOptions opts = MergeOptions.allFuzzy();
        opts.setDifferentProject(MergeRule.REJECT);
        opts.setDifferentDocument(MergeRule.IGNORE_CHECK);
        presenter.proceedToMergeTM(100, opts);

        verify(dispatcher).execute(transMemoryMergeCaptor.capture(),
                callbackCaptor.capture());
        AsyncCallback<UpdateTransUnitResult> callback =
View Full Code Here

        mockCurrentPageToReturn(currentPageRows);
        UndoLink undoLink = mock(UndoLink.class);
        when(undoLinkProvider.get()).thenReturn(undoLink);

        // When:
        MergeOptions opts = MergeOptions.allFuzzy();
        opts.setDifferentProject(MergeRule.REJECT);
        opts.setDifferentDocument(MergeRule.IGNORE_CHECK);
        presenter.proceedToMergeTM(100, opts);

        verify(dispatcher).execute(transMemoryMergeCaptor.capture(),
                callbackCaptor.capture());
        AsyncCallback<UpdateTransUnitResult> callback =
View Full Code Here

                mergeOptions);
    }

    private static TransMemoryMerge mergeTMActionWhenResIdIsDifferent(
            MergeRule resIdOption) {
        MergeOptions opts = MergeOptions.allIgnore();
        opts.setDifferentResId(resIdOption);
        return mergeTMAction(opts);
    }
View Full Code Here

        return mergeTMAction(opts);
    }

    private static TransMemoryMerge mergeTMActionWhenDocIdIsDifferent(
            MergeRule documentOption) {
        MergeOptions opts = MergeOptions.allIgnore();
        opts.setDifferentDocument(documentOption);
        return mergeTMAction(opts);
    }
View Full Code Here

        return mergeTMAction(opts);
    }

    private TransMemoryMerge mergeTMActionWhenProjectNameIsDifferent(
            MergeRule projectOption) {
        MergeOptions opts = MergeOptions.allIgnore();
        opts.setDifferentProject(projectOption);
        return mergeTMAction(opts);
    }
View Full Code Here

TOP

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

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.