建议一个JPA单元测试框架 [英] Suggest a JPA Unit test framework

查看:104
本文介绍了建议一个JPA单元测试框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何对JPA代码进行单元测试?有什么办法可以自己生成单元测试用例?

How to unit test JPA code? is there any way to generate Unit Test case itself?

注意:我很懒,对单元测试代码还是陌生的.

Note: I am lazy and new to Unit Test code.

推荐答案

检查一下, Unitils .这是相关讨论,其中包含一些示例代码.

Check this out, Unitils. Here is a related discussion, with some example codes.

以下是示例,其中同时显示了 DBUnit,Spring和OpenJPA .您可能不会全部使用,但我相信,如果您想使用 DBUnit ,这可以带您到某个地方.

Here is the example, showing DBUnit, Spring and OpenJPA together. You might not using all, but this can take you somewhere if you want to go with DBUnit, I believe.

这篇关于建议一个JPA单元测试框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