This content has been marked as final.
Show 3 replies
-
1. Re: Persistence configuration for JUnit tests
jimmy001 Apr 14, 2015 5:36 AM (in response to awizenm)Hi!
Have you considered to use Arquillian for integration testing ?
-
2. Re: Persistence configuration for JUnit tests
awizenm Apr 14, 2015 7:58 AM (in response to jimmy001)Hi Jimmy,
thank you for your suggestion.
For the time being, in the process design and process development phase I'm looking for a lightweight solution for testing only the bpmn2 process. For this purpose a minimal environment consisting of jBPM runtime and a database should be sufficient. I assumed JbpmJUnitBaseTestCase will provide this environment.
There should be a way to set up the in memory database for the tests based on JbpmJUnitBaseTestCase. Isn't it?
In the case of no success with JbpmJUnitBaseTestCase I will move to Arquillian.
Thx
-
3. Re: Persistence configuration for JUnit tests based on JbpmJUnitBaseTestCase
awizenm Apr 15, 2015 7:30 AM (in response to awizenm)OK, what helps in this testing scenario is just the usage of a transaction in the set-up method:
@Override @Before public void setUp() throws Exception{ super.setUp(); BitronixTransactionManager tm = TransactionManagerServices.getTransactionManager(); tm.begin(); EntityManager entityManager = getEmf().createEntityManager(); entityManager.persist(new UserImpl("newUserId")); tm.commit(); }