One of my favorite features in Python (I know it's not really a feature of python) is doc-testing. For me it really augments standard documentation and helps to keep it up to data. Looking for something similar in Java, I've found JDocTest - http://cscott.net/Projects/JDoctest/ - last updated two years ago, and doctestj http://code.google.com/p/doctestj/ which haven't been updated since 2007.
Obviously, Java is not interpreter based like Python, but maybe there's some up to date library that enables doctest like capability in java?
The Python unit testing framework, dubbed 'PyUnit' by convention, is a Python language version of JUnit, by smart cookies Kent Beck and Erich Gamma. JUnit is, in turn, a Java version of Kent's Smalltalk testing framework. Each is the de facto standard unit testing framework for its respective language.
Right click on a blank space in the python code, and there is a menu option to run all the Doctests found in the file, not just the tests for one function.
I know it's long time ago but I just found your post here while searching for something different.
In my company we built a java doctest library because we also like the idea of the python doctests. We're using it in one of our bigger projects to test and generate documentation with it.
You can find it here at Github
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With