I’m used to developing Java applications, but for a project I do posgresql functions. I would like to write small unittests for these functions.
I’m currently looking for a standard approach. I found pgTap and pgUnitTest, and an article from 2007: http://www.bigsmoke.us/postgresql-unit-testing/
What are you approaches to unit-testing postgresql functions? How do you mock data / separate testdata? How to isolate unit-tests? And which framework or approach is favored (I use jUnit and testNG for java)?
Take a look on pgTAP. It’s powerful framework for postgresql unit-testing.
I prefer to use xUnit tests style, but pgTAP doesn’t limit you and allows to use simple functions to write tests.