Re: Integration test depending of Sling job

2017-12-20 Thread Bertrand Delacretaz
Hi, On Wed, Dec 20, 2017 at 3:16 PM, Johan Ruttens wrote: >... Basically I'm searching for a better way to determine when the job is > finished I don't remember the details off the top of my head but I suppose OSGi events are sent to indicate the job's progress - you can check at /system/con

Re: Integration test depending of Sling job

2017-12-20 Thread Johan Ruttens
Hi Stefan, Thank you for your response. I think the null check on the job is indeed the problem. I added this check, because it seems that when after the job is finished (handled) it also becomes null, and I have no longer the possibility to retrieve the jobState from this object. So in the curr

Re: Integration test depending of Sling job

2017-12-20 Thread Stefan Egli
Hi Johan, Could it be that your jobFinised() method returns true since job == null, which could be the case shortly before/while the job is even being created? Ie it could be a race condition at the start of the job (and by adding a 5sec sleep you give it enough time to start + finish). Cheers, S

Integration test depending of Sling job

2017-12-19 Thread Johan Ruttens
Hi, I'm working on a (Adobe AEM) integration test, where the test methods depend on a job being finished, before the methods can be executed with success. The scenario of the job is a follows: 1. Copy a page to be used as a test resource (using the PageManager.copy method) 2. Trigger a job (using