SQUASH TA:来自两个数据集的行可能无法正确匹配

SQUASH TA: The rows from two datasests might not be matched properly

到目前为止我做了什么:

test.ta

// -- 1 --
SETUP :
// -- 2 --
LOAD PRE/query1.sql AS query1.file
CONVERT query1.file TO query.sql AS query
// -- 3 --
# LOAD PRE/query1_expected.xml TO XML DATASET expected.dataset

// -- 4 --
TEST :
// -- 5 --
EXECUTE execute WITH query ON DB_INT3_PARC AS raw_result
// -- 6 --
CONVERT raw_result TO dataset.dbunit AS actual.dataset 
// -- 7 --
ASSERT actual.dataset IS equal WITH expected.dataset 

query1.sql

SELECT pid.ID ,pid.type , pid.system, P.ID_PRODUIT , p.ref_produit , p.libelle,P.TYPE as P_TYPE,r.id_ressource, p.id_party, p.statut 
FROM parc_produit p, parc_ressource r, parc_produit_id pid
WHERE r.VALEUR = 8933200000000221265 and r.nom_ressource = 'ICCID' AND r.id_produit = p.id_produit 
AND pid.id_produit = p.id_produit AND pid.system = '123'

query1_expected.xml

<?xml version="1.0"?> 
<dataset> 
    <default ID="0000009794" TYPE="PFI" SYSTEM="123" ID_PRODUIT="794" REF_PRODUIT='null' LIBELLE='null' P_TYPE="17" ID_RESSOURCE="121" ID_PARTY="101" STATUT="27"/> 
</dataset>

在DB中执行query1.sql时,输出为:

0000009794  PFI 123 794 (null) (null) 17    121 101 27

声明失败:

[FAIL] ASSERT actual.dataset IS equal WITH expected.dataset org.squashtest.ta.framework.exception.BinaryAssertionFailedException: The actual dataset was different from the expected one

执行报告:

  • Table "default": Warning: As table "default" has no (pseudo) primary key, the rows from the two datasets might not be matched properly. {libelle:expected='null'|actual='null'}{ref_produit:expected='null'|actual='null'}

感谢任何建议..

您是否有用于预期数据集中 "null" 的 ReplacementDataSet [0]?如果不是,则将其视为字符串。字符串 "null" 不等于实际数据集中的空值。

[0] http://dbunit.sourceforge.net/components.html#replacementdataset