How to simulate a DB for testing (Java)?

后端 未结 14 1392
走了就别回头了
走了就别回头了 2020-11-30 19:15

I\'m programming in Java and my applications are making a lot of use of DB. Hence, it is important for me to be able to test my DB usage easily.
What DB tests are all ab

14条回答
  •  春和景丽
    2020-11-30 19:31

    I've used Hypersonic for this purpose. Basically, it's a JAR file (a pure Java in-memory database) that you can run in its own JVM or in your own JVM and while it's running, you have a database. Then you stop it and your database goes away. I've used it -- so far -- as a purely in-memory database. It's very simple to start and stop via Ant when running unit tests.

提交回复
热议问题