Re: [Java-gnome-developer] Re: unit testing (was...)
Brought to you by:
afcowie
From: Jeff M. <ku...@gm...> - 2005-01-10 14:39:38
|
On Sat, 08 Jan 2005 01:10:03 +1100, Andrew Cowie <an...@op...> wrote: > On Fri, 2005-07-01 at 08:50 -0500, Jeff Morgan wrote: > > And now on to the question. During our next development cycle we hope to > > introduce a testing framework for the java-gnome bindings. The question is > > "should this testing framework be based on JUnit or Mauve?". I am interested > > in your experience with both of these tools. > > [cut and paste from #java-gnome] > > Unit testing GUI things is hard. How do you prove that a GUI element > actually popped up? You can fire events, but then it's not actually the > mouse click that causes the event, it's some manual trigger which > doesn't exercise the full code path. Thomas Fitzsimmons wrote some code for the classpath project that provides a wrapper around the XTest library. I am sure this code could be used for java-gnome. I am also convinced that much of the bindings can be tested without even displaying a window. > [I've been grappling with this as I try to figure out how to test the > apps I'm writing. However we approach this, I'd like the solution to be > something VERY usable by people using the j-g bindings to write apps, as > opposed to just the people hacking on the bindings themselves] > > FWIW, my vote would be JUnit since a) eclipse has extensive support for > it b) it's widely used in the Java community. I just wrote a simple JUnit test for the ComboBox class. My goal was to see how easy it would be to write JUnit based tests for Java-GNOME. I have attached the source here. Please take a look and let me know what you think. > Andrew Frederick Cowie > > OPERATIONAL DYNAMICS > Operations Consultants and Infrastructure Engineers > http://www.operationaldynamics.com/ > > Sydney: +61 2 9977 6866 > New York: +1 646 472 5054 > Toronto: +1 416 848 6072 > London: +44 207 1019201 -- Jeffrey Morgan "The highest reward for a man's toil is not what he gets for it, but what he becomes by it" - Jon Ruskin |