Package org.zanata.webtrans.shared.rpc

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


            GetGlossary.SearchType searchType) {
        LocaleId srcLocale = LocaleId.EN_US;
        if (userWorkspaceContext.getSelectedDoc().getSourceLocale() != null) {
            srcLocale = userWorkspaceContext.getSelectedDoc().getSourceLocale();
        }
        final GetGlossary action =
                new GetGlossary(query, userWorkspaceContext
                        .getWorkspaceContext().getWorkspaceId().getLocaleId(),
                        srcLocale, searchType);
        scheduleGlossaryRequest(action);
    }
View Full Code Here


    @Test
    public void canGetGlossary() throws Exception {
        // Given:
        when(localeService.getByLocaleId(TARGET_LOCALE_ID)).thenReturn(
                targetHLocale);
        GetGlossary action =
                new GetGlossary("fedora", TARGET_LOCALE_ID, LocaleId.EN_US,
                        HasSearchType.SearchType.FUZZY);
        // hibernate search result
        HGlossaryTerm srcGlossaryTerm1 = getEm().find(HGlossaryTerm.class, 42L);
        HGlossaryTerm srcGlossaryTerm2 = getEm().find(HGlossaryTerm.class, 46L);
        List<Object[]> matches =
View Full Code Here

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

        presenter.fireSearchEvent();

        verify(display).startProcessing();
        verify(dispatcher).execute(getGlossaryCaptor.capture(),
                callbackCaptor.capture());
        GetGlossary action = getGlossaryCaptor.getValue();
        assertThat(action.getQuery(), Matchers.equalTo("query"));
        assertThat(action.getSearchType(), Matchers.equalTo(SearchType.FUZZY));
        assertThat(action.getSrcLocaleId(),
                Matchers.equalTo(docInfo.getSourceLocale()));
    }
View Full Code Here

        // Then: there is only one RPC call to the server and the second request
        // get ignored
        verify(display).startProcessing();
        verify(dispatcher).execute(getGlossaryCaptor.capture(),
                callbackCaptor.capture());
        GetGlossary action = getGlossaryCaptor.getValue();
        assertThat(action.getQuery(), Matchers.equalTo("query1"));
        assertThat(action.getSearchType(), Matchers.equalTo(SearchType.FUZZY));
        assertThat(action.getSrcLocaleId(),
                Matchers.equalTo(docInfo.getSourceLocale()));
    }
View Full Code Here

        presenter.onTransUnitSelected(new TransUnitSelectionEvent(transUnit));

        verify(display).startProcessing();
        verify(dispatcher).execute(getGlossaryCaptor.capture(),
                callbackCaptor.capture());
        GetGlossary action = getGlossaryCaptor.getValue();
        assertThat(action.getQuery(), Matchers.equalTo("source1 source2 "));
    }
View Full Code Here

TOP

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

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.