IJob's execute method has a concrete JobExecutionContext parameter (not an interface)

443 views
Skip to first unread message

Andrew

unread,
Jan 18, 2011, 12:57:06 PM1/18/11
to Quartz.NET
Hi,

I wanted to try and get some insight from those that are knowledgeable
as to why the JobExecutionContext parameter in the Execute method of
IJob and IStatefulJob interfaces is of a concrete type.

Given that this is the main entry point for the firing of each job I
am wanting to thoroughly unit test the logic inside each of my Job's
Execute methods. However this is very difficult given that the
parameter cannot be easily mocked-up as is it not an interface.

Does anyone know the reason behind why a concrete type parameter was
chosen for this method and/or what the consequences might be in
changing this parameter to be a new interface type (something like
IJobExecutionContext).

Thank,
- Andrew
Message has been deleted

Ulrich

unread,
Jan 20, 2011, 2:29:07 AM1/20/11
to Quartz.NET
Since most of the JobExecutionContext methods are virtual you should
be able to mock the class just as you would an interface. This might
depend on your mocking framework though. We use Moq and it works
nicely.

Ulrich

Marko Lahma

unread,
Jan 20, 2011, 5:40:30 AM1/20/11
to quar...@googlegroups.com
Current development branch is already based on interfaces, of which
one is IJobExecutionContext.

-Marko

On Thu, Jan 20, 2011 at 9:56 AM, Ulrich <u.si...@gmail.com> wrote:
> Since most of the JobExecutionContext methods/properties are virtual you


> should be able to mock the class just as you would an interface. This might

> depend on the mocking framework you are using though. We use Moq and it
> works fine.
>
> Ulrich
>
> --
> You received this message because you are subscribed to the Google Groups
> "Quartz.NET" group.
> To post to this group, send email to quar...@googlegroups.com.
> To unsubscribe from this group, send email to
> quartznet+...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/quartznet?hl=en.
>

Andrew

unread,
Jan 24, 2011, 12:20:33 PM1/24/11
to Quartz.NET
Thanks Marko & Ulrich for your answers. They were most helpful.

Do you know when this current development branch (which is based on
interfaces) is expected to become the next production version of
Quartz.NET?

- Andrew

Marko Lahma

unread,
Jan 24, 2011, 1:18:26 PM1/24/11
to quar...@googlegroups.com
I think first 2.0 beta could be out next month. 2.0 RTM.. when it's ready :)

-Marko

Reply all
Reply to author
Forward
0 new messages