Package hudson.plugins.rubyMetrics.flog.model

Examples of hudson.plugins.rubyMetrics.flog.model.FlogFileResults


            if (line == null || line.length() == 0) {
                mock.append("\n");
            }
        }

        FlogFileResults results = parser.parse("lib/trinidad/command_line_parser.rb", mock.toString());
        assertEquals(80.3f, results.total);
        assertEquals(40.2f, results.average);
        assertEquals(2, results.getMethodResults().size());

        assertEquals(79.2f, results.getMethodResults().get(0).score);
        assertEquals("CommandLineParser::parse lib/trinidad/command_line_parser.rb:5", results.getMethodResults().get(0).name.replaceAll("\\s+", " "));
        assertFalse(results.getMethodResults().get(0).getOperatorResults().isEmpty());
        assertEquals(1.1f, results.getMethodResults().get(1).score);
        assertNotNull(results.getMethodResults().get(0).name);
        assertFalse(results.getMethodResults().get(1).getOperatorResults().isEmpty());
    }
View Full Code Here


    private FlogBuildResults buildResults(AbstractBuild<?, ?> build, Map<String, ByteArrayOutputStream> execResults) {
        final FlogParser parser = new FlogParser();
        FlogBuildResults buildResults = new FlogBuildResults();

        for (Map.Entry<String, ByteArrayOutputStream> entry : execResults.entrySet()) {
            FlogFileResults resultsForFile = parser.parse(entry.getKey(), entry.getValue());
            if (resultsForFile != null) {
                buildResults.addFileResults(entry.getKey(), resultsForFile);
            }
        }
View Full Code Here

        }
        String[] totalAndAverage = resultsSplit[0].split("\n");
        String total = getScoreFromOperator(totalAndAverage[0]);
        String average = getScoreFromOperator(totalAndAverage[1]);

        FlogFileResults flogResults = new FlogFileResults(total, average);
        for (int index = 1; index < resultsSplit.length; index++) {
            for (String line : resultsSplit[index].split("\n")) {
                addFlogResults(filePath, flogResults, line);
            }
        }
View Full Code Here

TOP

Related Classes of hudson.plugins.rubyMetrics.flog.model.FlogFileResults

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.