Java Code Examples for org.wso2.carbon.automation.engine.frameworkutils.ReportGenerator

The following examples show how to use org.wso2.carbon.automation.engine.frameworkutils.ReportGenerator. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: product-ei   Source File: CarbonServerManager.java    License: Apache License 2.0 6 votes vote down vote up
private void generateCoverageReport(File classesDir)
        throws IOException, AutomationFrameworkException {

    CodeCoverageUtils.executeMerge(FrameworkPathUtil.getJacocoCoverageHome(),
                                   FrameworkPathUtil.getCoverageMergeFilePath());
    ReportGenerator reportGenerator =
            new ReportGenerator(new File(FrameworkPathUtil.getCoverageMergeFilePath()),
                                classesDir,
                                new File(CodeCoverageUtils.getJacocoReportDirectory()),
                                null);
    reportGenerator.create();

    log.info("Jacoco coverage dump file path : " + FrameworkPathUtil.getCoverageDumpFilePath());
    log.info("Jacoco class file path : " + classesDir);
    log.info("Jacoco coverage HTML report path : " + CodeCoverageUtils.getJacocoReportDirectory() + File.separator + "index.html");
}
 
Example 2
Source Project: micro-integrator   Source File: TestCoverageGenerator.java    License: Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) throws AutomationFrameworkException, IOException {
    if (carbonZip == null) {
        carbonZip = FrameworkPathUtil.getCarbonZipLocation();
        log.info("Using carbon zip file at  " + carbonZip);
    }
    if (carbonZip == null) {
        throw new IllegalArgumentException(
                "carbon zip file cannot find in the given location " + FrameworkPathUtil.getCarbonZipLocation());
    }
    String carbonHome = ArchiveExtractorUtil.setUpCarbonHome(carbonZip);
    File parentDirectory = new File(System.getProperty("basedir")).getParentFile();

    CodeCoverageUtils.executeMerge(parentDirectory.getAbsolutePath(), FrameworkPathUtil.getCoverageMergeFilePath());

    File carbonPluginDir = new File(
            carbonHome + File.separator + "wso2" + File.separator + "components" + File.separator + "plugins"
                    + File.separator);

    ReportGenerator reportGenerator = new ReportGenerator(new File(FrameworkPathUtil.getCoverageMergeFilePath()),
                                                          carbonPluginDir,
                                                          new File(CodeCoverageUtils.getJacocoReportDirectory()),
                                                          null);
    reportGenerator.create();

    File carbonHomeDir = new File(carbonHome);

    if (carbonHomeDir.exists()) {
        FileUtils.deleteQuietly(new File(carbonHome)); //delete extracted dir
    }

    log.info("Jacoco coverage merged file : " + FrameworkPathUtil.getCoverageMergeFilePath());
    log.info("Jacoco class file path : " + carbonPluginDir.getAbsolutePath());
    log.info("Jacoco coverage HTML report path : " + CodeCoverageUtils.getJacocoReportDirectory() + File.separator
                     + "index.html");
}
 
Example 3
Source Project: micro-integrator   Source File: CarbonServerManager.java    License: Apache License 2.0 5 votes vote down vote up
private void generateCoverageReport(File classesDir) throws IOException, AutomationFrameworkException {

        CodeCoverageUtils
                .executeMerge(FrameworkPathUtil.getJacocoCoverageHome(), FrameworkPathUtil.getCoverageMergeFilePath());
        ReportGenerator reportGenerator = new ReportGenerator(new File(FrameworkPathUtil.getCoverageMergeFilePath()),
                classesDir, new File(CodeCoverageUtils.getJacocoReportDirectory()), null);
        reportGenerator.create();

        log.info("Jacoco coverage dump file path : " + FrameworkPathUtil.getCoverageDumpFilePath());
        log.info("Jacoco class file path : " + classesDir);
        log.info("Jacoco coverage HTML report path : " + CodeCoverageUtils.getJacocoReportDirectory() + File.separator
                + "index.html");
    }
 
