Package com.github.timurstrekalov.saga.core.model

Examples of com.github.timurstrekalov.saga.core.model.ScriptCoverageStatistics


        for (final ScriptData data : getLocalBrowser().getScriptDataList()) {
            final String sourceUri = data.getSourceUriAsString();

            @SuppressWarnings("unchecked")
            final Map<String, Long> coverageDataForScript = coverageDataForAllScripts.get(sourceUri);
            final ScriptCoverageStatistics scriptCoverageStatistics = data.generateScriptCoverageStatistics(baseUri, coverageDataForScript);

            runStats.add(scriptCoverageStatistics);
        }

        return runStats;
View Full Code Here


    }

    private void addFileStatsRows(final TestRunCoverageStatistics runStats, final PdfPTable table) {
        final List<ScriptCoverageStatistics> allFileStats = runStats.getFileStats();
        for (int i = 0; i < allFileStats.size(); i++) {
            final ScriptCoverageStatistics scriptCoverageStatistics = allFileStats.get(i);
            final boolean hasStatements = scriptCoverageStatistics.getHasStatements();

            final Phrase fileName = new Phrase();

            if (scriptCoverageStatistics.getParentName() != null) {
                fileName.add(new Chunk(scriptCoverageStatistics.getParentName() + "/", hasStatements ? FONT_TD : FONT_TD_EMPTY_FILE));
                fileName.add(new Chunk(scriptCoverageStatistics.getFileName(), hasStatements ? FONT_TD_BOLD : FONT_TD_BOLD_EMPTY_FILE));
            } else {
                fileName.add(new Chunk(scriptCoverageStatistics.getFileName(), hasStatements ? FONT_TD : FONT_TD_EMPTY_FILE));
            }

            final BaseColor bgColor = (i % 2 == 1) ? COLOR_ROW_ODD : COLOR_ROW_EVEN;

            final Font font = FONT_TD;

            table.addCell(createCell(fileName, 0, bgColor));
            table.addCell(createCell(String.valueOf(scriptCoverageStatistics.getStatements()), font, 1, bgColor));
            table.addCell(createCell(String.valueOf(scriptCoverageStatistics.getExecuted()), font, 2, bgColor));
            table.addCell(createCell(scriptCoverageStatistics.getCoverage() + "%", FONT_TD, 3, bgColor));
        }
    }
View Full Code Here

    private static final String USER_DIR = System.getProperty("user.dir");

    @Test
    public void getParentName_file() {
        assertEquals("test/path/bla", new ScriptCoverageStatistics(new File(USER_DIR).toURI(), new File(USER_DIR + "/test/path/bla/file.js").toURI(),
                Lists.<LineCoverageRecord>newLinkedList(), true).getParentName().replace('\\', '/'));
    }
View Full Code Here

                Lists.<LineCoverageRecord>newLinkedList(), true).getParentName().replace('\\', '/'));
    }

    @Test
    public void getParentName_http() {
        assertEquals("test/path/bla", new ScriptCoverageStatistics(URI.create("http://localhost:8234"), URI.create("http://localhost:8234/test/path/bla/file.js"),
                Lists.<LineCoverageRecord>newLinkedList(), true).getParentName().replace('\\', '/'));
    }
View Full Code Here

TOP

Related Classes of com.github.timurstrekalov.saga.core.model.ScriptCoverageStatistics

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.