[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools] Re: ResourcesPlugin.getWorkspace() == null ?

I would recommend using the eclipse support for writing junit tests against plugins. Take a look at the project org.eclipse.pde.junit in CVS for more info. With this framework, your tests are run from within an Eclipse application, so all plugins, including core.resources, can be used without special initialization.
-



Alexander Nyßen wrote:

Another question:

is it possible to set up the resources plugin without starting the platform,
so that it does not return null in this method?
The reason I am asking this is that i develop a plug-in under a
plugin-project and i want to write junit-tests to test my plugin, without
starting it (doing unit-testing). But some of my classes also use
ResourcesPlugin.getWorkspace() which is null. If I could init it by hand, I
could do this in the setUp-Method of the JUnit testcase and everything would
be alright.
Any solution??

Alex

"DJ Houghton" <dj_houghton@xxxxxxx> schrieb im Newsbeitrag
news:abe2v2$ci$1@xxxxxxxxxxxxxxxx

How are you running your code? Has the platform been started up correctly

or

are you just referencing org.eclipse.core.resources from your code without
the platform being started?

"Chris" <binder@xxxxxxxxxxxxxxx> wrote in message
news:3cda55ae.15980679@xxxxxxxxxxxxxxxxxxx

Hello everybody,

how can ResourcesPlugin.getWorkspace() to be null?

This happens when I use an ImportOperation.

Thanks,

Chris