当前位置: 首页>>代码示例>>Java>>正文


Java ReportBuilder.BASE_DIRECTORY属性代码示例

本文整理汇总了Java中net.masterthought.cucumber.ReportBuilder.BASE_DIRECTORY属性的典型用法代码示例。如果您正苦于以下问题:Java ReportBuilder.BASE_DIRECTORY属性的具体用法?Java ReportBuilder.BASE_DIRECTORY怎么用?Java ReportBuilder.BASE_DIRECTORY使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在net.masterthought.cucumber.ReportBuilder的用法示例。


在下文中一共展示了ReportBuilder.BASE_DIRECTORY属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: perform

@Override
public void perform(@Nonnull Run<?, ?> run, @Nonnull FilePath workspace, @Nonnull Launcher launcher, @Nonnull TaskListener listener)
        throws InterruptedException, IOException {

    generateReport(run, workspace, listener);

    SafeArchiveServingRunAction caa = new SafeArchiveServingRunAction(new File(run.getRootDir(), ReportBuilder.BASE_DIRECTORY),
            ReportBuilder.BASE_DIRECTORY, ReportBuilder.HOME_PAGE, CucumberReportBaseAction.ICON_NAME, Messages.SidePanel_DisplayName());
    run.replaceAction(caa);
}
 
开发者ID:jenkinsci,项目名称:cucumber-reports-plugin,代码行数:10,代码来源:CucumberReportPublisher.java

示例2: getUrlName

@Override
public String getUrlName() {
    Run<?, ?> run = this.project.getLastCompletedBuild();
    if (run != null) {
        return extractBuildNumber(run.getUrl()) + "/" + ReportBuilder.BASE_DIRECTORY + "/" + ReportBuilder.HOME_PAGE;
    }

    // none build was completed, report is yet not available
    return "";
}
 
开发者ID:jenkinsci,项目名称:cucumber-reports-plugin,代码行数:10,代码来源:CucumberReportProjectAction.java

示例3: generateReport

private void generateReport(Run<?, ?> build, FilePath workspace, TaskListener listener) throws InterruptedException, IOException {
    log(listener, "Preparing Cucumber Reports");

    // create directory where trends will be stored
    final File trendsDir = new File(build.getParent().getRootDir(), TRENDS_DIR);
    if (!trendsDir.exists()) {
        if (!trendsDir.mkdir()) {
            throw new IllegalStateException("Could not create directory for trends: " + trendsDir);
        }
    }

    // source directory (possibly on slave)
    String parsedJsonReportDirectory = evaluateMacro(build, workspace, listener, jsonReportDirectory);
    log(listener, String.format("JSON report directory is \"%s\"", parsedJsonReportDirectory));
    FilePath inputDirectory = new FilePath(workspace, parsedJsonReportDirectory);

    File directoryForReport = build.getRootDir();
    File directoryJsonCache = new File(directoryForReport, ReportBuilder.BASE_DIRECTORY + File.separatorChar + ".cache");
    if (!directoryJsonCache.exists() && !directoryJsonCache.mkdirs()) {
        throw new IllegalStateException("Could not create directory for cache: " + directoryJsonCache);
    }
    //Copies Json Files To Cache...
    int copiedFiles = inputDirectory.copyRecursiveTo(DEFAULT_FILE_INCLUDE_PATTERN, new FilePath(directoryJsonCache));
    log(listener, String.format("Copied %d json files from workspace \"%s\" to reports directory \"%s\"",
            copiedFiles, inputDirectory.getRemote(), directoryJsonCache));
    //Copies Classifications Files To Cache...
    int copiedFilesProperties = inputDirectory.copyRecursiveTo(DEFAULT_FILE_INCLUDE_PATTERN_CLASSIFICATIONS, new FilePath(directoryJsonCache));
    log(listener, String.format("Copied %d properties files from workspace \"%s\" to reports directory \"%s\"",
            copiedFilesProperties, inputDirectory.getRemote(), directoryJsonCache));

    // exclude JSONs that should be skipped (as configured by the user)
    String[] jsonReportFiles = findJsonFiles(directoryJsonCache, fileIncludePattern, fileExcludePattern);
    List<String> jsonFilesToProcess = fullPathToJsonFiles(jsonReportFiles, directoryJsonCache);
    log(listener, String.format("Processing %d json files:", jsonReportFiles.length));
    for (String jsonFile : jsonFilesToProcess) {
        log(listener, jsonFile);
    }

    String buildNumber = Integer.toString(build.getNumber());
    // this works for normal and multi-config/matrix jobs
    // for matrix jobs, this will include the matrix job name and the specific
    // configuration/permutation name as well. this also includes the '/' so
    // we don't have to modify how the cucumber plugin report generator's links
    String projectName = build.getParent().getDisplayName();

    Configuration configuration = new Configuration(directoryForReport, projectName);
    configuration.setParallelTesting(parallelTesting);
    configuration.setRunWithJenkins(true);
    configuration.setBuildNumber(buildNumber);
    configuration.setTrends(new File(trendsDir, TRENDS_FILE), trendsLimit);
    // null checker because of the regression in 3.10.2
    configuration.setSortingMethod(sortingMethod == null ? SortingMethod.NATURAL : SortingMethod.valueOf(sortingMethod));

    if (CollectionUtils.isNotEmpty(classifications)) {
        log(listener, String.format("Adding %d classifications", classifications.size()));
        addClassificationsToBuildReport(build, workspace, listener, configuration, classifications);
    }

    List<String> classificationFiles = fetchPropertyFiles(directoryJsonCache, listener);
    if(CollectionUtils.isNotEmpty(classificationFiles)) {
        configuration.addClassificationFiles(classificationFiles);
    }

    ReportBuilder reportBuilder = new ReportBuilder(jsonFilesToProcess, configuration);
    Reportable result = reportBuilder.generateReports();

    if (hasReportFailed(result, listener)) {
        // redefine build result if it was provided by plugin configuration
        if (buildStatus != null) {
            log(listener, "Build status is changed to " + buildStatus);
            build.setResult(Result.fromString(buildStatus));
        } else {
            log(listener, "Build status is left unchanged");
        }
    }
}
 
开发者ID:jenkinsci,项目名称:cucumber-reports-plugin,代码行数:76,代码来源:CucumberReportPublisher.java


注:本文中的net.masterthought.cucumber.ReportBuilder.BASE_DIRECTORY属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。