DatabaseOperation.DELETEThis operation deletes only the dataset contents from the database. This operation does not delete the entire table contents but only data that are present in the dataset.
DatabaseOperation.DELETE_ALL Deletes all rows of tables present in the specified dataset. If the dataset does not contains a particular table, but that table exists in the database, the database table is not affected. Table are truncated in reverse sequence.
DatabaseOperation.CLEAN_INSERT This composite operation performs a
DELETE_ALL operation followed by an
INSERT operation. This is the safest approach to ensure that the database is in a known state. This is appropriate for tests that require the database to only contain a specific set of data.
以上信息来自
http://dbunit.sourceforge.net/components.html从上开始看出,
DatabaseOperation.DELETE 只删除数据集文件中准备的数据.不删除你另外插入的数据
DatabaseOperation.DELETE_ALL 将删除数据集文件中出现的表中的所有数据,也就是如果你往数据集表中插入了数据,那么也会删除.表本身不会被删除.而且表会被trucate
另外:
DatabaseOperation.CLEAN_INSERT是DELETE_ALL和 INSERT的绑定.
分享到:
相关推荐
DBUnit_Project_Study.rar DBUnit_Project_Study.rar DBUnit_Project_Study.rar DBUnit_Project_Study.rar
dbunit-2.2.3..jar dbunit-2.4.2.jar dbunit-2.5.3.jar dbunit-2.7.0.jar 发现每个版本对JDK是有要求的,比如2.7 只能用于JDK1.8版本,所以整理好几个jar包挑选适合自己的
采用 Java 编写的数据库系统单元测试程序。
一个基于JUnit测试框架的关于数据库的测试框架,不错!
dfdfddfskfjdsklfjksdljflksjfsjlkfdjlksfjkdsjfsdjkflsjkf
DbUnit(http://dbunit.sourceforge.net/)则是专 门针对数据库测试的对JUnit的一个扩展, 它可以将测试对象数据库置于一个测试轮回之间的状态。 这个是主要jar包
DbUnit is a JUnit extension (also usable with Ant) targeted for database-driven projects that, among other things, puts your database into a known state between test runs. This is an excellent way to ...
dbunit-2.4.2.jar dbunit 必要的一个jar
dbunit_jar_and_htmldoc
dbunit的jar包,版本2.2
java连接数据库最好的选择,可以用于,flash能过控制java来运用数据库
使用DbUnit测试数据库.pdf
DbUnit2.4.9,包括dbunit-2.4.9.jar、dbunit-2.4.9-sources.jar、dbunit-2.4.9-javadoc.jar,是junit的扩展,主要用于代码对数据库操作的单元测试。
Dbunit 基本原理就是在跑测试用例运行之前对数据表做用户定义的操作,清空不想要的数据,插入用户自定义的数据,使得该数据表处于用户知道的一种状态。而用户自定义的数据使用项目里的一个 xml 文件来表示。 Xml ...
maven-dbunit-plugin-20030818.022735.jar
maven-dbunit-plugin-20030814.080708.jar
maven-dbunit-plugin-20030413.024213.jar
3.2.4. DatabaseOperation.CLEAN_INSERT 策略 10 3.2.5. 为相互关联的测试场景创建多个种子文件是一个很有效的策略. 10 3.3. 自我总结 10 3.3.1. 对各种类型的方法的测试策略: 10 3.3.2. 写一个基TestCase。 10 ...
maven-dbunit-plugin-1.8.jar
maven-dbunit-plugin-1.7.jar