Examples of ContainerTranslationStatistics


Examples of org.zanata.rest.dto.stats.ContainerTranslationStatistics

        presenter.setStatesForTest(projectStats, selectedDocumentStats,
                MainView.Documents, null);
        DocumentId docId = new DocumentId(1L, "");
        // newly selected document has new stats

        ContainerTranslationStatistics newSelectedStats =
                new ContainerTranslationStatistics();
        newSelectedStats.addStats(new TranslationStatistics(new TransUnitCount(
                1, 2, 3), LocaleId.EN_US.toString()));
        newSelectedStats.addStats(new TranslationStatistics(new TransUnitWords(
                4, 5, 6), LocaleId.EN_US.toString()));

        DocumentInfo documentInfo =
                new DocumentInfo(docId, "a.po", "pot/", new LocaleId("en-US"),
                        newSelectedStats, new AuditInfo(new Date(),
View Full Code Here

Examples of org.zanata.rest.dto.stats.ContainerTranslationStatistics

    public void onDocumentStatsUpdateWillDoNothingIfNoSelectedDocument() {
        assertThat(presenter.getSelectedDocumentInfoOrNull(),
                Matchers.is(Matchers.nullValue()));

        presenter.onDocumentStatsUpdated(new DocumentStatsUpdatedEvent(
                new DocumentId(1L, ""), new ContainerTranslationStatistics()));

        verifyZeroInteractions(display);
    }
View Full Code Here

Examples of org.zanata.rest.dto.stats.ContainerTranslationStatistics

                null);
        presenter.selectDocument(new DocumentId(2L, ""));

        // When:
        presenter.onDocumentStatsUpdated(new DocumentStatsUpdatedEvent(
                new DocumentId(1L, ""), new ContainerTranslationStatistics()));

        // Then:
        verifyZeroInteractions(display);
    }
View Full Code Here

Examples of org.zanata.rest.dto.stats.ContainerTranslationStatistics

                documentInfo);
        presenter.selectDocument(docId);
        verify(display, atLeastOnce()).setStats(selectedDocumentStats, true);

        // When:
        ContainerTranslationStatistics newStats =
                new ContainerTranslationStatistics();
        newStats.addStats(new TranslationStatistics(
                new TransUnitCount(9, 9, 9), LocaleId.EN_US.toString()));
        newStats.addStats(new TranslationStatistics(
                new TransUnitWords(8, 8, 8), LocaleId.EN_US.toString()));

        presenter.onDocumentStatsUpdated(new DocumentStatsUpdatedEvent(docId,
                newStats));

        // Then:
        assertThat(selectedDocumentStats.getStats(),
                Matchers.equalTo(newStats.getStats()));
        verify(display, atLeastOnce()).setStats(selectedDocumentStats, true);
    }
View Full Code Here

Examples of org.zanata.rest.dto.stats.ContainerTranslationStatistics

        verify(keyShortcutPresenter).showShortcuts();
    }

    @Test
    public void onProjectStatsUpdated() {
        projectStats = new ContainerTranslationStatistics();
        projectStats.addStats(new TranslationStatistics(new TransUnitCount(0,
            0, 0), userWorkspace.getWorkspaceContext().getWorkspaceId().getLocaleId().getId()));
        projectStats.addStats(new TranslationStatistics(new TransUnitWords(0,
            0, 0), userWorkspace.getWorkspaceContext().getWorkspaceId().getLocaleId().getId()));
View Full Code Here

Examples of org.zanata.rest.dto.stats.ContainerTranslationStatistics

        ArrayList<DocumentNode> docList = new ArrayList<DocumentNode>();

        TransUnitCount unitCount = new TransUnitCount(1, 2, 3);
        TransUnitWords wordCount = new TransUnitWords(4, 5, 6);

        ContainerTranslationStatistics stats =
            new ContainerTranslationStatistics();
        stats.addStats(new TranslationStatistics(unitCount, LocaleId.EN_US
            .toString()));
        stats.addStats(new TranslationStatistics(wordCount, LocaleId.EN_US
            .toString()));

        DocumentInfo docInfo =
            new DocumentInfo(new DocumentId(1111L, "no/filter/matches"),
                "matches", "no/filter", LocaleId.EN_US, stats,
View Full Code Here

Examples of org.zanata.rest.dto.stats.ContainerTranslationStatistics

        cacheManager.shutdown();
    }

    @Test
    public void getSimpleIterationStatisticsForAllLocales() {
        ContainerTranslationStatistics stats =
                statisticsService.getStatistics("sample-project", "1.0", false,
                        false, new String[] {});

        // Make sure the id matches
        assertThat(stats.getId()).isEqualTo("1.0");
        // Make sure there are links
        assertThat(stats.getRefs().size()).isGreaterThan(0);

        // No detailed stats
        assertThat(stats.getDetailedStats()).isNull();

        assertThat(stats.getStats().get(0).getUnit()).isEqualTo(
                TranslationStatistics.StatUnit.MESSAGE);

        for (TranslationStatistics transStat : stats.getStats()) {
            // Check that there are no word level stats
            assertThat(transStat.getUnit()).isNotEqualTo(
                    TranslationStatistics.StatUnit.WORD);

            // make sure counts are sane
View Full Code Here

Examples of org.zanata.rest.dto.stats.ContainerTranslationStatistics

        filter = new PathDocumentFilter();
    }

    private static DocumentInfo docInfo(String name, String path) {
        return new DocumentInfo(new DocumentId(1L, ""), name, path,
                LocaleId.EN_US, new ContainerTranslationStatistics(),
                new AuditInfo(new Date(), "Translator"),
                new HashMap<String, String>(), new AuditInfo(new Date(),
                        "last translator"));
    }
View Full Code Here

Examples of org.zanata.rest.dto.stats.ContainerTranslationStatistics

    @Test
    public void fireSearchEvent() {
        DocumentInfo docInfo =
                new DocumentInfo(new DocumentId(new Long(1), ""), "test",
                        "test/path", LocaleId.EN_US,
                        new ContainerTranslationStatistics(), new AuditInfo(
                                new Date(), "Translator"),
                        new HashMap<String, String>(), new AuditInfo(
                                new Date(), "last translator"));
        userWorkspaceContext.setSelectedDoc(docInfo);
View Full Code Here

Examples of org.zanata.rest.dto.stats.ContainerTranslationStatistics

            fireSearchEventInSequentialWillBlockSecondRequestUntilFirstReturn() {
        // Given:
        DocumentInfo docInfo =
                new DocumentInfo(new DocumentId(new Long(1), ""), "test",
                        "test/path", LocaleId.EN_US,
                        new ContainerTranslationStatistics(), new AuditInfo(
                                new Date(), "Translator"),
                        new HashMap<String, String>(), new AuditInfo(
                                new Date(), "last translator"));
        userWorkspaceContext.setSelectedDoc(docInfo);
        when(messages.searchGlossary()).thenReturn("Search glossary");
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.