Package org.zanata.webtrans.shared.rpc

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


        Collections.sort(results, COMPARATOR);

        log.debug("Returning {} Glossary matches for \"{}\"", results.size(),
                abbrev);
        return new GetGlossaryResult(action, results);
    }
View Full Code Here


        doReturn(matches).when(glossaryDAOSpy).getSearchResult("fedora",
                HasSearchType.SearchType.FUZZY, LocaleId.EN_US, 20);

        // When:
        long start = System.nanoTime();
        GetGlossaryResult result = handler.execute(action, null);
        double duration = (System.nanoTime() - start) / 1000000000.0;
        log.info("************** {} second", duration);

        // Then:
        assertThat(result.getGlossaries(), Matchers.hasSize(2));
        assertThat(result.getGlossaries().get(0).getSource(),
                Matchers.equalTo("Planet Fedora"));
        assertThat(result.getGlossaries().get(0).getTarget(),
                Matchers.equalTo("Fedora 博客聚集"));
        assertThat(result.getGlossaries().get(1).getSource(),
                Matchers.equalTo("Fedora Artwork"));
        assertThat(result.getGlossaries().get(1).getTarget(),
                Matchers.equalTo("Fedora 美工"));
    }
View Full Code Here

                "<tr> &lt;suggestion 3</tr>", 3, 100));
        matches.add(new GlossaryResultItem("<s>source1</s>",
                "<tr> &lt;suggestion 3</tr>", 3, 100));
        matches.add(new GlossaryResultItem("<s>source1</s>",
                "<tr> &lt;suggestion 3</tr>", 3, 100));
        callback.onSuccess(new GetGlossaryResult(action, matches));
        Log.info("EXIT DummyGetGlossaryCommand.execute()");
    }
View Full Code Here

        ArrayList<GlossaryResultItem> glossaries =
                Lists.newArrayList(new GlossaryResultItem("source", "target",
                        100, 100));

        // on rpc callback success and result contains glossaries
        callback.onSuccess(new GetGlossaryResult(getGlossaryCaptor.getValue(),
                glossaries));

        verify(mockGlossaryTextBox).setText("query");
        verify(mockSearchType).setValue(SearchType.FUZZY);
        verify(display).renderTable(glossaries);
View Full Code Here

        verify(dispatcher).execute(getGlossaryCaptor.capture(),
                callbackCaptor.capture());
        AsyncCallback<GetGlossaryResult> callback = callbackCaptor.getValue();

        // on rpc callback success and result contains glossaries
        callback.onSuccess(new GetGlossaryResult(getGlossaryCaptor.getValue(),
                Lists.<GlossaryResultItem> newArrayList()));

        verify(mockGlossaryTextBox).setText("query");
        verify(mockSearchType).setValue(SearchType.FUZZY);
        verify(display).stopProcessing(false);
View Full Code Here

TOP

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

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.