Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use efficient java in memory database to mock Oracle database

Tags:

java

oracle11g

h2

I have a lot of DAO tests which access the database. I tried to mock them using Java in memory database like H2. But the problem is the ddl scripts contain partition statements which does not seem to be supported by H2. I basically want to use the same ddl scripts as in production and do not want to modify them in any manner for my "unit" tests. I also tried HSQL, but found H2 more closely resembles oracle, but even then it doesnt support partition. Is there a workaround for this ?

I did look at the following Create an in-memory database structure from an Oracle instance It talks about using H2 but I have already mentioned its shortcomings. Looking for some alternatives.

like image 306
Thunderhashy Avatar asked Nov 04 '22 04:11

Thunderhashy


1 Answers

If you want meaningful tests, you'll need to run them against an instance of the same database version as you will run in production.

like image 145
kufudo Avatar answered Nov 10 '22 09:11

kufudo