Using DbUnit with Junit 4 style annotations, testing a H2 in memory database in Oracle compatibility mode.
And just because I like to use buzzwords and whatnot a little JDBI is sprinkled in.
- Extract DDL to create original database
- Extract dataset from origin Oracle database using DbUni
- Using Maven's exec plugin, start h2 database, create the schema using the extracted ddl and fill it with the dataset
Per test run one scenario.
- Check for deleted data manually
- Check for changed data manually
- New data can be checked by using DbUnit's delete functionality, removing all data defined in a dataset from a table, leaving only the newly inserted database
After each test clean the instance dataset, and insert a fresh dataset. Inserting a fresh dataset can be done using DbUnit, or h2 cvsread method.
- Sequences. It doesn't support Oracle's
nomaxvalue
,nocycle
flag. - Constraints. It doesn't support
using index
when adding constraints.
Doesn't cope well with intermixed sql commands and comments
create table attributes (
id number not null, -- attribut id
type varchar2(4) not null, -- type
"comment" varchar2(255) null -- comment
);