gpt4 book ai didi

com.palantir.gradle.circlestyle.XmlReportFailuresSupplier.create()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-18 11:58:40 27 4
gpt4 key购买 nike

本文整理了Java中com.palantir.gradle.circlestyle.XmlReportFailuresSupplier.create()方法的一些代码示例,展示了XmlReportFailuresSupplier.create()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XmlReportFailuresSupplier.create()方法的具体详情如下:
包路径:com.palantir.gradle.circlestyle.XmlReportFailuresSupplier
类名称:XmlReportFailuresSupplier
方法名:create

XmlReportFailuresSupplier.create介绍

暂无

代码示例

代码示例来源:origin: palantir/gradle-baseline

checkstyle,
        timer,
        XmlReportFailuresSupplier.create(checkstyle, new CheckstyleReportHandler()),
        Paths.get(circleReportsDir, "checkstyle")));
proj.getTasks().withType(JavaCompile.class, javac ->

代码示例来源:origin: palantir/gradle-baseline

@Test
public void translatesCheckstyleReport() throws IOException, TransformerException {
  Project project = ProjectBuilder.builder().withName("fooproject").withProjectDir(projectDir.getRoot()).build();
  Checkstyle checkstyle = createCheckstyleTask(project);
  checkstyle.setDidWork(true);
  TaskTimer timer = mock(TaskTimer.class);
  when(timer.getTaskTimeNanos(checkstyle)).thenReturn(FAILED_CHECKSTYLE_TIME_NANOS);
  File targetFile = new File(projectDir.getRoot(), "reports/report.xml");
  CircleStyleFinalizer finalizer = (CircleStyleFinalizer) project
      .task(ImmutableMap.of("type", CircleStyleFinalizer.class), "checkstyleTestCircleFinalizer");
  finalizer.setStyleTask(checkstyle);
  finalizer.setTaskTimer(timer);
  finalizer.setFailuresSupplier(XmlReportFailuresSupplier.create(checkstyle, new CheckstyleReportHandler()));
  finalizer.setTargetFile(targetFile);
  finalizer.createCircleReport();
  String report = Resources.toString(targetFile.toURI().toURL(), StandardCharsets.UTF_8)
      .replaceAll("\\p{Blank}*(?=<)", "");
  String expectedReport = Resources.toString(
      testFile("two-namecheck-failures-checkstyle-report.xml"), StandardCharsets.UTF_8);
  assertThat(report).isEqualTo(expectedReport);
}

代码示例来源:origin: palantir/gradle-circle-style

@Test
public void translatesCheckstyleReport() throws IOException, TransformerException {
  Project project = ProjectBuilder.builder().withName("fooproject").withProjectDir(projectDir.getRoot()).build();
  Checkstyle checkstyle = createCheckstyleTask(project);
  checkstyle.setDidWork(true);
  StyleTaskTimer timer = mock(StyleTaskTimer.class);
  when(timer.getTaskTimeNanos(checkstyle)).thenReturn(FAILED_CHECKSTYLE_TIME_NANOS);
  File targetFile = new File(projectDir.getRoot(), "reports/report.xml");
  CircleStyleFinalizer finalizer = (CircleStyleFinalizer) project
      .task(ImmutableMap.of("type", CircleStyleFinalizer.class), "checkstyleTestCircleFinalizer");
  finalizer.setStyleTask(checkstyle);
  finalizer.setStyleTaskTimer(timer);
  finalizer.setFailuresSupplier(XmlReportFailuresSupplier.create(checkstyle, new CheckstyleReportHandler()));
  finalizer.setTargetFile(targetFile);
  finalizer.createCircleReport();
  String report = Resources.toString(targetFile.toURI().toURL(), UTF_8);
  String expectedReport = Resources.toString(testFile("two-namecheck-failures-checkstyle-report.xml"), UTF_8);
  assertThat(report).isEqualTo(expectedReport);
}

代码示例来源:origin: palantir/gradle-baseline

@Test
public void doesNothingIfTaskSkipped() throws IOException, TransformerException {
  Project project = ProjectBuilder.builder().withName("fooproject").withProjectDir(projectDir.getRoot()).build();
  Checkstyle checkstyle = createCheckstyleTask(project);
  checkstyle.setDidWork(false);
  TaskTimer timer = mock(TaskTimer.class);
  when(timer.getTaskTimeNanos(checkstyle)).thenReturn(FAILED_CHECKSTYLE_TIME_NANOS);
  File targetFile = new File(projectDir.getRoot(), "reports/report.xml");
  CircleStyleFinalizer finalizer = (CircleStyleFinalizer) project
      .task(ImmutableMap.of("type", CircleStyleFinalizer.class), "checkstyleTestCircleFinalizer");
  finalizer.setStyleTask(checkstyle);
  finalizer.setTaskTimer(timer);
  finalizer.setFailuresSupplier(XmlReportFailuresSupplier.create(checkstyle, new CheckstyleReportHandler()));
  finalizer.setTargetFile(targetFile);
  finalizer.createCircleReport();
  assertThat(targetFile).doesNotExist();
  assertThat(finalizer.getDidWork()).isFalse();
}

代码示例来源:origin: palantir/gradle-circle-style

@Test
public void doesNothingIfTaskSkipped() throws IOException, TransformerException {
  Project project = ProjectBuilder.builder().withName("fooproject").withProjectDir(projectDir.getRoot()).build();
  Checkstyle checkstyle = createCheckstyleTask(project);
  checkstyle.setDidWork(false);
  StyleTaskTimer timer = mock(StyleTaskTimer.class);
  when(timer.getTaskTimeNanos(checkstyle)).thenReturn(FAILED_CHECKSTYLE_TIME_NANOS);
  File targetFile = new File(projectDir.getRoot(), "reports/report.xml");
  CircleStyleFinalizer finalizer = (CircleStyleFinalizer) project
      .task(ImmutableMap.of("type", CircleStyleFinalizer.class), "checkstyleTestCircleFinalizer");
  finalizer.setStyleTask(checkstyle);
  finalizer.setStyleTaskTimer(timer);
  finalizer.setFailuresSupplier(XmlReportFailuresSupplier.create(checkstyle, new CheckstyleReportHandler()));
  finalizer.setTargetFile(targetFile);
  finalizer.createCircleReport();
  assertThat(targetFile).doesNotExist();
  assertThat(finalizer.getDidWork()).isFalse();
}

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com