What kind of tools are available for populating test data in mongodb. We have used dbunit in the past, but it doesn't seem to have an equivalent maven plugin.
-
I don-t know mongodb but i found [mock-fake-test-data-generator-into-net-classes](http://stackoverflow.com/questions/3917628/mock-fake-test-data-generator-into-net-classes) that shows how to do it without any database. – k3b Dec 15 '10 at 12:21
-
am looking for something specific to mongodb – Jason Dec 15 '10 at 12:23
-
What programming language are you using? – Justin Jenkins Dec 15 '10 at 23:37
2 Answers
First question is from what source you want load data? From another mongodb, from sql, from xml, from text file, etc..
As for me, i using some helper classes(one per each my mongo document) thats create some entity, that i need during testing. Also i have one test class per each my business object, and before test start i run helpers in order to create test environment, after test finished i delete all created data. Such approach work even at production database.
I can suggest another approch. For example if you have some production mongo db with data you can copy mongo data, run new mongo db on this data and run your tests and after tests has finished, delete this db.

- 52,935
- 16
- 139
- 134
http://eliothorowitz.com/post/459890033/streaming-twitter-into-mongodb how does this look? Now all you need is a JSON or CSV generator which is much easier to be found.

- 11,270
- 7
- 55
- 129