本文整理了Java中org.gradle.api.tasks.testing.Test.testLogging()
方法的一些代码示例,展示了Test.testLogging()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Test.testLogging()
方法的具体详情如下:
包路径:org.gradle.api.tasks.testing.Test
类名称:Test
方法名:testLogging
暂无
代码示例来源: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: 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"
) );
} );
}
}
内容来源于网络,如有侵权,请联系作者删除!