On 16/01/2013 13:03, Fabio Martelli wrote:
Il giorno 16/gen/2013, alle ore 11.57, Andrei Shakirin ha scritto:
Hi,
I have two questions regarding tasks in context of SYNCOPE-268:
1) Is there easy way to create Notification and Propagation tasks?
Tests issueSyncope81() and deal() delete preconfigured Propagation task (id=1)
and Notification task (id=8).
To make tests re-runnable I need to recreate them, but cannot find easy way to
do it.
Hi Andrei, the easiest way is by DAO.
Actually I cannot see any alternative: no rest method are exposed to explicitly
create Propagation/Notification tasks.
PropagationTask instances are created by the PropagationManager,
NotificationTask instances by the NotificationManager. This takes place
in UserController and RoleController, when users or roles are created /
updated / deleted.
There is absolutely no functional reason to expose REST methods to
create PropagationTask or NotificationTask instances.
The easiest way to create a PropagationTask or a NotificationTask is
then to create an user or a role.
I hope you wouldn't use DAOs into integration test; I don't like it so much.
While I find this wrong too, I can add that this is not even possible
because the integration test classes do not have access to core's
EntityManager.
2) Is it possible to stop sync task without deleting it?
No way as far as I know. Task management is handled by Quartz.
Confirm: tasks are executed as Quartz jobs.
Regards.
--
Francesco Chicchiriccò
ASF Member, Apache Syncope PMC chair, Apache Cocoon PMC Member
http://people.apache.org/~ilgrosso/