Global Directory
Global Directory
EXPLORE OUR SITES
London Stock Exchange Group
LSEG Data & Analytics
MyAccount
LSEG Perspectives
London Stock Exchange
FTSE Russell
LCH
Contact Us
Home
TR Internal
Testing hibernate-backed Cobalt module with in-memory database
Ryan Morlok
The WebContent module uses Hibernate for it's data persistence and I'd like to setup some tests for our DAOs (data access objects) where they run un-modified in their HQL queries, but use a database context for an in-memory database instead of the Oracle db we use for deployed environments. I'd like to have the schema automatically created each time the tests run (preferably from the hibernate mappings). Are any other modules doing this that I could steal code from/get inspiration?
Find more posts tagged with
web
refinitiv-internal
Accepted answers
Todd Gardner
Try this out:
http://donroby.blogspot.com/2008/01/testing-with-in-memory-database.html
All comments
Todd Gardner
Try this out:
http://donroby.blogspot.com/2008/01/testing-with-in-memory-database.html
Ryan Morlok
Cool. Thanks Todd. I'll give that a try.
Ryan Morlok
That solution worked for me.
There is now an example of this in our code:
$/Cobalt WebContent/Development/WebContent/tests/UnitTests/com/trgr/cobalt/webcontent/test/util/HibernateSessionFactoryHelper.java
An example of a test using the in memory database with hibernate is available here:
$/Cobalt WebContent/Development/WebContent/tests/UnitTests/com/trgr/cobalt/webcontent/dao/impl/
Quick Links
All Forums
Recent Questions
Terms of use
Privacy & Cookie Statement
Cookies settings
Do not sell my info
Whistleblowing
UK Bribery Act
Modern Slavery Act