I'm having a rather strange issue with DBUnit, which I don't understand that well.
I'm reading through the output window in NetBeans to see what is happening when my application starts up, it seems that DBUnit is inserting my test data into my tables, but further down, the tables are dropped and re-created.
This seems to happen about 3 times over. I've cleared the output window and started up, so not sure why it has cycled 3 times over.
Anyway, from the code below, can anyone please hazzard a guess to where I have gone wrong?
My application starts up OK, I just have no data available, tables are all empty
What I'm trying to achieve is; to have an XML with all my test data, so everytime I start up I have the same clean set of data. Currently everytime I start up I have to manually run SQL insert statements due to derby not retaining data after restarting.
I've set a breakpoint on the setOperations and execute() methods on my bootstrapper, these breakpoints are not being caught which leads me to believe the bootstrapper is not being run on start up
Is there something wrong with my applicationContext that would not enable this feature?
Just defining a bean usually isn't enough to do anything--something needs to know to look for a bean with that name.
I missed the "init-method" attribute; so the question now is what in the code or startup is going to instantiate the bean in order for the init-method to run?
Its strange, if I look at my test data, and change the value of the ID from an integer, to "abc", then when I start up my application it gives a numberFormatException
But it still never halts at any breakpoints I put on my DBUnitBootstrapper.
As far as I'm aware, when application loads up, it goes through application context to initialise all the beans. The DBUnit bean calls the init-method, which links to the execute() method on the bootstrapper, it should then populate the datasource with data from the XML.
Am I missing something obvious?
Thanks
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: DBUnit, why insert test data, only to delete/re-create tables after?