在 DB 中为 jBehave 测试故事设置测试数据
我希望完整地使用 jBehave 作为集成测试框架,因此在开始特定的测试故事之前,我需要某种明确的方法在数据库中设置测试数据,类似于将 DbUnit 与 jUnit 一起使用,其中我们定义测试数据 XML对于每个测试用例。有没有办法用或不用 DbUnit 来实现这一目标?
I wish to use jBehave in completeness as an integration testing framework and therefore I need some definite way of setting up the Test data in the database before I begin with a particular test story something similar to using DbUnit with jUnit where we define the test data XMLs for each test case. Is there a way to achieve this with or with out DbUnit ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
JBehave 示例中包含的 spring-security 示例正是这样做的。它使用 DbUnit 作为 @BeforeStory 清除数据库。
如果您需要特定数据,那么您可能需要创建 GivenStories 或让 Gives 加载特定数据文件。
The spring-security example that is contained in JBehave examples does exactly that. It uses DbUnit to wipe out the database as a @BeforeStory.
If you want specific data, then you might want to create GivenStories or have Givens that load specific data files.