[OPEN-ILS-DEV] writing tests for OpenSRF methods?

Scott Prater sprater at gmail.com
Tue Dec 27 18:12:26 EST 2011


I've made the changes needed in the admin client (statistical category
editor) to implement the enhancements to patron statistical categories
( see the proposal at
http://evergreen-ils.org/dokuwiki/doku.php?id=dev:proposal:patron_statistical_categories
).  I did some pretty thorough and mind-crushingly dull manual testing
in the staff admin client to make sure that everything behaved as
expected in all the possible combinations I could think of different
org units, categories, entries, etc.

What I'd really like to do is write tests for the OpenSRF methods I
created that simulate as closely as possible the requests made by the
javascript to the OpenSRF backend, so that I can make sure I cover all
the possible use cases, get expected responses, and be able to rerun
the tests whenever any changes are made.

My tests would do all the things normal things tests do:  seed the
database with test data, execute the methods with some mock objects,
and compare the responses to other mock objects, then delete the test
data from the database.

Where would be the best place to put such tests in the source tree?
What would be the preferred way to invoke them?  Are there any
examples in the current source I can use as a model for writing and
executing my own tests?  Ideally, this would become part of a larger
framework of tests that would eventually completely cover the entire
Evergreen source code.

thanks,

-- Scott


More information about the Open-ils-dev mailing list