Thomas Kellerer wrote:
Paul Taylor, 04.08.2009 15:48:
Thats a shame, I wanted to write junit test for a java program that queried a database, requiring a full database to be available for unit tests is not really an environment I want to have.

Well if you want to test the database, you will need a full database.
It was a simple question, does Postgres have an embedded mode (which is still a full database) but unfortunately it does not.

But you can easily setup and start a Postgres server through a batch file/shell script. I have a small batch file that simply uses the binary ZIP distribution to run initdb and create the initial databases. We are using this to bundle Postgres e.g. with a Tomcat web application. You don't really need to run an installer and/or create registry entries (for windows). This would then resemble more the Derby network server setup.
Yeah, but this is messy and low because you have to wait the database to be fully initilized before running the test. And for unit tests you should be start the database for each test, but wouldnt be possible with your method it would be to slow. Furthermore this is a Windows only solution, there would be additional work to do to setup for Mac or Linux

thanks anyway

Paul




--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to