Package org.zanata.webtrans.shared.rpc

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


        SearchType searchType = SearchType.FUZZY_PLURAL;
        createTMRequest(new TransMemoryQuery(transUnit.getSources(), searchType));
    }

    private void createTMRequest(TransMemoryQuery query) {
        final GetTranslationMemory action =
                new GetTranslationMemory(query, userWorkspaceContext
                        .getWorkspaceContext().getWorkspaceId().getLocaleId(),
                        userWorkspaceContext.getSelectedDoc().getSourceLocale());
        scheduleTMRequest(action);
    }
View Full Code Here


        List<TransMemoryResultItem> dummyResults = Lists.newArrayList();

        when(translationMemoryService.searchTransMemory(targetLocaleId, sourceLocaleId, query)).thenReturn(dummyResults);

        GetTranslationMemory action =
                new GetTranslationMemory(query, targetLocaleId, sourceLocaleId);

        // When:
        GetTranslationMemoryResult result = handler.execute(action, null);

        // Then:
View Full Code Here

            AsyncCallback<GetTranslatorListResult> _callback =
                    (AsyncCallback<GetTranslatorListResult>) callback;
            Scheduler.get().scheduleDeferred(
                    new DummyGetTranslatorListCommand(_action, _callback));
        } else if (action instanceof GetTranslationMemory) {
            final GetTranslationMemory _action = (GetTranslationMemory) action;
            AsyncCallback<GetTranslationMemoryResult> _callback =
                    (AsyncCallback<GetTranslationMemoryResult>) callback;
            Scheduler.get().scheduleDeferred(
                    new DummyGetTranslationMemoryCommand(_action, _callback));
        } else if (action instanceof GetGlossary) {
View Full Code Here

    }

    @Test
    public void willDoNothingIfAlreadyHaveSubmittedRequest() {
        // Given: already have submitted request
        GetTranslationMemory submittedRequest =
                mock(GetTranslationMemory.class);
        presenter.setStatesForTesting(null, submittedRequest);
        LocaleId localeId = new LocaleId("zh");
        ProjectIterationId projectIterationId =
                new ProjectIterationId("project", "master", ProjectType.Podir);
View Full Code Here

        InOrder inOrder = inOrder(display, dispatcher);
        inOrder.verify(display).startProcessing();
        inOrder.verify(dispatcher).execute(getTMActionCaptor.capture(),
                callbackCaptor.capture());
        // verify action
        GetTranslationMemory action = getTMActionCaptor.getValue();
        assertThat(action.getSearchType(), Matchers.equalTo(SearchType.FUZZY));
        assertThat(action.getLocaleId(), Matchers.equalTo(targetLocale));
        assertThat(action.getSourceLocaleId(), Matchers.equalTo(sourceLocale));
        assertThat(action.getQuery().getQueries(),
                Matchers.contains("search query"));
    }
View Full Code Here

TOP

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

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.