Tabnine Logo
TestTaskReports
Code IndexAdd Tabnine to your IDE (free)

How to use
TestTaskReports
in
org.gradle.api.tasks.testing

Best Java code snippets using org.gradle.api.tasks.testing.TestTaskReports (Showing top 10 results out of 315)

origin: gradle.plugin.com.xenoterracide/gradle-junit

  @Override
  public void apply( Project project ) {
    project.getTasks().withType( Test.class ).configureEach( task -> {
      task.useJUnitPlatform();
      task.testLogging( log -> log.info( info -> info.getEvents().add( TestLogEvent.PASSED ) ) );
      task.reports( reports -> {
        reports.getJunitXml().setEnabled( true );
        reports.getHtml().setEnabled( false );
      } );
    } );
  }
}
origin: SonarSource/sonar-scanner-gradle

private static void configureTestReports(Test testTask, Map<String, Object> properties) {
 File testResultsDir = testTask.getReports().getJunitXml().getDestination();
 // do not set a custom test reports path if it does not exists, otherwise SonarQube will emit an error
 // do not set a custom test reports path if there are no files, otherwise SonarQube will emit a warning
 if (testResultsDir.isDirectory()
  && asList(testResultsDir.list()).stream().anyMatch(file -> TEST_RESULT_FILE_PATTERN.matcher(file).matches())) {
  appendProp(properties, "sonar.junit.reportPaths", testResultsDir);
  // For backward compatibility
  appendProp(properties, "sonar.junit.reportsPath", testResultsDir);
  appendProp(properties, "sonar.surefire.reportsPath", testResultsDir);
 }
}
origin: palantir/gradle-baseline

private void configurePluginsForArtifacts(Project project) {
  String circleArtifactsDir = System.getenv("CIRCLE_ARTIFACTS");
  if (circleArtifactsDir == null) {
    project.getLogger().info("$CIRCLE_ARTIFACTS variable is not set, not configuring junit/profiling reports");
    return;
  }
  try {
    Files.createDirectories(Paths.get(circleArtifactsDir), PERMS_ATTRIBUTE);
  } catch (IOException e) {
    throw new RuntimeException("failed to create CIRCLE_ARTIFACTS directory", e);
  }
  project.getRootProject().allprojects(proj ->
      proj.getTasks().withType(Test.class, test -> {
        test.getReports().getHtml().setEnabled(true);
        test.getReports().getHtml().setDestination(junitPath(circleArtifactsDir, test.getPath()));
      }));
}
origin: org.sonarsource.scanner.gradle/sonarqube-gradle-plugin

