Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Include other datasets from xml

DBUnit recommends using Small Datasets but I found no example where a small dataset is included in the dataset. I need something similar to (pseudocode)

<dataset>
<!-- this tag is what I am looking for... ;-)-->
     <include_other_datasets_which_is_shared_between_different_datasets datasetname="other.xml"/>
<!-- normal xmldataset-definition begins... -->
<table name="foo">...</table>
</dataset>

Any ideas?

like image 436
EhmKah a.k.a. Michael Krauße Avatar asked Dec 01 '25 18:12

EhmKah a.k.a. Michael Krauße


1 Answers

There's no such feature exist in dbUnit as far as I know, and you don't really need that anyway.

Because you can simply execute an operation multiple time for different dataset.

DatabaseOperation.CLEAN_INSERT.execute(conn, "first_table.xml");
DatabaseOperation.CLEAN_INSERT.execute(conn, "second_table.xml");

or use CompositeDataSet to combine mutiple dataset into one in runtime.

like image 157
Rangi Lin Avatar answered Dec 03 '25 07:12

Rangi Lin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!