Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Unit tests on a e4 Application.
Unit tests on a e4 Application. [message #1001270] Wed, 16 January 2013 06:08 Go to next message
Alex Kipling is currently offline Alex Kipling
Messages: 250
Registered: July 2012
Senior Member
I would like to test several functions in my e4 Application, by using JUnit tests.

There are many e4 Objects Injected into this method, the injected objects require other e4 objects and so on.

So I need the e4 Application to be started, bevore the test, in order for all that transitive depepndencies to be sattisfied.


Is there a possibility to start the e4 Application, bevore the Test is started?
Re: Unit tests on a e4 Application. [message #1001287 is a reply to message #1001270] Wed, 16 January 2013 06:56 Go to previous messageGo to next message
Dirk Fauth is currently online Dirk Fauth
Messages: 1254
Registered: July 2012
Senior Member
Have a look at SWTBot http://www.eclipse.org/swtbot/
This is definitely what your are looking for.

Unfortunately there are still some issues regarding e4. I think you can find out about those issues at their wiki or documentation somewhere. But they are definitely working on those issues at the moment.
Re: Unit tests on a e4 Application. [message #1001800 is a reply to message #1001270] Thu, 17 January 2013 06:45 Go to previous message
Mickael Istria is currently offline Mickael Istria
Messages: 740
Registered: July 2009
Location: Grenoble, France
Senior Member
On 01/16/2013 12:08 PM, Alex Kipling wrote:
> Is there a possibility to start the e4 Application, bevore the Test is
> started?

You'll probably face a critical issue:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=296599 . This makes almost
impossible to test e4 applications with PDE.
However, there is no problem if you use Tycho. You can set the
application argument of Tycho-surefire-plugin to your e4 application,
and make sure the e4 bundles and your application are in the
classpath/dependencies. Then your test plugin will work well.

HTH
--
Mickael Istria
JBoss, by Red Hat
My blog: http://mickaelistria.wordpress.com
My Tweets: http://twitter.com/mickaelistria
Previous Topic:Getting e4-service from OSGi-service
Next Topic:Putting a PerspectiveStack on a Part
Goto Forum:
  


Current Time: Wed Aug 20 18:32:01 EDT 2014

Powered by FUDForum. Page generated in 0.01989 seconds