I've created a similar super class for all my test cases.
I've come to the same methods (and some more) as you mention.
I'm also writing a blog post about it (in my backlog for a month now .... geez).
Currently, my test class uses some nifty Spring features for automatic rollback after each test etc... Perhaps we can work together on this to create a general solution?
in jbpm4, there is a module test-base. that contains the test classes that users will be able to leverage. they will be packaged in the jbpm.jar.
please have a look at DbTestCase. that one should be the one that users will be using.
it's scheduled for the next release: https://jira.jboss.org/jira/browse/JBPM-1907
Sure... why not.... But Sping is not my cup of tea (never needed it, or never saw when it was really handy, or....). The thing is that I do not want to introduce a dependency on Spring in jBPM 3.
My article also touches on how to posts tests to the forum instead of code snippets, so there were two reasons for writing this. So do you want to post two different articles and refer to a joint effort to create this general solution.
Tom, thanks. I'll try to leverage that as much as possible, change my class and try to backport the jbpm 4 testclass to jbpm 3
I certainly don't want to introduce a dependency on Spring! I want to 'de-Springify' my test class. If a general solution is found, I can still wrap it up in some Spring bean if needed.
I was rather thinking at comparing our solutions and see if we can make something general and more robust out of it. I think your article about 'how to write tests' should come after the explanation of the test case (it'll be a long post otherwise ;-)
Tonight, I'm going to take a look at what Tom has provided and see if it fits what I've implemented.
Ronald: Tomorrow I'll be at Devoxx, I'll try to wrap something up before the weekend and mail you the results.
Devoxx not for me this year.... (again not :-( ) Wrapping up the work in my house so it is finally finished after a couple of months.