Package org.zanata.webtrans.shared.model

Examples of org.zanata.webtrans.shared.model.DocumentId


    }

    @Test
    public void testAddComment() throws Exception {
        when(contextHolder.getContext().getDocument().getId()).thenReturn(
                new DocumentId(1L, "doc"));
        ArgumentCaptor<AddReviewCommentAction> actionCaptor =
                ArgumentCaptor.forClass(AddReviewCommentAction.class);
        ArgumentCaptor<AsyncCallback> resultCaptor =
                ArgumentCaptor.forClass(AsyncCallback.class);
View Full Code Here


        token.setProjectSearchText("project search text");
        token.setDocumentPath("doc/path");
        token.setProjectSearchReplacement("replacement");
        when(historyChangeEvent.getValue()).thenReturn(token.toTokenString());
        DocumentInfo documentInfo = TestFixture.documentInfo(1, "doc/path");
        DocumentId documentId = documentInfo.getId();
        when(documentListPresenter.getDocumentId("doc/path")).thenReturn(
                documentId);
        when(documentListPresenter.getDocumentInfo(documentId)).thenReturn(
                documentInfo);
        when(appPresenter.getSelectedDocIdOrNull()).thenReturn(
                new DocumentId(new Long(99), ""));
        contextHolder.updateContext(new GetTransUnitActionContext(documentInfo(
                99, "")));

        // When:
        service.onValueChange(historyChangeEvent);
View Full Code Here

        token.setDocumentPath("doc/path");
        token.setProjectSearchReplacement("replacement");
        token.setTextFlowId("1");
        when(historyChangeEvent.getValue()).thenReturn(token.toTokenString());
        DocumentInfo documentInfo = TestFixture.documentInfo(1, "doc/path");
        DocumentId documentId = documentInfo.getId();
        when(documentListPresenter.getDocumentId("doc/path")).thenReturn(
                documentId);
        when(documentListPresenter.getDocumentInfo(documentId)).thenReturn(
                documentInfo);
        when(appPresenter.getSelectedDocIdOrNull()).thenReturn(
                new DocumentId(new Long(99), ""));
        contextHolder.updateContext(null);

        // When:
        service.onValueChange(historyChangeEvent);
View Full Code Here

        FilterConstraints untranslated =
                FilterConstraints.builder().keepAll().excludeFuzzy()
                        .excludeTranslated().build();
        List<HTextFlow> result =
                dao.getTextFlowByDocumentIdWithConstraints(new DocumentId(1L,
                        ""), deLocale, untranslated, 0, 10);
        assertThat(result.size(), is(0));

        HLocale frLocale = getEm().find(HLocale.class, 6L);
        result =
                dao.getTextFlowByDocumentIdWithConstraints(new DocumentId(1L,
                        ""), frLocale, untranslated, 0, 10);
        assertThat(result.size(), is(1));
    }
View Full Code Here

        FilterConstraints untranslated =
                FilterConstraints.builder().keepAll().excludeFuzzy()
                        .excludeTranslated().build();
        List<HTextFlow> result =
                dao.getTextFlowByDocumentIdWithConstraints(new DocumentId(4L,
                        ""), deLocale, untranslated, 0, 10);
        assertThat(result, Matchers.hasSize(1));
    }
View Full Code Here

    @Test
    public void canGetTextFlowsByStatusNotNew() {
        HLocale enUSLocale = getEm().find(HLocale.class, 4L);
        // all 3 text flows are fuzzy for en-US in this document
        DocumentId documentId2 = new DocumentId(2L, "");
        List<HTextFlow> result =
                dao.getTextFlowByDocumentIdWithConstraints(documentId2,
                        enUSLocale, FilterConstraints.builder().keepAll()
                                .excludeNew().build(), 0, 10);
View Full Code Here

    }

    @Test
    public void canGetTextFlowsByStatusNotFuzzy() {
        // frLocale new in this document
        DocumentId documentId = new DocumentId(1L, "");
        HLocale frLocale = getEm().find(HLocale.class, 6L);
        FilterConstraints notFuzzy =
                FilterConstraints.builder().keepAll().excludeFuzzy().build();

        List<HTextFlow> result =
View Full Code Here

    }

    @Test
    public void canGetTextFlowsByStatusNotTranslatedNotNew() {
        // esLocale fuzzy in this document
        DocumentId documentId = new DocumentId(1L, "");
        HLocale esLocale = getEm().find(HLocale.class, 5L);
        FilterConstraints notNewOrTranslated =
                FilterConstraints.builder().keepAll().excludeTranslated()
                        .excludeNew().build();
View Full Code Here

    }

    @Test
    public void canGetTextFlowsByStatusNotFuzzyNotNew() {
        // deLocale approved in this document
        DocumentId documentId = new DocumentId(1L, "");
        HLocale deLocale = getEm().find(HLocale.class, 3L);
        FilterConstraints notNewOrFuzzy =
                FilterConstraints.builder().keepAll().excludeFuzzy()
                        .excludeNew().build();
View Full Code Here

    @Test
    public void canGetTextFlowsByStatusNotFuzzyNotTranslated() {
        HLocale enUSLocale = getEm().find(HLocale.class, 4L);
        // all 3 text flows are fuzzy for en-US in this document
        DocumentId documentId2 = new DocumentId(2L, "");
        FilterConstraints notFuzzyOrTranslated =
                FilterConstraints.builder().keepAll().excludeTranslated()
                        .excludeFuzzy().build();
        List<HTextFlow> result =
                dao.getTextFlowByDocumentIdWithConstraints(documentId2,
View Full Code Here

TOP

Related Classes of org.zanata.webtrans.shared.model.DocumentId

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.