Examples of GetTranslationHistoryResult


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

        log.debug("found {} review comments for text flow id {}",
                reviewComments.size(), action.getTransUnitId());

        // we re-wrap the list because gwt rpc doesn't like other list
        // implementation
        return new GetTranslationHistoryResult(
                Lists.newArrayList(historyItems), latest,
                Lists.newArrayList(reviewComments));
    }
View Full Code Here

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

                hTextFlow);
        assertThat(hTextFlow.getTargets().values(),
                Matchers.<HTextFlowTarget> emptyIterable());

        // When:
        GetTranslationHistoryResult result =
                handler.execute(action, executionContext);

        // Then:
        assertThat(result.getHistoryItems(),
                Matchers.<TransHistoryItem> empty());
        assertThat(result.getLatest(), Matchers.nullValue());
    }
View Full Code Here

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

                .thenReturn(2);
        when(textFlowDAO.findById(transUnitId.getId(), false)).thenReturn(
                hTextFlow);

        // When:
        GetTranslationHistoryResult result =
                handler.execute(action, executionContext);

        // Then:
        assertThat(result.getHistoryItems(), Matchers.hasSize(2));
        assertThat(result.getLatest().getVersionNum(),
                Matchers.equalTo(currentTranslation.getVersionNum().toString()));
        assertThat(result.getLatest().getContents(),
                Matchers.equalTo(currentTranslation.getContents()));
        assertThat(result.getLatest().getModifiedBy(),
                Matchers.equalTo("admin"));
    }
View Full Code Here

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

                .thenReturn(2);
        when(textFlowDAO.findById(transUnitId.getId(), false)).thenReturn(
                hTextFlow);

        // When:
        GetTranslationHistoryResult result =
                handler.execute(action, executionContext);

        // Then:
        assertThat(result.getHistoryItems(),
                Matchers.<TransHistoryItem> emptyIterable());
        assertThat(result.getLatest().getVersionNum(),
                Matchers.equalTo(currentTranslation.getVersionNum().toString()));
        assertThat(result.getLatest().getContents(),
                Matchers.equalTo(currentTranslation.getContents()));
        assertThat(result.getLatest().getModifiedBy(), Matchers.equalTo(""));
    }
View Full Code Here

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

                hTextFlow);

        // When: number of plurals has changed to 1
        when(resourceUtils.getNumPlurals(hTextFlow.getDocument(), hLocale))
                .thenReturn(1);
        GetTranslationHistoryResult result =
                handler.execute(action, executionContext);

        // Then: the contents we get back is consistent against number of plural
        assertThat(result.getHistoryItems(),
                Matchers.<TransHistoryItem> emptyIterable());
        assertThat(result.getLatest().getVersionNum(),
                Matchers.equalTo(currentTranslation.getVersionNum().toString()));
        assertThat(result.getLatest().getContents(),
                Matchers.contains(currentTranslation.getContents().get(0)));
        assertThat(result.getLatest().getModifiedBy(), Matchers.equalTo(""));
    }
View Full Code Here

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

                Matchers.<ComparableByDate> hasSize(3));
    }

    private static GetTranslationHistoryResult createTranslationHistory(
            TransHistoryItem latest, TransHistoryItem... historyItems) {
        return new GetTranslationHistoryResult(
                Lists.newArrayList(historyItems), latest,
                Lists.<ReviewComment> newArrayList());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.