Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » eclipse.launcher returns NULL when running JUnit plug-in tests
icon5.gif  eclipse.launcher returns NULL when running JUnit plug-in tests [message #985997] Sat, 17 November 2012 03:09 Go to next message
Kivanc Muslu is currently offline Kivanc Muslu
Messages: 153
Registered: November 2010
Senior Member
Hi,

I am writing a plug-in that needs to retrieve the value of environment variable 'eclipse.launcher' set by Eclipse (so that I can create one more Eclipse). This works completely fine while I am testing the plug-in myself and eclipse.launcher is set to the correct value.

I have created a JUnit plug-in test so that I can automate some of the testing I need to do for my plug-in. However, in this plug-in tests, eclipse.launcher is not set (i.e., returns NULL), which completely crushes my remaining execution (and also testing).

Is there a configuration and/or workaround I can use for this?

Thank you, best regards,

[Updated on: Sat, 17 November 2012 03:09]

Report message to a moderator

Re: eclipse.launcher returns NULL when running JUnit plug-in tests [message #986090 is a reply to message #985997] Sun, 18 November 2012 12:57 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan Herrmann
Messages: 999
Registered: July 2009
Senior Member
I assume that JUnit plug-in tests don't use the launcher, which would be why the variable is not set in that context.
Possible workaround: explicitly pass this variable into your test launch?

For more qualified answers regarding JUnit plug-in tests you might want to ask in the PDE forum at http://www.eclipse.org/forums/index.php/f/14/

Re: eclipse.launcher returns NULL when running JUnit plug-in tests [message #986099 is a reply to message #986090] Sun, 18 November 2012 15:23 Go to previous messageGo to next message
Kivanc Muslu is currently offline Kivanc Muslu
Messages: 153
Registered: November 2010
Senior Member
Stephan Herrmann wrote on Sun, 18 November 2012 12:57

Possible workaround: explicitly pass this variable into your test launch?


Hi Stephan, I tried using the environment variables (in run configurations) tab to do this, however it did not work. I also tried to set the environment variable 'eclipse.launcher' using a @BeforeClass method. However, as far as I can see, the product (the second Eclipse with my plug-in running on it), is created and run way earlier than @BeforeClass method is executed. Since my plug-in tries to read 'eclipse.launcher', it still reads null and cannot spawn the headless (third) Eclipse.

Is there any other way that I can pass the variable and make sure that it is set before the second (i.e., testing Eclipse with my plug-in) is created?

Thank you,
Re: eclipse.launcher returns NULL when running JUnit plug-in tests [message #986100 is a reply to message #986099] Sun, 18 November 2012 15:30 Go to previous message
Stephan Herrmann is currently offline Stephan Herrmann
Messages: 999
Registered: July 2009
Senior Member
Launching JUnit plug-in tests is implemented in the PDE component, that's why I suggested that forum for more qualified answered.
Previous Topic:Converting IFile to IDocument
Next Topic:How to run -splash command in Eclipse
Goto Forum:
  


Current Time: Fri Aug 29 06:25:20 EDT 2014

Powered by FUDForum. Page generated in 0.26463 seconds