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

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


    public TestRunCoverageStatistics call() {
        try {
            logger.info("Running test at {}", test.toString());

            try {
                final TestRunCoverageStatistics runStats = runTest(test);

                if (runStats == TestRunCoverageStatistics.EMPTY) {
                    logger.warn("No actual test run for file: {}", test);
                } else if (outputStrategy.contains(OutputStrategy.PER_TEST)) {
                    if (UriUtil.isFileUri(test)) {
View Full Code Here


        return collectAndWriteRunStats(test, coverageData);
    }

    private TestRunCoverageStatistics collectAndWriteRunStats(
            final URI test, final Map<String, Map<String, Long>> coverageDataForAllScripts) throws IOException {
        final TestRunCoverageStatistics runStats = new TestRunCoverageStatistics(test);
        runStats.setSortBy(config.getSortBy());
        runStats.setOrder(config.getOrder());

        final URI baseUri = config.getBaseUri();

        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

        if (config.isOutputInstrumentedFiles()) {
            FileUtils.mkdir(config.getInstrumentedFileDirectory().getAbsolutePath());
        }

        final TestRunCoverageStatistics totalStats = new TestRunCoverageStatistics(baseUri.relativize(URI.create(TOTAL_REPORT_NAME)), "Total coverage report");
        totalStats.setSortBy(config.getSortBy());
        totalStats.setOrder(config.getOrder());
        totalStats.setSourceDirs(config.getSourceDirs());

        maybePreloadSources(totalStats);
        runTests(tests, actualThreadCount, outputStrategy, totalStats);
    }
View Full Code Here

        try {
            for (int i = 0; i < submittedTasks; i++) {
                try {
                    final Future<TestRunCoverageStatistics> future = completionService.take();
                    final TestRunCoverageStatistics runStats = future.get();

                    allRunStats.add(runStats);
                } catch (final Exception e) {
                    logger.debug(e.getMessage(), e);
                }
View Full Code Here

    private static final File OUTPUT_DIR = new File(PARENT_DIR_PATH, "target");

    @Test
    public void test_getFileOutputDir() throws Exception {
        final URI test = URI.create(FILE_PREFIX + Joiner.on("/").join(PARENT_DIR_PATH, "src", "main", "javascript", "MyTest.html"));
        final TestRunCoverageStatistics stats = new TestRunCoverageStatistics(test);

        final File actual = getFileOutputDir(BASE_URI, OUTPUT_DIR, stats).getAbsoluteFile();
        final File expected = new File(PARENT_DIR_PATH, Joiner.on(File.separatorChar).join("target", "main", "javascript")).getAbsoluteFile();

        assertThat(actual, equalTo(expected));
View Full Code Here

TOP

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

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.