testing - 在 Grails Spock 测试中是否有输出到 STDOUT 的方法?

标签 testing grails integration-testing spock

我想通过在每次测试开始时输出到 STDOUT 来跟踪我的 Grails Spock 集成测试的进度。因此,在测试运行时,服务和 Controller 的日志数据输出与显示测试开始的输出混合在一起。

例子:

开始测试 1

2012-02-09 13:01:41,375 [main] DEBUG  - Adding included service vertex 2 to DAG

2012-02-09 13:01:41,377 [main] DEBUG  - Adding this service vertex 4f34262584ae3fec6cc2d0f0 to DAG

开始测试2

2012-02-09 13:01:41,377 [main] DEBUG   - Connecting included service vertex 4f34262584ae3fec6cc2d0f0 to 2

2012-02-09 13:01:41,379 [main] DEBUG   - Added all the edges to the DAG for this service 4f34262584ae3fec6cc2d0f0

开始测试 3

...

最佳答案

println in cleanup:

grails test-app --echoOut

显示测试结束。

关于testing - 在 Grails Spock 测试中是否有输出到 STDOUT 的方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9218006/

相关文章:

maven - 如何在 jacoco :report? 之后禁用 jacoco-agent

javascript - 在 node.js 中返回一个函数的模拟模块

testing - 如何通过 jmeter 中的 websocket 采样器传递 json 请求?

ruby-on-rails - 如何有效测试未认证用户流量?

grails - 在Grails中获取当前的浏览器网址

java - 图片下载java的集成测试

ruby-on-rails - 如何设置一个 Rails 应用程序,然后设置一个使用所有相同代码但数据库不同的子域?

Grails Spring Security 插件 - 用户名转义问题

grails - 如何编写业务逻辑并保存在数据库中或返回给用户

maven - 使用Maven部署后如何运行测试?