Package org.zanata.webtrans.shared.rpc

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


    protected void requestTransUnitsAndUpdatePageIndex(
            GetTransUnitActionContext actionContext,
            final boolean needReloadIndex) {
        eventBus.fireEvent(LoadingEvent.START_EVENT);

        GetTransUnitList action =
                GetTransUnitList.newAction(actionContext).setNeedReloadIndex(
                        needReloadIndex);
        Log.info("requesting transUnits: " + action);
        dispatcher.execute(action, new AsyncCallback<GetTransUnitListResult>() {
            @Override
View Full Code Here


        doAnswer(new Answer<Void>() {
            @Override
            public Void answer(InvocationOnMock invocation) throws Throwable {
                Object[] arguments = invocation.getArguments();
                GetTransUnitList action = (GetTransUnitList) arguments[0];
                action.setWorkspaceId(WORKSPACE_ID);
                GetTransUnitListHandler handler =
                        new MockHandlerFactory()
                                .createGetTransUnitListHandlerWithBehavior(
                                        DOCUMENT.getId(), TEXT_FLOWS, LOCALE,
                                        action.getOffset(), action.getCount());
                getTransUnitListResult = handler.execute(action, null);
                return null;
            }
        }).when(dispatcher).execute(actionCaptor.capture(),
                asyncCallbackCaptor.capture());
View Full Code Here

        service.onNavTransUnit(NavTransUnitEvent.LAST_ENTRY_EVENT);

        verify(dispatcher, times(2)).execute(actionCaptor.capture(),
                resultCaptor.capture());
        GetTransUnitList action = actionCaptor.getValue();
        assertThat(action.getOffset(), Matchers.equalTo(3));
        assertThat(action.getCount(), Matchers.equalTo(EDITOR_PAGE_SIZE));
        assertThat(action.getTargetTransUnitId(),
                Matchers.equalTo(data.get(data.size() - 1).getId()));
    }
View Full Code Here

        DocumentId documentId = documentInfo.getId();
        service.onDocumentSelected(new DocumentSelectionEvent(documentInfo));

        verify(dispatcher).execute(actionCaptor.capture(),
                resultCaptor.capture());
        GetTransUnitList getTransUnitList = actionCaptor.getValue();
        assertThat(getTransUnitList.getDocumentId(),
                Matchers.equalTo(documentId));
    }
View Full Code Here

        service.onPageSizeChange(new EditorPageSizeChangeEvent(5));

        verify(dispatcher, times(2)).execute(actionCaptor.capture(),
                resultCaptor.capture());
        GetTransUnitList getTransUnitList = actionCaptor.getValue();
        assertThat(getTransUnitList.getCount(), Matchers.equalTo(5));

    }
View Full Code Here

                    .getWorkspaceContext().getWorkspaceId());
            wsAction.setEditorClientId(this.identity.getEditorClientId());
        }

        if (action instanceof GetTransUnitList) {
            GetTransUnitList gtuAction = (GetTransUnitList) action;
            AsyncCallback<GetTransUnitListResult> gtuCallback =
                    (AsyncCallback<GetTransUnitListResult>) callback;
            Scheduler.get().scheduleDeferred(
                    new DummyGetTransUnitCommand(gtuAction, gtuCallback));
        } else if (action instanceof GetDocumentList) {
View Full Code Here

        when(localeService.getByLocaleId(localeId)).thenReturn(jaHLocale);
    }

    @Test
    public void testExecuteToGetAll() throws Exception {
        GetTransUnitList action =
                GetTransUnitList.newAction(new GetTransUnitActionContext(
                        document));
        prepareActionAndMockLocaleService(action);

        long startTime = System.nanoTime();
View Full Code Here

                Matchers.contains(1, 2, 3, 4, 5));
    }

    @Test
    public void testExecuteWithStatusFilterOnly() throws Exception {
        GetTransUnitList action =
                GetTransUnitList.newAction(new GetTransUnitActionContext(
                        document).withFilterFuzzy(true)
                        .withFilterUntranslated(true));
        prepareActionAndMockLocaleService(action);
View Full Code Here

                Matchers.contains(3, 5, 6, 7, 8));
    }

    @Test
    public void testExecuteWithHasErrorFilterOnly() throws Exception {
        GetTransUnitList action =
                GetTransUnitList.newAction(new GetTransUnitActionContext(
                        document).withFilterHasError(true));
        prepareActionAndMockLocaleService(action);

        GetTransUnitListResult result = handler.execute(action, null);
View Full Code Here

    @Test
    public void testExecuteWithSearchOnly() throws Exception {
        // Given: we want to search for file (mixed case) and we change page
        // size
        // to 10 and start from index 2
        GetTransUnitList action =
                GetTransUnitList.newAction(new GetTransUnitActionContext(
                        document).withFindMessage("FiLe").withCount(10)
                        .withOffset(1));
        prepareActionAndMockLocaleService(action);
View Full Code Here

TOP

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

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.