【问题标题】:Fixtures.loadYaml in FunctionalTest didn't really load the dataFunctionalTest 中的 Fixtures.loadYaml 并没有真正加载数据
【发布时间】:2011-08-27 19:24:07
【问题描述】:

我有以下功能测试,通过 fixtures.loadYaml 设置初始数据,但是当我查询测试用例中的记录时,我看不到它们。有什么原因吗?

public class UsersTest extends FunctionalTest {
    @Before
    public void setup() {
        Fixtures.loadYaml("data.yml");
    }

    @Test
    public void testIndex() {
        ....
    }

【问题讨论】:

  • 控制台在说什么?并启用 jpa.debugSQL 以获取更多信息!
  • @Zenklys,启用 jpa.debugSQL 后,我没有从控制台看到任何内容。

标签: playframework functional-testing fixtures


【解决方案1】:

根据最新版本 http://www.playframework.org/documentation/1.2.3/test 的文档,我改为调用 loadModels,它确实有效。

@Before
public void setup() {
    Fixtures.deleteAllModels();
    Fixtures.loadModels("data.yml");
}

【讨论】:

    猜你喜欢
    • 2019-04-19
    • 1970-01-01
    • 1970-01-01
    • 2013-08-17
    • 2018-07-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多