|
Re: jython test scripts instead of java
|
Posted: Feb 27, 2003 2:19 PM
|
|
> I haven't yet used a unit test framework. My gut feeling > is that it would be much easier to write unit tests using > a scripting language rather than java. Since jython runs > java (actually runs python in a jvm), it is an obvious > choice. Can anyone tell me why this would not be a good > approach? The benefit is that I could crank out tests > much faster with a significantly smaller (and easier to > maintain) test code base. > In my interview with Guido van Rossum, he mentioned that he knows of Java people who use Jython for test-driving their Java apps. The discussion of Jython is about a third the way down this page:
http://www.artima.com/intv/strongweak3.html
My impression was he was talking about trying things out quickly, which is a useful thing. But I think JUnit and SuiteRunner are geared more towards buildings tests that stick around, either unit tests that become part of the build, or conformance test kits that become part of an API standard.
> > I haven't looked at SuiteRunner's api but I'd guess it > would not be too difficult to integrate a jython > interpreter to run jython test scripts. Also, you'd get > the benefit of developing your tests with the aid of a > command line interpreter.
We like Python around here, so we'll think about this. But one thing you certainly can do, as far as I know, with Jython is write Jython code that you compile to Java bytecodes. If I am correct about that, then you can write your Suite s and test methods in Jython, not Java. I haven't tried that, but it would be fun to try.
|
|