| || |
Unit tests for access methods to database
How used Junit for testing the access methods to a database (insert, store, update) ?
Its impossible to simulate a database, so I search a method for testing these methods.
Re: Unit tests for access methods to database
It is possible to simulate a dirver used to access a DB at some level. If the code is properly written, for example, you might be able to settle (at least at some level of testing) with writing a proxy that captures the SQL statements and compare them to the expected statements.
Another option is to write test code that checks the state of the DB after each test, to verify that the state is as expected.
You can read more about this at:
You can also search for "mock objects".