本文整理了Java中org.gradle.api.tasks.testing.Test.getTestLogging()
方法的一些代码示例,展示了Test.getTestLogging()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Test.getTestLogging()
方法的具体详情如下:
包路径:org.gradle.api.tasks.testing.Test
类名称:Test
方法名:getTestLogging
暂无
代码示例来源:origin: gradle.plugin.de.uni-passau.fim.prog1pa/GradlePlugin
/**
* Configures the {@link Test} task to produces a shorter output when executing tests.
*
* @param project
* the {@link Project} that the {@link Plugin} is applied to
*/
private void configureTestTask(Project project) {
Test test = (Test) project.getTasks().getByName("test");
TestLoggingContainer testLogging = test.getTestLogging();
testLogging.events("failed", "passed");
testLogging.setExceptionFormat(TestExceptionFormat.FULL);
testLogging.setShowStackTraces(false);
}
代码示例来源:origin: steffenschaefer/gwt-gradle-plugin
@Override
public void execute(final Test testTask) {
testTask.getTestLogging().setShowStandardStreams(true);
final GwtTestExtension testExtension = testTask.getExtensions().create("gwt", GwtTestExtension.class);
testExtension.configure(gwtPluginExtension, (IConventionAware) testExtension);
project.afterEvaluate(new Action<Project>() {
@Override
public void execute(Project t) {
String gwtArgs = testExtension.getParameterString();
testTask.systemProperty("gwt.args", gwtArgs);
logger.info("Using gwt.args for test: "+ gwtArgs);
if (testExtension.getCacheDir() != null) {
testTask.systemProperty("gwt.persistentunitcachedir", testExtension.getCacheDir());
testExtension.getCacheDir().mkdirs();
logger.info("Using gwt.persistentunitcachedir for test: {0}", testExtension.getCacheDir());
}
}
});
project.getPlugins().withType(GwtWarPlugin.class, new Action<GwtWarPlugin>() {
@Override
public void execute(GwtWarPlugin t) {
testTask.dependsOn(GwtWarPlugin.TASK_WAR_TEMPLATE);
}});
}
});
代码示例来源:origin: gradle.plugin.de.uni-passau.fim.prog1pa/prog1pa
@Override
public void apply(Project project) {
project.getPluginManager().apply(JavaPlugin.class);
JavaPluginConvention javaPluginConv = project.getConvention().findPlugin(JavaPluginConvention.class);
javaPluginConv.setSourceCompatibility(JavaVersion.VERSION_1_8);
javaPluginConv.setTargetCompatibility(JavaVersion.VERSION_1_8);
project.getPluginManager().apply(IdeaPlugin.class);
project.getRepositories().mavenCentral();
project.getDependencies().add("testCompile", "junit:junit:4.12");
Wrapper wrapper = project.getTasks().create("wrapper", Wrapper.class);
wrapper.setGradleVersion("3.5");
Test test = (Test) project.getTasks().getByName("test");
TestLoggingContainer testLogging = test.getTestLogging();
testLogging.events("failed", "passed");
testLogging.setExceptionFormat(TestExceptionFormat.FULL);
testLogging.setShowStackTraces(false);
}
}
内容来源于网络,如有侵权,请联系作者删除!