How testing TimerBoundaryEvent
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2011 08:58 AM
Hi all,
this is my fist post on the forum.
I'm trying to create a junit tests for the process of my application. I'm using spring integration for my application. I have troubles for the processes including a TimerBoundaryEvent: events are not fired.
I suppose this is because the JobExecutor cannot access uncommitted process data on the DB. I usually configure tests not to commit with @TransactionConfiguration(defaultRollback = true) but even if I change the configuration (defaultRollback = false) events are not fired.
Do you have a standard pattern to test processes that use TimerBoundaryEvent? How do you suggest to approach the problem?
Thanks in advance
Massimo
this is my fist post on the forum.
I'm trying to create a junit tests for the process of my application. I'm using spring integration for my application. I have troubles for the processes including a TimerBoundaryEvent: events are not fired.
I suppose this is because the JobExecutor cannot access uncommitted process data on the DB. I usually configure tests not to commit with @TransactionConfiguration(defaultRollback = true) but even if I change the configuration (defaultRollback = false) events are not fired.
Do you have a standard pattern to test processes that use TimerBoundaryEvent? How do you suggest to approach the problem?
Thanks in advance
Massimo
Labels:
- Labels:
-
Archive
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2011 03:20 AM
That's indeed a common problem when using Spring in Unit testing.
Spring starts a transaction for every test method, but this means that the job executor transactions can't see the data of course.
We test it by manually firing our timers using the managementService.executeJob() method.
Jobs (like timers) can be queried using the managementService.createJobQuery() operations.
Spring starts a transaction for every test method, but this means that the job executor transactions can't see the data of course.
We test it by manually firing our timers using the managementService.executeJob() method.
Jobs (like timers) can be queried using the managementService.createJobQuery() operations.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2011 07:21 AM
Ok, I understand. I'll change my tests, manually firing timers.
Thanks a lot,
Massimo
Thanks a lot,
Massimo
