DbUnitDataImportExport
DbUnitDataImportExport
DbUnitDataImportExport is a utility that Mifos uses to:
- Import DbUnit XML files
- Export DbUnit XML files
- Export MySQL dumps
The utility is located in testFramework/src/main/java/org/mifos/test/framework/util.
The easiest way to run this program is from within Eclipse, by right clicking the file DbUnitDataImportExport.java and choosing "Run as Java Program". By clicking "Run configurations..." you get to set up arguments for the program.
All the arguments are listed when "h" or "-help" is supplied as a (command line) argument to the file.
Example export usage
Let's say we want to dump the "mifostest" database to a file named "databasedump.xml". The user root with password root has access to this database.
Set program arguments to:
-x -d mifostest -f databasedump.xml -u root -p root
The -x is for exporting, -d for the database name, -f for the output file and -u/-p for user/password respectively.
There's also an option to dump to an MySQL dump, using -s combined with -x.
Example import usage
We want to import the file acceptance_small_003_dbunit.xml to our "mifostest" database (user/pass same as above).
Set program arguments to:
-i -d mifostest -u root -p root -f acceptance_small_003_dbunit.xml