[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [mylyn-reviews-dev] Junit tests question
|
Thanks Benjamin,
I tried using job families and joining the test
thread and it works OK. The only thing is that I get InterruptedExceptions
once in a while, but it should do for now.
BR,
/Sebastien
Hey,
my preferred approach to handle these cases is the following:
Define a Job Family as a public field on the job, let the job always run
with this family. In your test, you can schedule the job as you're used to and
let the test join on the job family (see IJobManager#join).
But be aware that
this will cause livelocks in case the job reschedules itself.
Benny
On Wed, Nov 9, 2011 at 8:43 AM, Sascha Scholz
<sascha.scholz@xxxxxxxxx>
wrote:
Hi
Sebastien,
I'm far from being an expert in Eclipse, but I'll try to
help you anyway.
From my perspective it looks like you're addressing
the problem on the
wrong layer. If you're testing r4e you have control over
the code. So,
why don't you extend the code to provide hooks that help
testing it?
For example a method that allows you to attach a listener to
the job
you're running. Then the test are probably not only faster but
much
more reliable.
Sascha
On Wed, Nov 9, 2011 at 4:54 AM, Sebastien Dubois
<
sebastien.dubois@xxxxxxxxxxxx>
wrote:
>
> Hi all,
>
> I am currently trying
automate R4E testing to add Junit test cases and I am having a problem that I
am sure is fairly common, yet I cannot find a satisfactory solution to it.
When running Junit plugin tests, at some point I need to wait for
command execution to be done. I use the JobManager.isIdle() to verify
that no Jobs are running so that I can continue a given test case. The
problem is that the UDC (Usage Data Collector) seems to be always be running
as a Job and thus hangs the test. I know I can disable UDC in the
Preferences of the enclosing Eclipse instance, but when the Eclipse test
instance starts, its own preferences have UDC enabled by default. Is
there a way to disable the UDC by default at startup?
>
>
Thx,
> /Sebastien
>
_______________________________________________
> mylyn-reviews-dev
mailing list
>
mylyn-reviews-dev@xxxxxxxxxxx>
https://dev.eclipse.org/mailman/listinfo/mylyn-reviews-dev>
_______________________________________________
mylyn-reviews-dev
mailing list
mylyn-reviews-dev@xxxxxxxxxxxhttps://dev.eclipse.org/mailman/listinfo/mylyn-reviews-dev
--
Benjamin Muskalla
Software Engineer, Tasktop Sync
Committer, Eclipse Mylyn, Eclipse EGit