2

Has anyone ever tried to test Activiti / BPMN processes using pure CDI? In theory (if I didn't miss anything) I would think it should be possible to use f.ex. cdi-unit for testing processes together with activiti-engine and activiti-cdi. CDI unit internally uses weld-se.

But I couldn't make it work, I think the reason is that Activiti CDI and CDI unit work on different contexts, and I haven't found out how to "join" them (or maybe it's not possible).

Using @Inject on a ProcessEngine in a test annotated with @RunWith(CdiRunner.class) (as in the CDI unit quickstart) didn't "trigger" anything - i.e. Activiti or the ProcessEngine weren't touched.

Jens Piegsa
  • 7,399
  • 5
  • 58
  • 106
cslotty
  • 1,696
  • 20
  • 28
  • Maybe Arquillian using Weld-EE is the better choice. (http://arquillian.org/guides/getting_started/) – cslotty Nov 13 '15 at 14:00

1 Answers1

0

I would suggest you to use Arquillian which is already mature project that will help you to run your tests inside CDI container. There are also plenty of extensions and one of them is camunda which can help you with testing BPMN processes so maybe you should take look at it :)

Petr Mensik
  • 26,874
  • 17
  • 90
  • 115
  • Yes, I've thought about using Arquillian... maybe that's the best choice at the moment. My goal was to stay as lightweight as possible. Isn't Camunda even a fork of Activiti? Are you a contributor? ;-) I'll have a look at it! – cslotty Nov 14 '15 at 13:00
  • Yes, it's a fork so the extension is hopefully compatible with the Activity. However I am not contributor to it (I used to be to the Arquillian directly while ago) so I can't 100% confirm. – Petr Mensik Nov 14 '15 at 13:54