Hello good fellas!
I've created a small console application to see how quartz work and it was easy to create an applicationcontext
object inside the main method to get the cron run. OK now I'm in a real project managed by maven and which is using cron jobs defined in some of the modules. Each of the module has his own spring config file. I had 3 of the modules using quartz so it was setup in each of the spring config file. The web app module is the one who has the dependency of each of the modules.
Now i had few concerns:
should I created the
applicationcontext
as in the console project or it's supposed to be loaded. If yes, where am I supposed to load it.based on research on the Internet I did on line I use
MethodInvokingJobDetailFactoryBean
for easy unit testing. And now that I have to use theCronExpression
class to test thegetNextValidTimeAfter
, I still don't know how to organize it properly
Can anyone give me a hand. I'd really appreciate it. Thanks for reading