<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 04/08/2013 11:40 AM, Martin Malina
wrote:<br>
</div>
<blockquote
cite="mid:1D646B09-3A62-46B6-BF22-8901C6BB9F17@redhat.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
Hi Mickael,
<div>Today we started testing JBT 4.1.0.Alpha2 and noticed that
this is quite a big problem for us. Most of our tests fail with
something like this:</div>
<div>
<div><br>
</div>
<div>org.eclipse.swt.SWTException: Failed to execute runnable
(java.lang.NoSuchMethodError:
org.hamcrest.core.IsAnything.any(Ljava/lang/Class;)Lorg/hamcrest/Matcher;)</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>at
org.eclipse.swt.SWT.error(SWT.java:4392)</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>at
org.eclipse.swt.SWT.error(SWT.java:4307)</div>
</div>
</blockquote>
This is <a class="moz-txt-link-freetext" href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=404346">https://bugs.eclipse.org/bugs/show_bug.cgi?id=404346</a><br>
<br>
<blockquote
cite="mid:1D646B09-3A62-46B6-BF22-8901C6BB9F17@redhat.com"
type="cite">
<div>Right now we don't know how to overcome this in automated
jenkins test runs - swtbot always takes the newest version of
hamcrest from the kepler platform, so even adding older hamcrest
repo wouldn't help here. Do you have any suggestion for us? :)</div>
</blockquote>
That's because Kepler M6 ships Junit 4.10 which depends on Hamcrest
1.3. SWTBot builds against Hamcrest 1.1 and Hamcrest has API breaks
between 1.1 and 1.3.<br>
The general workaround is to make sure that you test bundle will
resilve to Junit < 4.10 and hamcrest 1.1. This can be achieved by
setting strict version range in your test bundle MANIFEST for
org.junit and org.hamcrest, so Tycho will use the older ones, and
test should work.<br>
<br>
<blockquote
cite="mid:1D646B09-3A62-46B6-BF22-8901C6BB9F17@redhat.com"
type="cite">
<div>Also, what will be the fix in SWTBot? If you fix it to work
with the new hamcrest, it won't work with the older version,
right? So this new swtbot will not be able to work with Juno
with older hamcrest then?</div>
</blockquote>
Cf bug comments.<br>
The fix consist in using different way to instantiate Matchers.
Fortunately, there are still some public constructors that we can
use directly and that are available with hamcrest 1.1 and 1.3.<br>
<br>
I'm totally opposed to break backward-compatibility in SWTBot. Since
you're having trouble because of this bug, I'll try to fix it soon.
Any help is welcome.<br>
<br>
Cheers,<br>
<div class="moz-signature">-- <br>
Mickael Istria<br>
Eclipse developer at <a href="http://www.jboss.org/tools">JBoss,
by Red Hat</a><br>
<a href="http://mickaelistria.wordpress.com">My blog</a> - <a
href="http://twitter.com/mickaelistria">My Tweets</a></div>
</body>
</html>