Usually I use hsqldb for some integration tests and it works fine. But some test need to have a postgresql instance. As our production server run postgresql it is a good idea anyway to run the test against a production database.
Is there a maven plugin or something similar which can easily install and start a postgresql database on a given port and shut it down after all test are run?
Something like mysql-je for mysql?
I don't know of anything. But you probably don't want to start and stop the actual PostgreSQL server; you want to have the server running all the time, and create and destroy databases as needed.
You can create a database in SQL , and also destroy it . If you set up an initial database that is empty, and not used for storing any data, you can have a workflow like:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.