FlatXmlDataSet empty table (DBUnit)
Asked Answered
H

1

8

Is it possible to validate that the database has no rows for a specific table with a flat xml structure? Something like:

<dataset>
   <TABLE/>
</dataset

but that isn't working because, I think, it only validates if the 'TABLE' exists..

I'm testing a delete..

Hageman answered 20/8, 2015 at 15:0 Comment(0)
R
3

Currently, I have the same issue and I found the workaround. You can set all fields non-Required and your .xml file will be looking like

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE dataset SYSTEM "dbschema.dtd">
<dataset>
    <NameOfYourTable/>
</dataset>

I hope it will help other people.

Reitz answered 16/11, 2017 at 11:15 Comment(1)
sorry - could you please explain how to set all fields to non-Required? :)Hernardo

© 2022 - 2024 — McMap. All rights reserved.