junit-doc

Small helper-classes for junit-documentation follwing the AAA-Pattern.

License

License

Categories

Categories

JUnit Unit Testing
GroupId

GroupId

de.ppi.oss
ArtifactId

ArtifactId

junit-doc
Last Version

Last Version

0.2
Release Date

Release Date

Type

Type

jar
Description

Description

junit-doc
Small helper-classes for junit-documentation follwing the AAA-Pattern.
Project URL

Project URL

https://github.com/ppi-ag/junit-doc
Project Organization

Project Organization

PPI AG
Source Code Management

Source Code Management

https://github.com/ppi-ag/junit-doc

Download junit-doc

How to add to project

<!-- https://jarcasting.com/artifacts/de.ppi.oss/junit-doc/ -->
<dependency>
    <groupId>de.ppi.oss</groupId>
    <artifactId>junit-doc</artifactId>
    <version>0.2</version>
</dependency>
// https://jarcasting.com/artifacts/de.ppi.oss/junit-doc/
implementation 'de.ppi.oss:junit-doc:0.2'
// https://jarcasting.com/artifacts/de.ppi.oss/junit-doc/
implementation ("de.ppi.oss:junit-doc:0.2")
'de.ppi.oss:junit-doc:jar:0.2'
<dependency org="de.ppi.oss" name="junit-doc" rev="0.2">
  <artifact name="junit-doc" type="jar" />
</dependency>
@Grapes(
@Grab(group='de.ppi.oss', module='junit-doc', version='0.2')
)
libraryDependencies += "de.ppi.oss" % "junit-doc" % "0.2"
[de.ppi.oss/junit-doc "0.2"]

Dependencies

provided (1)

Group / Artifact Type Version
junit : junit jar [4.9,)

Project Modules

There are no modules declared in this project.

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.

de.ppi.oss

PPI Informationstechnologie

http://www.ppi.de

Versions

Version
0.2