DBunit和数据集列 [英] DBunit and dataset column
本文介绍了DBunit和数据集列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想尝试用DBUnit进行单元测试,但是我的数据集有问题。
I want to try to make unit test with DBUnit but I have a problem with my dataset.
这是我的持久对象:
@Entity
@Table(name = "personnes")
public class Personne implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Integer pk;
@Column
private String name;
}
我的数据集:
<?xml version='1.0' encoding='UTF-8'?>
<dataset>
<personnes name="toto" pk="1" />
</dataset>
我的问题是名称列,我收到这个错误:
My problem is with the name column, I get this error:
org.dbunit.dataset.NoSuchColumnException: personnes.NAME - (Non-uppercase input column: name) in ColumnNameToIndexes cache map. Note that the map's column names are NOT case sensitive.
我不明白为什么dbunit搜索列NAME,而我的列是名称。
I don't understand why dbunit search a column "NAME" whereas my column is "name".
感谢您的帮助。
推荐答案
通过将dbunit从2.4.8版本恢复到2.2.2。我用单位3.8使用它。
I just solved this issue by reverting dbunit from version 2.4.8 to 2.2.2. I'm using it with unitils 3.8.
这篇关于DBunit和数据集列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文