private static void configureTestReports(Test testTask, Map<String, Object> properties) {
 File testResultsDir = testTask.getReports().getJunitXml().getDestination();
 // do not set a custom test reports path if it does not exists, otherwise SonarQube will emit an error
 // do not set a custom test reports path if there are no files, otherwise SonarQube will emit a warning
 if (testResultsDir.isDirectory()
  && asList(testResultsDir.list()).stream().anyMatch(file -> TEST_RESULT_FILE_PATTERN.matcher(file).matches())) {
  appendProp(properties, "sonar.junit.reportPaths", testResultsDir);
  // For backward compatibility
  appendProp(properties, "sonar.junit.reportsPath", testResultsDir);
  appendProp(properties, "sonar.surefire.reportsPath", testResultsDir);
 }
}
origin: gradle.plugin.com.intershop.gradle.plugin.azure/azurePlugin

  @Override
  void configure(Task task)
  {
    super.configure(task);

    Task prepareMonitorEnvTask = project.getTasks().findByName(AzurePlugin.PREPARE_MONITOR_ENV_TASK);

    Test t = (Test)task;

    t.setDescription("Test execution of the azureTest source set against production deployment.");

    t.dependsOn(prepareMonitorEnvTask);

    t.setClasspath(sourceSet.getRuntimeClasspath());
    t.setTestClassesDirs(sourceSet.getOutput().getClassesDirs());

    t.systemProperty("testEnvPath", azure.getMonitorEnvFile().get().getAsFile().getAbsolutePath());

    t.setBinResultsDir(new File(project.getBuildDir(), "monitor-test-results/binary/test"));

    t.getReports().getHtml().setDestination(new File(project.getBuildDir(), "reports/monitor-test-results" ));
    t.getReports().getJunitXml().setDestination(new File(project.getBuildDir(), "monitor-test-results" ));
  }
}
origin: palantir/gradle-baseline

  test.getReports().getJunitXml().setEnabled(true);
  test.getReports().getJunitXml().setDestination(junitPath(circleReportsDir, test.getPath()));
});
proj.getTasks().withType(Checkstyle.class, checkstyle ->
origin: gradle.plugin.com.xenoterracide.gradle/gradle-plugin-bundle

  @Override
  public void apply( Project project ) {
    project.getPluginManager().apply( JavaLibraryPlugin.class );
    DependencyHandler deps = project.getDependencies();
    deps.add( TEST_IMPL, String.join( D, Junit.G, Junit.Api.A ) );
    deps.add( TEST_IMPL, String.join( D, Junit.G, Junit.Param.A ) );
    deps.add( TEST_RUN, String.join( D, Junit.G, Junit.Engine.A ) );
    deps.add( TEST_IMPL, String.join( D, AssertJ.G, AssertJ.A ) );

    project.getTasks().withType( Test.class ).configureEach( task -> {
      task.useJUnitPlatform();
      task.testLogging( log -> log.info( info -> info.getEvents().add( TestLogEvent.PASSED ) ) );
      task.reports( reports -> {
        reports.getJunitXml().setEnabled( true );
        reports.getHtml().setEnabled( false );
      } );
    } );
  }
}
origin: gradle.plugin.com.xenoterracide.gradle/pluginbundle

  @Override
  public void apply( Project project ) {
    project.getPluginManager().apply( JavaLibraryPlugin.class );
    DependencyHandler deps = project.getDependencies();
    deps.add( TEST_IMPL, String.join( D, Junit.G, Junit.Api.A ) );
    deps.add( TEST_IMPL, String.join( D, Junit.G, Junit.Param.A ) );
    deps.add( TEST_RUN, String.join( D, Junit.G, Junit.Engine.A ) );
    deps.add( TEST_IMPL, String.join( D, AssertJ.G, AssertJ.A ) );

    project.getTasks().withType( Test.class ).configureEach( task -> {
      task.useJUnitPlatform();
      task.testLogging( log -> log.info( info -> info.getEvents().add( TestLogEvent.PASSED ) ) );
      task.reports( reports -> {
        reports.getJunitXml().setEnabled( true );
        reports.getHtml().setEnabled( false );
      } );
    } );
    project.getTasks().withType( JavaCompile.class ).configureEach( task -> {
      CompileOptions options = task.getOptions();
      options.setAnnotationProcessorGeneratedSourcesDirectory( Paths.get( "build/generated/src" ).toFile() );
      options.getCompilerArgs().addAll( Arrays.asList(
          "-parameters",
          "-Xlint:deprecation"
      ) );
    } );
  }
}
origin: com.android.tools.build/gradle-core

ConfigurableReport xmlReport = testTaskReports.getJunitXml();
xmlReport.setDestination(
    new File(
        runTestsTask.getName()));
ConfigurableReport htmlReport = testTaskReports.getHtml();
htmlReport.setDestination(
    new File(
origin: com.amazon.device.tools.build/gradle-core

  testTaskReports.getJunitXml(), testTaskReports.getHtml()}) {
report.setDestination(new File(report.getDestination(), testedVariantData.getName()));
org.gradle.api.tasks.testingTestTaskReports

Most used methods

  • getJunitXml
  • getHtml

Popular in Java

  • Making http post requests using okhttp
  • notifyDataSetChanged (ArrayAdapter)
  • getSystemService (Context)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Menu (java.awt)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • BoxLayout (javax.swing)
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now