Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] surefire dependency on org.eclipse.ui.ide.application

Ingo, thanks. I was able to figure out the problem, but those sites didn't actually help. In fact that first site is about 2 1/2 years old and has some outdated information on it. Vogella's page is actually relevant for Neon, and very thorough. He just forgot to point out one very important detail. Actually, the detail is subtly present in a screenshot, but the tutorial text doesn't point it out, and its nature is such that the reader is all but certain to overlook it.

Chapter 11 of Vogella's page tells you how to set up the target platform definition for your RCP application. It tells you to include the two features: Eclipse RCP SDK and Equinox Target Components. In chapter 13, the tutorial describes how to create an SWTBot project and add it to the Tycho build. It highlights that you need to add a couple of SWTBot plugins to your target platform definition. What it doesn't point out, though, is that you need to convert the Eclipse RCP SDK entry into an Eclipse SDK one! It's there in the screenshot, but again, it's not highlighted as a change that you need to make. Given the similarity between the two feature names, the difference is almost unnoticeable.

Without Eclipse SDK in the target platform definition, org.eclipse.ui.ide.application is not available at runtime when the surefire plugin tries to launch the SWTBot headless application. As I mentioned in my original post, the surefire plugin dynamically specifies o.e.ui.ide.application as a dependency if useUIHarness=true. Note that the Eclipse SDK feature is a superset of the Eclipse RCP SDK one (contains it), so you need only specify the former.

That solves that problem...but then you get tripped up by another omission in the tutorial. You MUST specify your RCP product plugin as a dependency in your SWTBot test plugin, even if the test plugin has no build-time dependency on the product one (which it probably doesn't). The reason is that surefire uses the test plugin's dependency list to determine what bundles to load when it launches the SWTBot headless application. If you don't add that dependency to your test plugin, the SWTBot test launch fails with a confusing message: "applicationXMI parameter not set and no branding plugin defined." Good luck making sense of that.

Anyway, I lost quite a few hairs over this, so I figured I'd share.
John


On Tue, Oct 4, 2016 at 11:33 PM, Ingo Dengler <ingo.dengler@xxxxxxxxx> wrote:
Hello John,

you can follow the instructions in the following article [1] to define the appplication/product to use for the test or define your final RCP application to execute the tests [2].

Regards,
Ingo

[1] https://wiki.eclipse.org/SWTBot/Automate_test_execution
[2] https://wiki.eclipse.org/Tycho/Testing_with_Surefire#p2Installed_on_provisioned_RCP_application

Am 04.10.2016 um 16:47 schrieb John Cortell:
As seen in Tycho Surefire's code (TestMojo.java), if you want to do GUI testing (useUIHarness=true), then Surefire requires org.eclipse.ui.ide.application. But my product is an RCP one and doesn't have that plug-in. Can you not use Surefire to test RCP apps? I've been following Vogella's guidance at http://www.vogella.com/tutorials/EclipseTycho/article.html#exercise-tycho-build-for-swtbot-tests, and that tutorial is based on building an RCP app with Tycho. I've got the product building and even have junit tests running, but I can't get the swtbot part working because of the dependency on o.e.ui.ide. Any hints at what I may be doing wrong?

_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user


Back to the top