Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » How to run simple unit tests?
How to run simple unit tests? [message #64918] Mon, 15 June 2009 23:37 Go to next message
Eric Jain is currently offline Eric JainFriend
Messages: 266
Registered: July 2009
Senior Member
What's the simplest way to have some pure (i.e no dependencies on Eclipse
anything) unit tests run as part of a PDE build?

I've read
http://www.eclipse.org/articles/article.php?file=Article-PDE JUnitAntAutomation/index.html
(and the referenced articles), and seriously hope there is a simpler (and
faster) approach...
Re: How to run simple unit tests? [message #64941 is a reply to message #64918] Tue, 16 June 2009 00:08 Go to previous messageGo to next message
Ben Vitale is currently offline Ben VitaleFriend
Messages: 247
Registered: July 2009
Senior Member
You don't really need PDE build for this. Just write an Ant script that
uses the <junit> task. If you don't have a top-level script to drive
both then I guess you could drive it from the PDE scripts..

-Ben

Eric Jain wrote:
> What's the simplest way to have some pure (i.e no dependencies on
> Eclipse anything) unit tests run as part of a PDE build?
>
> I've read
> http://www.eclipse.org/articles/article.php?file=Article-PDE JUnitAntAutomation/index.html
> (and the referenced articles), and seriously hope there is a simpler
> (and faster) approach...
>
>
Re: How to run simple unit tests? [message #64955 is a reply to message #64941] Tue, 16 June 2009 01:19 Go to previous messageGo to next message
Eric Jain is currently offline Eric JainFriend
Messages: 266
Registered: July 2009
Senior Member
Ben Vitale wrote:
> You don't really need PDE build for this. Just write an Ant script that
> uses the <junit> task. If you don't have a top-level script to drive
> both then I guess you could drive it from the PDE scripts..

That's the question: How do I hook a junit ant task (per-bundle) into the
PDE build script? Ideally, I'd want to keep the unit tests in separate
bundles (or fragments), but that may complicate things further...
Re: How to run simple unit tests? [message #65057 is a reply to message #64955] Thu, 18 June 2009 00:52 Go to previous messageGo to next message
Ben Vitale is currently offline Ben VitaleFriend
Messages: 247
Registered: July 2009
Senior Member
Eric Jain wrote:
>
> That's the question: How do I hook a junit ant task (per-bundle) into
> the PDE build script? Ideally, I'd want to keep the unit tests in
> separate bundles (or fragments), but that may complicate things further...
>
>

I'm not terribly familir with PDE build itself but I can tell you about
our setup and maybe that will help. We're not using PDE build as our
master script, which sort of sounds like what you want to do?

We are using CruiseControl to drive the whole process. It does the
following:

1. Runs a product build via PDE build for the main product
2. Runs a feature build via PDE build for a feature that holds our test
fragments
3. Runs a follow-on Ant script to execute the tests in the fragments.

We are doing the same thing you suggested; one test fragment per plug-in.

The follow-on script simply copies the compiled plugins and test
fragments into a common location, puts them all in a classpath, then
runs JUnit, calling out a top-level test suite for each plug-in.

HTH
Ben
Re: How to run simple unit tests? [message #65184 is a reply to message #65057] Mon, 22 June 2009 18:02 Go to previous message
Eric Jain is currently offline Eric JainFriend
Messages: 266
Registered: July 2009
Senior Member
Ben Vitale wrote:
> The follow-on script simply copies the compiled plugins and test
> fragments into a common location, puts them all in a classpath, then
> runs JUnit, calling out a top-level test suite for each plug-in.

Thanks; guess we'll have to set up something similar. Not a big deal
(though I try to minimize the amount of infrastructure we need to set up
and maintain)...
Re: How to run simple unit tests? [message #598343 is a reply to message #64918] Tue, 16 June 2009 00:08 Go to previous message
Ben Vitale is currently offline Ben VitaleFriend
Messages: 247
Registered: July 2009
Senior Member
You don't really need PDE build for this. Just write an Ant script that
uses the <junit> task. If you don't have a top-level script to drive
both then I guess you could drive it from the PDE scripts..

-Ben

Eric Jain wrote:
> What's the simplest way to have some pure (i.e no dependencies on
> Eclipse anything) unit tests run as part of a PDE build?
>
> I've read
> http://www.eclipse.org/articles/article.php?file=Article-PDE JUnitAntAutomation/index.html
> (and the referenced articles), and seriously hope there is a simpler
> (and faster) approach...
>
>
Re: How to run simple unit tests? [message #598349 is a reply to message #64941] Tue, 16 June 2009 01:19 Go to previous message
Eric Jain is currently offline Eric JainFriend
Messages: 266
Registered: July 2009
Senior Member
Ben Vitale wrote:
> You don't really need PDE build for this. Just write an Ant script that
> uses the <junit> task. If you don't have a top-level script to drive
> both then I guess you could drive it from the PDE scripts..

That's the question: How do I hook a junit ant task (per-bundle) into the
PDE build script? Ideally, I'd want to keep the unit tests in separate
bundles (or fragments), but that may complicate things further...
Re: How to run simple unit tests? [message #598394 is a reply to message #64955] Thu, 18 June 2009 00:52 Go to previous message
Ben Vitale is currently offline Ben VitaleFriend
Messages: 247
Registered: July 2009
Senior Member
Eric Jain wrote:
>
> That's the question: How do I hook a junit ant task (per-bundle) into
> the PDE build script? Ideally, I'd want to keep the unit tests in
> separate bundles (or fragments), but that may complicate things further...
>
>

I'm not terribly familir with PDE build itself but I can tell you about
our setup and maybe that will help. We're not using PDE build as our
master script, which sort of sounds like what you want to do?

We are using CruiseControl to drive the whole process. It does the
following:

1. Runs a product build via PDE build for the main product
2. Runs a feature build via PDE build for a feature that holds our test
fragments
3. Runs a follow-on Ant script to execute the tests in the fragments.

We are doing the same thing you suggested; one test fragment per plug-in.

The follow-on script simply copies the compiled plugins and test
fragments into a common location, puts them all in a classpath, then
runs JUnit, calling out a top-level test suite for each plug-in.

HTH
Ben
Re: How to run simple unit tests? [message #598439 is a reply to message #65057] Mon, 22 June 2009 18:02 Go to previous message
Eric Jain is currently offline Eric JainFriend
Messages: 266
Registered: July 2009
Senior Member
Ben Vitale wrote:
> The follow-on script simply copies the compiled plugins and test
> fragments into a common location, puts them all in a classpath, then
> runs JUnit, calling out a top-level test suite for each plug-in.

Thanks; guess we'll have to set up something similar. Not a big deal
(though I try to minimize the amount of infrastructure we need to set up
and maintain)...
Previous Topic:Filtering a fragment on criteria other than Eclipse-PlatformFilter settings
Next Topic:PDE Build errors on xerces jar
Goto Forum:
  


Current Time: Thu Apr 18 09:29:38 GMT 2024

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

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

Back to the top