【问题标题】:Grails run test-app with Forked Grails VM exited with errorGrails 运行测试应用程序,分叉 Grails VM 退出并出现错误
【发布时间】:2015-11-11 02:50:52
【问题描述】:

当我在我的 grails 2.4.2 上运行 grails test-app 时发生错误,但是 run-app 没问题。

我正在使用 grails 2.4.2

错误日志是这样的:

Failure:  initializationError(org.junit.runner.manipulation.Filter)
|  java.lang.Exception: No tests found matching grails test target pattern filter from org.junit.runner.Request$1@19535154
    at org.junit.internal.requests.FilterRequest.getRunner(FilterRequest.java:35)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:138)
| Completed 1 unit test, 1 failed in 0m 0s
| Tests FAILED  - view reports in /home/pinhaoo/grailsworkspace/testing/target/test-reports
| Error Forked Grails VM exited with error

感谢任何帮助

【问题讨论】:

  • 您查看提供的测试报告了吗?它应该有望向您展示失败的原因和原因。如果这还不够,您需要提供比这里更多的信息,这太稀疏了,无法帮助提供答案。

标签: grails


【解决方案1】:

我遇到了类似的问题。我在这里找到了解决方案:Grails User archive。我所要做的就是将 'given:' 关键字添加到任何单元测试中。不是所有人都需要,只是为了一个。之后,“test-app”命令对我来说效果很好。显然,这是因为您的测试类都没有实现任何测试方法。这是我的测试类的样子:

import grails.test.mixin.TestFor
import spock.lang.Specification
import ticketsystem.Theater

@TestFor(Theater)
class TheaterSpec extends Specification {

    void "test something"() {
        given: "test"
    }
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-04-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多