Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何为数据库组件编写jUnit测试用例?_Java_Maven_Testing_Junit_Jenkins - Fatal编程技术网

Java 如何为数据库组件编写jUnit测试用例?

Java 如何为数据库组件编写jUnit测试用例?,java,maven,testing,junit,jenkins,Java,Maven,Testing,Junit,Jenkins,我是jUnit的新手,我的任务是为具有一些复杂数据库组件的应用程序编写jUnit测试用例。我可以为DB组件编写测试用例,这些测试用例在本地maven构建中运行良好。但在部署框中,我在使用jenkins maven命令创建构建时没有可用的DB。请建议 通常的方法是在内存数据库环境中编写CRUD功能的单元测试。不完全是真的,但危险性要小得多。看看 通常的方法是在内存数据库环境中编写CRUD功能的单元测试。不完全是真的,但危险性要小得多。看看 通常的方法是在内存数据库环境中编写CRUD功能的单元测

我是jUnit的新手,我的任务是为具有一些复杂数据库组件的应用程序编写jUnit测试用例。我可以为DB组件编写测试用例,这些测试用例在本地maven构建中运行良好。但在部署框中,我在使用jenkins maven命令创建构建时没有可用的DB。请建议

通常的方法是在内存数据库环境中编写CRUD功能的单元测试。不完全是真的,但危险性要小得多。看看


通常的方法是在内存数据库环境中编写CRUD功能的单元测试。不完全是真的,但危险性要小得多。看看


通常的方法是在内存数据库环境中编写CRUD功能的单元测试。不完全是真的,但危险性要小得多。看看


通常的方法是在内存数据库环境中编写CRUD功能的单元测试。不完全是真的,但危险性要小得多。看看


您可以将基于模拟的单元测试和在real DB上运行的集成测试分离开来。仅在Jenkins中运行单元测试

您可以基于模拟将单元测试上的测试与在real DB上运行的集成测试分开。仅在Jenkins中运行单元测试

您可以基于模拟将单元测试上的测试与在real DB上运行的集成测试分开。仅在Jenkins中运行单元测试

您可以基于模拟将单元测试上的测试与在real DB上运行的集成测试分开。仅在Jenkins中运行单元测试有jUnit的扩展,其目的是在测试运行之间创建一个已知的可复制状态。在CI框(以及本地)上与内存中的DB(如HSQL或H2)一起使用应该非常适合您

干杯,

有对jUnit的扩展,其目的是在测试运行之间创建一个已知的可复制状态。在CI框(以及本地)上与内存中的DB(如HSQL或H2)一起使用应该非常适合您

I am working same kind of project. In our application we use test schema and a reusable class which loads the data from the XML(File is same as test class) and Cache the data and removes the data from the table, so that Unit test get intended data. 
We set different profile and these are set via JVM arguments. And these profile have the database details and any other admin stuff required. In case of Junit to run we use the unit test profile.
干杯,

有对jUnit的扩展,其目的是在测试运行之间创建一个已知的可复制状态。在CI框(以及本地)上与内存中的DB(如HSQL或H2)一起使用应该非常适合您

I am working same kind of project. In our application we use test schema and a reusable class which loads the data from the XML(File is same as test class) and Cache the data and removes the data from the table, so that Unit test get intended data. 
We set different profile and these are set via JVM arguments. And these profile have the database details and any other admin stuff required. In case of Junit to run we use the unit test profile.
干杯,

有对jUnit的扩展,其目的是在测试运行之间创建一个已知的可复制状态。在CI框(以及本地)上与内存中的DB(如HSQL或H2)一起使用应该非常适合您

I am working same kind of project. In our application we use test schema and a reusable class which loads the data from the XML(File is same as test class) and Cache the data and removes the data from the table, so that Unit test get intended data. 
We set different profile and these are set via JVM arguments. And these profile have the database details and any other admin stuff required. In case of Junit to run we use the unit test profile.
干杯

I am working same kind of project. In our application we use test schema and a reusable class which loads the data from the XML(File is same as test class) and Cache the data and removes the data from the table, so that Unit test get intended data. 
We set different profile and these are set via JVM arguments. And these profile have the database details and any other admin stuff required. In case of Junit to run we use the unit test profile.