开发者

How to create testdata for system tests - using system interface vs. db inserts?

We have a couple of webservice systems(cxf and hibernate). The webservices are used by webfrontends(rails).

I would like to write some automated integrations test with capybara, and in order to test the correct workflow, we need some testdata in the database. Since the db model quite complex, it would be very hard to create and meintain the test data with sql.

Another option would be to use the webservices itself to setup some data, i.e. in the setu开发者_如何转开发p of the test I could use some "createCustomer" interface to use business functionality provided by the application.

Does anyone has some experiences with the setup of test data? Personally I dont like the approach to use the business interface to create test data, since I would couple the frontend test to a process, which are not really related.


A couple of ideas:
- use SQL scripts (I know you've written it would be very hard, but IME, SQL scripts are easily set up, easy to read and maintain)
- use your RDBMS's import/export utility (e.g. impdp/expdp for Oracle)
- setup a virtual machine for your RDBMS, and rollback to a snapshot every time when running the test

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