Example 4
Source Project: product-ei   Source File: TestCoverageGenerator.java    License: Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) throws AutomationFrameworkException, IOException {
    if (carbonZip == null) {
        carbonZip = FrameworkPathUtil.getCarbonZipLocation();
        log.info("Using carbon zip file at  " + carbonZip);
    }
    if (carbonZip == null) {
        throw new IllegalArgumentException("carbon zip file cannot find in the given location " +
                FrameworkPathUtil.getCarbonZipLocation());
    }
    String carbonHome = ArchiveExtractorUtil.setUpCarbonHome(carbonZip);
    File parentDirectory = new File(System.getProperty("basedir")).getParentFile();

    CodeCoverageUtils.executeMerge(parentDirectory.getAbsolutePath(), FrameworkPathUtil.getCoverageMergeFilePath());

    File carbonPluginDir =
            new File(carbonHome + File.separator + "wso2" +
                    File.separator + "components" + File.separator + "plugins" + File.separator);


    ReportGenerator reportGenerator =
            new ReportGenerator(new File(FrameworkPathUtil.getCoverageMergeFilePath()),
                    carbonPluginDir,
                    new File(CodeCoverageUtils.getJacocoReportDirectory()),
                    null);
    reportGenerator.create();

    File carbonHomeDir = new File(carbonHome);

    if (carbonHomeDir.exists()) {
        FileUtils.deleteQuietly(new File(carbonHome)); //delete extracted dir
    }

    log.info("Jacoco coverage merged file : " + FrameworkPathUtil.getCoverageMergeFilePath());
    log.info("Jacoco class file path : " + carbonPluginDir.getAbsolutePath());
    log.info("Jacoco coverage HTML report path : " + CodeCoverageUtils.getJacocoReportDirectory() + File.separator + "index.html");
}
 
Example 5
Source Project: product-iots   Source File: CarbonServerManagerExtension.java    License: Apache License 2.0 5 votes vote down vote up
private void generateCoverageReport(File classesDir) throws IOException, AutomationFrameworkException {
    checkJacocoDataFileSizes(FrameworkPathUtil.getJacocoCoverageHome());
    CodeCoverageUtils.executeMerge(FrameworkPathUtil.getJacocoCoverageHome(), FrameworkPathUtil.getCoverageMergeFilePath());
    ReportGenerator reportGenerator = new ReportGenerator(new File(FrameworkPathUtil.getCoverageMergeFilePath()), classesDir, new File(CodeCoverageUtils.getJacocoReportDirectory()), (File)null);
    reportGenerator.create();
    log.info("Jacoco coverage dump file path : " + FrameworkPathUtil.getCoverageDumpFilePath());
    log.info("Jacoco class file path : " + classesDir);
    log.info("Jacoco coverage HTML report path : " + CodeCoverageUtils.getJacocoReportDirectory() + File.separator + "index.html");
}
 
Example 6
Source Project: attic-stratos   Source File: StratosTestServerManager.java    License: Apache License 2.0 5 votes vote down vote up
private void generateCoverageReport(File classesDir) throws IOException, AutomationFrameworkException {
    CodeCoverageUtils
            .executeMerge(FrameworkPathUtil.getJacocoCoverageHome(), FrameworkPathUtil.getCoverageMergeFilePath());
    ReportGenerator reportGenerator = new ReportGenerator(new File(FrameworkPathUtil.getCoverageMergeFilePath()),
            classesDir, new File(CodeCoverageUtils.getJacocoReportDirectory()), (File) null);
    reportGenerator.create();
    log.info("Jacoco coverage dump file path : " + FrameworkPathUtil.getCoverageDumpFilePath());
    log.info("Jacoco class file path : " + classesDir);
    log.info("Jacoco coverage HTML report path : " + CodeCoverageUtils.getJacocoReportDirectory() +
            File.separator + "index.html");
}