Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » writing junit tests for Eclipse Plugins
writing junit tests for Eclipse Plugins [message #250885] Wed, 09 June 2004 07:26 Go to next message
Eclipse UserFriend
Originally posted by: sunay.yaldiz.gentleware.com

Hi,

I want to write Junit tests for my Eclipse plugin which is heavily
dependent on JDT core package. Is there a way of testing my code
dependent on Java model of Eclipse without launching the runtime
workbench? What I want is to automatically test, without launching the
runtime workbench for simple actions.

I hope I was clear enough to tell what I need.

Any help is appreciated.
Sunay
Re: writing junit tests for Eclipse Plugins [message #250920 is a reply to message #250885] Wed, 09 June 2004 09:27 Go to previous messageGo to next message
Eclipse UserFriend
Yes, you should use a 'JUnit Plug-in Test' launch configuration, and choose
the headless mode in the Arguments->Program to Run field.

Jerome

"Sunay Yaldiz" <sunay.yaldiz@gentleware.com> wrote in message
news:ca6rkh$v29$1@eclipse.org...
>
> Hi,
>
> I want to write Junit tests for my Eclipse plugin which is heavily
> dependent on JDT core package. Is there a way of testing my code
> dependent on Java model of Eclipse without launching the runtime
> workbench? What I want is to automatically test, without launching the
> runtime workbench for simple actions.
>
> I hope I was clear enough to tell what I need.
>
> Any help is appreciated.
> Sunay
Re: writing junit tests for Eclipse Plugins [message #251191 is a reply to message #250885] Wed, 09 June 2004 16:46 Go to previous messageGo to next message
Eclipse UserFriend
On this same note, I noticed that classes like Platform are concrete
with all static methods. What are the current practices for mocking the
eclipse platform classes?

I don't even want to start any instance of eclipse to run my unit tests.
For function tests, sure, no problem. But for unit tests it should be
really really fast. (For example, our system can run over 5000 unit
tests in about 20 seconds due to our strict usage of mocks in the unit
tests.)
Re: writing junit tests for Eclipse Plugins [message #251260 is a reply to message #251191] Wed, 09 June 2004 19:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.NO.SPAM.us.ibm.com

Well if it requires JDT you will need to run under Eclipse. JDT does not
work outside of Eclipse. It expects all of the eclipse stuff like jobs
and other stuff.


--
Thanks, Rich Kulp

Re: writing junit tests for Eclipse Plugins [message #251418 is a reply to message #251260] Thu, 10 June 2004 09:42 Go to previous messageGo to next message
Eclipse UserFriend
Rich Kulp wrote:
> Well if it requires JDT you will need to run under Eclipse. JDT does not
> work outside of Eclipse. It expects all of the eclipse stuff like jobs
> and other stuff.

Yes, I require things like the JDT but want to mock out the
implementation classes (eg, using EasyMock). Its all the static methods
that at first glance appear to be problematic. But I have not studied it
all closely yet. I was hoping that there was some place in the eclipse
framework where it is easy to insert mocks and that there is already
some standard idioms for doing so.
Re: writing junit tests for Eclipse Plugins [message #251462 is a reply to message #251418] Thu, 10 June 2004 10:41 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.NO.SPAM.us.ibm.com

What I'm afraid is by the time you mocked it all up you will wind up
reinventing Eclipse. Because it isn't just static methods. It is
expecting certain behavior too. So you need to supply that behavior.

You can still bring up Eclipse only once, and do all 5000 of your tests
under the one test suite. You don't need to bring it up and down for
each test.

--
Thanks, Rich Kulp

Previous Topic:Does eclipse have a plugin for editor macro record and playback ?
Next Topic:Open Workspace problem in 3.0M9
Goto Forum:
  


Current Time: Thu May 08 21:28:24 EDT 2025

Powered by FUDForum. Page generated in 0.30938 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top