Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

ppi-ag/junit-doc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

junit-doc

A small helper-classes to add easily junit-documenation, inspired by the work of Mario Gleichmann.

If you want to use it add the following dependency to your pom.

<dependency>
    <groupId>de.ppi.oss</groupId>
    <artifactId>junit-doc</artifactId>
    <version>0.2</version>
</dependency>

The idea is that you use methods instead of comments. So normally you would write

//ARRANGE create an an empty stack
Stack<Integer> stack = new Stack<Integer>();
//ACT pushing an element onto the stack
stack.push(Integer.valueOf(42));
//ASSUME the stack shouldn't be empty anymore
assertFalse(stack.isEmpty());

now you wrote

ARRANGE("an empty stack");
Stack<Integer> stack = new Stack<Integer>();
ACT("pushing an element onto the stack");
stack.push(Integer.valueOf(42));
ASSUME("the stack shouldn't be empty anymore");
assertFalse(stack.isEmpty());

and can get a simple console report

ARRANGE - an empty set
ACT - adding an element to the set
ASSUME - the set should'nt be empty anymore
 => Test successful

You can easily write more sophisticated reporter. Feel free to send pull-request of your implementation.

See /junit-doc/src/test/java/aaa/demo/StackTest.java for an example.

About

Small library to make junit-documention easily

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages