Package org.zanata.webtrans.shared.rpc

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


                                    person.getEmail()));
            entry.getValue().setPerson(translator);
            translators.put(entry.getKey(), entry.getValue());
        }

        return new GetTranslatorListResult(translators, result.size());
    }
View Full Code Here


        when(accountDAO.getByUsername(person.getId().toString())).thenReturn(
                createHAccount("admin@redhat.com", "pahuang"));
        when(gravatarServiceImpl.getUserImageUrl(16, "admin@redhat.com"))
                .thenReturn("gravatarUrl");

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

        verify(identity).checkLoggedIn();
        assertThat(result.getSize(), Matchers.equalTo(1));
        Map<EditorClientId, PersonSessionDetails> translatorList =
                result.getTranslatorList();
        assertThat(translatorList, Matchers.hasKey(editorClientId));
        assertThat(translatorList.get(editorClientId).getPerson()
                .getAvatarUrl(), Matchers.equalTo("gravatarUrl"));
        assertThat(translatorList.get(editorClientId).getPerson().getName(),
                Matchers.equalTo("pahuang"));
View Full Code Here

                                new Person(
                                        new PersonId("personID"),
                                        "Some Person with an Incredibly Long Name",
                                        "http://www.gravatar.com/avatar/longname@zanata.org?d=mm&s=16"),
                                null));
        callback.onSuccess(new GetTranslatorListResult(translator, translator
                .size()));
        Log.info("EXIT DummyGetTranslatorListCommand.execute()");
    }
View Full Code Here

    @Test
    @SuppressWarnings("unchecked")
    public void onBindWillLoadTranslatorList() {
        ArgumentCaptor<AsyncCallback> callbackCaptor =
                ArgumentCaptor.forClass(AsyncCallback.class);
        GetTranslatorListResult result = mock(GetTranslatorListResult.class);

        presenter.onBind();

        // on calling get translator list callback success
        verify(dispatcher).execute(Mockito.eq(GetTranslatorList.ACTION),
                callbackCaptor.capture());
        AsyncCallback callback = callbackCaptor.getValue();
        callback.onSuccess(result);
        verify(result).getTranslatorList();
        verify(sessionService).initUserList(result.getTranslatorList());
    }
View Full Code Here

TOP

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

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.