In your unit test or in the @Before
/ setUp()
method, you can add the following line to launch the HSQL Database Manager:
org.hsqldb.util.DatabaseManager.main(new String[] {
"--url", "jdbc:hsqldb:mem:testdb", "--noexit"
});
or for the improved Swing version with "more refinements" (but about same functionality)
org.hsqldb.util.DatabaseManagerSwing.main(new String[] {
"--url", "jdbc:hsqldb:mem:testdb", "--noexit"
});
The DB manager lets you inspect your schema and run SQL queries on the live in-memory database while the application is running.
Make sure to set a beakpoint or pause the execution one way or another if you want to check the state of your database at a specific line.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…