Usage
Installation
To use the framework you need following jars in the CLASSPATH.
Maven 2 users can get all these dependencies by adding following snippet to pom.xml.
<repositories>
<repository>
<id>laughing-panda</id>
<name>Laughing Panda</name>
<url>http://www.laughingpanda.org/maven2/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.jdave</groupId>
<artifactId>jdave-junit4</artifactId>
<version>1.1-rc1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.4</version>
<scope>test</scope>
</dependency>
</dependencies>
Creating a specification
Create specifications. Please see
the documentation for
details.
A set of examples illustrate currently available features.
Creating a runner to launch specifications
Specifications can be launched using JUnit 4 adapter.
JUnit 4 runners can be used by annotating the specification with @RunWith annotation.
@RunWith(JDaveRunner.class)
public class StackSpec extends Specification<Stack<?>> {
}
Example Maven 2 POM
Copy
pom.xml to a directory named
jdave-evaluation.
Create dirs
jdave-evaluation/src/main/java and
jdave-evaluation/src/test/java.
Then run:
mvn eclipse:eclipse (or mvn idea:idea, etc.)
to create Eclipse metafiles and to download required libs. Specifications can be created to
src/test/java directory (name them as *Spec.java) and run as:
mvn test
Coverage can be checked for instance with Cobertura.
mvn clean site
generates Cobertura report at
jdave-evaluation/target/site/cobertura/index.html.