Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python-like doctesting in Java? [closed]

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?

like image 693
r0u1i Avatar asked Jun 08 '11 15:06

r0u1i


People also ask

Can JUnit be used for Python?

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.

What is the correct way to run all the Doctests?

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.


1 Answers

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

like image 153
marco Avatar answered Sep 22 '22 23:09

marco