本文整理了Java中org.gradle.api.tasks.testing.Test.getName()
方法的一些代码示例,展示了Test.getName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Test.getName()
方法的具体详情如下:
包路径:org.gradle.api.tasks.testing.Test
类名称:Test
方法名:getName
暂无
代码示例来源:origin: uber/okbuck
@Override
public TestOptions getTestOptions() {
String testTaskName =
VariantType.UNIT_TEST_PREFIX
+ StringUtils.capitalize(getName())
+ VariantType.UNIT_TEST_SUFFIX;
List<Test> testTasks = ImmutableList.copyOf(getProject().getTasks().withType(Test.class));
Optional<Test> optionalTest =
testTasks.stream().filter(test -> test.getName().equals(testTaskName)).findFirst();
List<String> jvmArgs =
optionalTest.map(Test::getAllJvmArgs).orElseGet(Collections::<String>emptyList);
Map<String, Object> env =
optionalTest.map(Test::getEnvironment).orElseGet(Collections::emptyMap);
System.getenv().keySet().forEach(env::remove);
return new TestOptions(jvmArgs, env);
}
代码示例来源:origin: com.tngtech.jgiven/jgiven-gradle-plugin
@Override
public void execute( final Test test ) {
final JGivenReportTask reportTask = project.getTasks()
.create( "jgiven" + WordUtil.capitalize( test.getName() ) + "Report", JGivenReportTask.class );
configureDefaultReportTask( test, reportTask, reportingExtension );
}
} );
代码示例来源: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: 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() );
}
} );
}
内容来源于网络,如有侵权,请联系作者删除!