Reputation: 1167
I am integrating DBUnit for unit testing my application, then I came across the issue of the H2 in-memory DB not supporting PLSQL functions to be specified in the SQL script.
So, can anyhone suggest an in-memory database (alternative to H2) that I could integrate with DBUnit and could execute Oracle PL/SQL functions ?
Upvotes: 2
Views: 1171
Reputation: 43
I know this post is 7 years old, but if you're anything like me and stumbled upon this issue now, you could try Testcontainers. It's a way to create Docker containers for your tests ad-hoc. They have support for OracleFree and OracleXE modules as well.
One way to sidestep [cloud development] challenges is by relying on in-memory databases, embedded services, mocks, and other fake replicas of the production dependencies. However, these approaches bring their own problems (e.g. In-memory services may not have all the features of your production service and behave slightly differently).
It's pretty straight forward, and you will have an Oracle DB that has all the features of a productive system.
var oracle = new OracleContainer(DockerImageName.parse("gvenzl/oracle-xe:21-slim-faststart"));
oracle.start();
Reference: https://testcontainers.com
Upvotes: 1
Reputation: 1167
As mentioned by the second commment, nothing besides Oracle DB will do what Oracle does, in terms of PL/SQL procedures, functions and other features.
So, to use DBUnit, the solution would be a physical Oracle DB that will act just like the H2 in-memory DB. This makes life simple, and works very well.
Upvotes: 1