Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Buckminster » Setup / tear down for JUnit plugin tests
Setup / tear down for JUnit plugin tests [message #499570] Mon, 23 November 2009 11:34
Michal Ruzicka is currently offline Michal RuzickaFriend
Messages: 23
Registered: July 2009
Junior Member
Hi,
I'm having problems with running JUnit plug-in tests which happen to
need GUI in a headless environment with Buckminster's junit command.

The problem is that there is no X server running at the time when the
framework supposed to execute the tests is launched. This naturally
results in an early exit of the framework before any tests are executed.

I was able to solve the problem for plain (non plug-in) JUnit tests by
starting / stopping Xvfb (a virtual framebuffer X server which runs
entirely in background without any need for real display or input
devices) in @BeforeClass / @AfterClass annotated methods.
This solution unfortunately does not work for the JUnit plug-in tests as
the framework (and GUI) is attempted to be started earlier than the
@BeforeClass / @AfterClass methods from any test class are called.

A working solution would be to add some kind of setup / tear down
functionality to the Buckminster's junit command. I'm willing to
implement it but I'd like to discuss possible options first. So here are
some question for you to comment on:

1) Should the implementation just allow to specify a command to execute
prior to launching the tests, or should it rather require a java class
implementing the setup / tear down functionality.

2) If the class is required, should it implement an interface devised
for the setup / tear down purpose, or should it rather use annotations
(perhaps the JUnit 4 @BeforeClass / @AfterClass annotations)?

3) If the class is required, then specifying it means specifying the
class itself plus the classpath where the class is found. A classpath is
much easier specified in an ant script that on a command line which
leads me to the question: Shouldn't there be a <bukminster.junit> ant
task companion to the Buckminster's junit command?

4) In case the ant task was implemented, should the junit command be
extended to support the setup / tear down at all given that using it
(specifying the classpath) would be a hassle anyway?

Thanks in advance for your comments,
regards,
Michal
Previous Topic:Problem importing product with headless Buckminster 3.5
Next Topic:[headless junit] cannot find xml test results file
Goto Forum:
  


Current Time: Sat Apr 27 03:53:00 GMT 2024

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

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

Back to the top