On 04/08/2013 11:40 AM, Martin Malina wrote:
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
org.eclipse.swt.SWTException: Failed to execute runnable
Right now we don't know how to overcome this in automated jenkins
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? :)
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.
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.
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?
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.
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.
Eclipse developer at JBoss, by Red Hat <http://www.jboss.org/tools>
My blog <http://mickaelistria.wordpress.com>
- My Tweets