-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathusage.html
121 lines (103 loc) · 4.4 KB
/
usage.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1" />
<meta name="Description" content="Behavior driven development (BDD) framework for Java" />
<meta name="Keywords" content="bdd, behaviour driven development, behavior driven development, tdd, test driven design" />
<meta name="Copyright" content="Christina Chun" />
<meta name="Designed By" content="ChristinaChun.com" />
<meta name="Language" content="English" />
<title>JDave</title>
<style type="text/css" title="layout" media="screen"> @import url("gg.css"); </style>
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
<script type="text/javascript">
_uacct = "UA-832056-1";
_udn="none";
_ulink=1;
urchinTracker();
</script>
</head>
<body>
<div id="container">
<div id="header"><div class="headerText">JDave</div>
<div class="center"><b class="menu"><a href="index.html">About</a> |
<a href="examples.html">Examples</a> | <a href="usage.html">Usage</a> |
<a href="documentation.html">Documentation</a> |
<a href="modules.html">Modules</a> |
<a href="screenshots.html">Screenshots</a> |
<a href="resources.html">Resources</a></b></div>
</div>
<div id="content">
<div id="bodytext">
<h1 class="title">Usage</h1>
<div></div>
<h2>Installation</h2>
To use the framework you need following jars in the CLASSPATH.
<ul>
<li><a href="http://maven.laughingpanda.org/maven2/org/jdave/jdave-core/1.1/jdave-core-1.1.jar">jdave-core.jar</a></li>
<li><a href="http://maven.laughingpanda.org/maven2/org/jdave/jdave-junit4/1.1/jdave-junit4-1.1.jar">jdave-junit4.jar</a></li>
<li><a href="http://mirrors.ibiblio.org/pub/mirrors/maven2/junit/junit-dep/4.4/junit-dep-4.4.jar">junit4.jar</a></li>
<li><a href="http://www.jmock.org/dist/jmock-2.4.0-jars.zip">jmock + hamcrest + objenesis jars</a></li>
<li><a href="http://mirrors.ibiblio.org/pub/mirrors/maven2/cglib/cglib-nodep/2.1_3/cglib-nodep-2.1_3.jar">cglib-nodep.jar</a></li>
</ul>
Maven 2 users can get all these dependencies by adding following snippet to pom.xml.
<pre>
<repositories>
<repository>
<id>laughing-panda</id>
<name>Laughing Panda</name>
<url>http://maven.laughingpanda.org/maven2/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.jdave</groupId>
<artifactId>jdave-junit4</artifactId>
<version>1.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.4</version>
<scope>test</scope>
</dependency>
</dependencies>
</pre>
<h2>Creating a specification</h2>
Create specifications. Please see <a href="documentation.html">the documentation</a> for
details. <a href="examples.html">A set of examples</a> illustrate currently available features.
<h2>Creating a runner to launch specifications</h2>
Specifications can be launched using JUnit 4 adapter.
JUnit 4 runners can be used by annotating the specification with @RunWith annotation.
<pre>
@RunWith(JDaveRunner.class)
public class StackSpec extends Specification<Stack<?>> {
}
</pre>
<h2>Example Maven 2 POM</h2>
Copy <a href="pom.xml">pom.xml</a> to a directory named <code>jdave-evaluation</code>.
Create dirs <code>jdave-evaluation/src/main/java</code> and <code>jdave-evaluation/src/test/java</code>.
Then run:
<blockquote>
<code>mvn eclipse:eclipse</code> (or <code>mvn idea:idea</code>, etc.)
</blockquote>
to create Eclipse metafiles and to download required libs. Specifications can be created to
<code>src/test/java</code> directory (name them as *Spec.java) and run as:
<blockquote>
<code>mvn test</code>
</blockquote>
Coverage can be checked for instance with Cobertura.
<blockquote>
<code>mvn clean site</code>
</blockquote>
generates Cobertura report at <code>jdave-evaluation/target/site/cobertura/index.html</code>.
</div>
</div>
</div>
<div class="footer">
<div>Copyright © 2007 JDave developers</div>
<div>Designed By <a href="http://www.christinachun.com" title="Christina Chun - Digital Artist & Web Developer">Christina Chun</a> © 2006 </div>
</div>
</body>
</html>