Package com.olabini.jescov

Examples of com.olabini.jescov.FileCoverage


                    }
                    bcs.add(new BranchCoverage(lineNumber, branchId, branchHits));
                }
            }

            fcs.add(new FileCoverage(me.getKey(), lcs, bcs));
        }
        return new CoverageData(fcs);
    }
View Full Code Here


        final ST templateLeft = g.getInstanceOf("sourcefiles");
        final ST templateRight = g.getInstanceOf("summary");

        templateRight.add("fileAndCoverage", new FilesAndRelatedInformation(false, "All Files", data.getLinesValid(), data.getLinesCovered(), data.getBranchesValid(), data.getBranchesCovered()));
        for(String file : data.getFileNames()) {
            FileCoverage fc = data.getFileCoverageFor(file);
            FilesAndRelatedInformation fari = new FilesAndRelatedInformation(true, file, fc.getLinesValid(), fc.getLinesCovered(), fc.getBranchesValid(), fc.getBranchesCovered());
            templateLeft.add("fileAndCoverage", fari);
            templateRight.add("fileAndCoverage", fari);
        }

        intoFile("frame-sourcefiles.html", new WriteAction() {
View Full Code Here

        writer.write("  </sources>\n");
        writer.write("  <packages>\n");
        writer.write("    <package name=\"all\" line-rate=\"" + data.getLineRate() + "\" branch-rate=\"" + data.getBranchRate() + "\" complexity=\"0.0\">\n");
        writer.write("      <classes>\n");
        for(String fileName : data.getFileNames()) {
            FileCoverage fc = data.getFileCoverageFor(fileName);
            writer.write("        <class name=\""+fileName+"\" filename=\""+fileName+"\" line-rate=\""+fc.getLineRate()+"\" branch-rate=\""+fc.getBranchRate()+"\" complexity=\"0.0\">\n");
            writer.write("          <methods>\n");
            writer.write("          </methods>\n");
            writer.write("          <lines>\n");
            for(int line : fc.getLines()) {
                LineCoverage lc = fc.getLineCoverageFor(line);
                Collection<BranchCoverage> bcs = fc.getBranchCoverageFor(line);
                if(bcs == null) {
                    writer.write("            <line number=\"" + line + "\" hits=\"" + lc.getHits() + "\" branch=\"false\"/>\n");
                } else {
                    String coverageString = calculateCoverage(bcs);
                    writer.write("            <line number=\"" + line + "\" hits=\"" + lc.getHits() + "\" branch=\"true\" condition-coverage=\"" + coverageString + "\">\n");
View Full Code Here

TOP

Related Classes of com.olabini.jescov.FileCoverage

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.