org.gradle.api.tasks.testing.Test.getProject()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(124)

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

Test.getProject介绍

暂无

代码示例

代码示例来源:origin: gradle.plugin.de.monkeyworks.buildmonkey/gradle.pde

private PluginTestExtension getExtension(Test testTask) {
  return (PluginTestExtension) testTask.getProject().getExtensions().findByName("pluginTest");
}

代码示例来源:origin: gradle.plugin.de.monkeyworks.buildmonkey/gradle.pde

private FileResolver getFileResolver(Test testTask) {
  return testTask.getProject().getPlugins().findPlugin(PluginTestPlugin.class).fileResolver;
}

代码示例来源:origin: gradle.plugin.de.monkeyworks.buildmonkey/gradle.pde

private void runPluginTestsInEclipse(final Test testTask, final TestResultProcessor testResultProcessor,
    final int pluginTestPort) {
  ExecutorService threadPool = Executors.newFixedThreadPool(2);
  File runDir = new File(testTask.getProject().getBuildDir(), testTask.getName());

代码示例来源:origin: gradle.plugin.rgoldberg/java-modules

private void configureTestTask(final Test test, final ImmutableSet<String> moduleNameIset) {
  setModuleNamesInputProperty(test, moduleNameIset);
  test.doFirst(task -> {
    final Project project = test.getProject();
    final List<String> args = test.getJvmArgs();
    addModulePathArgument(args, test.getClasspath());
    args.add(OPTION_ADD_MODULES);
    args.add(ALL_MODULE_PATH);
    KnownTestFrameworkModuleInfo.from(test).configureTestTask(args, moduleNameIset);
    addPatchModuleArguments(args, moduleNameIset, project.files(getSourceSets(project).getByName(TEST_SOURCE_SET_NAME).getJava().getOutputDir()));
    test.setClasspath(project.files());
  });
}

代码示例来源:origin: com.tngtech.jgiven/jgiven-gradle-plugin

private void applyTo( Test test ) {
  final String testName = test.getName();
  final JGivenTaskExtension extension = test.getExtensions().create( "jgiven", JGivenTaskExtension.class );
  final Project project = test.getProject();
  ( (IConventionAware) extension ).getConventionMapping().map( "resultsDir", new Callable<File>() {
    @Override
    public File call() {
      return project.file( String.valueOf( project.getBuildDir() ) + "/jgiven-results/" + testName );
    }
  } );
  File resultsDir = extension.getResultsDir();
  if( resultsDir != null ) {
    test.getOutputs().dir(resultsDir).withPropertyName("jgiven.resultsDir");
  }
  test.prependParallelSafeAction( new Action<Task>() {
    @Override
    public void execute( Task task ) {
      Test test = (Test) task;
      test.systemProperty( Config.JGIVEN_REPORT_DIR, extension.getResultsDir().getAbsolutePath() );
    }
  } );
}

相关文章