Package org.zanata.webtrans.shared.rpc

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


        clearAllExistingData();

        if (!searchText.isEmpty()) {
            display.setSearching(true);
            GetProjectTransUnitLists action =
                    new GetProjectTransUnitLists(searchText, searchInSource,
                            searchInTarget, caseSensitive,
                            windowLocation.getQueryDocuments());
            dispatcher.execute(action, projectSearchCallback);
        }
    }
View Full Code Here


        return hTextFlow;
    }

    @Test(expectedExceptions = ActionException.class)
    public void exceptionIfLocaleIsInvalid() throws Exception {
        GetProjectTransUnitLists action =
                new GetProjectTransUnitLists("a", true, true, false);
        action.setWorkspaceId(workspaceId);
        when(
                localeService.validateLocaleByProjectIteration(localeId,
                        workspaceId.getProjectIterationId().getProjectSlug(),
                        workspaceId.getProjectIterationId().getIterationSlug()))
                .thenThrow(new ZanataServiceException("bad"));
View Full Code Here

        GetProjectTransUnitListsResult result = handler.execute(action, null);
    }

    @Test
    public void emptySearchTermWillReturnEmpty() throws Exception {
        GetProjectTransUnitLists action =
                new GetProjectTransUnitLists("", true, true, false);
        action.setWorkspaceId(workspaceId);

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

        verify(identity).checkLoggedIn();
        assertThat(result.getDocumentIds(), Matchers.<Long> emptyIterable());
View Full Code Here

        verifyZeroInteractions(textFlowSearchServiceImpl);
    }

    @Test
    public void searchWithNoLeadingAndTrailingWhiteSpace() throws Exception {
        GetProjectTransUnitLists action =
                new GetProjectTransUnitLists("file", true, true, true);
        action.setWorkspaceId(workspaceId);
        when(
                textFlowSearchServiceImpl.findTextFlows(
                        eq(action.getWorkspaceId()),
                        eq(action.getDocumentPaths()),
                        constraintCaptor.capture())).thenReturn(textFlows);

        // When: search in target only and case sensitive
        GetProjectTransUnitListsResult result = handler.execute(action, null);
View Full Code Here

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

    @Test
    public void searchWithLeadingWhiteSpace() throws Exception {
        GetProjectTransUnitLists action =
                new GetProjectTransUnitLists(" file", true, true, true);
        action.setWorkspaceId(workspaceId);
        when(
                textFlowSearchServiceImpl.findTextFlows(
                        eq(action.getWorkspaceId()),
                        eq(action.getDocumentPaths()),
                        constraintCaptor.capture())).thenReturn(textFlows);

        // When: search in source and target and case sensitive
        GetProjectTransUnitListsResult result = handler.execute(action, null);
View Full Code Here

                Matchers.contains(2, 3));
    }

    @Test
    public void searchWithTrailingWhiteSpace() throws Exception {
        GetProjectTransUnitLists action =
                new GetProjectTransUnitLists("file ", true, false, false);
        action.setWorkspaceId(workspaceId);
        when(
                textFlowSearchServiceImpl.findTextFlows(
                        eq(action.getWorkspaceId()),
                        eq(action.getDocumentPaths()),
                        constraintCaptor.capture())).thenReturn(textFlows);

        // When: search in source only and case insensitive
        GetProjectTransUnitListsResult result = handler.execute(action, null);
View Full Code Here

TOP

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

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.