-
Notifications
You must be signed in to change notification settings - Fork 1
/
design.html
222 lines (119 loc) · 6.24 KB
/
design.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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Smokestack - </title>
<style type="text/css" media="all">
@import url("./css/maven-base.css");
@import url("./css/maven-theme.css");
@import url("./css/site.css");
</style>
<link rel="stylesheet" href="./css/print.css" type="text/css" media="print" />
</head>
<body class="composite">
<div id="banner">
<a href="" id="bannerLeft">
Smokestack
</a>
<div class="clear">
<hr/>
</div>
</div>
<div id="breadcrumbs">
<div class="xleft">
Last Published: 2010-03-20
</div>
<div class="xright"> <a href="http://smokestack.github.com/" class="externalLink">Home</a>
</div>
<div class="clear">
<hr/>
</div>
</div>
<div id="leftColumn">
<div id="navcolumn">
<h5>Documentation</h5>
<ul>
<li class="none">
<a href="index.html">Home</a>
</li>
<li class="none">
<strong>Design</strong>
</li>
<li class="none">
<a href="usage.html">Usage</a>
</li>
<li class="none">
<a href="faq.html">FAQ</a>
</li>
<li class="none">
<a href="extensionguidelines.html">Extensions Guidelines</a>
</li>
</ul>
<h5>Modules</h5>
<ul>
<li class="none">
<a href="smokestack-common/index.html">Smokestack Common</a>
</li>
<li class="none">
<a href="smokestack-jndi-1.2/index.html">Smokestack JNDI 1.2</a>
</li>
<li class="none">
<a href="smokestack-jpa-1.0/index.html">Smokestack JPA 1.0</a>
</li>
<li class="none">
<a href="smokestack-jms-1.1/index.html">Smokestack JMS 1.1</a>
</li>
<li class="none">
<a href="smokestack-jca-1.5/index.html">Smokestack JCA 1.5</a>
</li>
<li class="none">
<a href="smokestack-ejb-3.0/index.html">Smokestack EJB 3.0</a>
</li>
<li class="none">
<a href="smokestack-jdbc-3.0/index.html">Smokestack JDBC 3.0</a>
</li>
</ul>
<h5>Project Documentation</h5>
<ul>
<li class="collapsed">
<a href="project-info.html">Project Information</a>
</li>
<li class="collapsed">
<a href="project-reports.html">Project Reports</a>
</li>
</ul>
<a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
<img alt="Built by Maven" src="./images/logos/maven-feather.png"></img>
</a>
</div>
</div>
<div id="bodyColumn">
<div id="contentBox">
<div class="source"><pre>Design Principles</pre>
</div>
<p>Smokestack follows design principles as described below:</p>
<ul><li>Modular approach (allowing to mix-and-match versions and also mock and real implementations)</li>
<li>Independent of unit testing framework (although it uses <a class="externalLink" href="http://junit.org/">JUnit</a> for test code)</li>
<li>Independent of mocking framework (although it uses <a class="externalLink" href="http://code.google.com/p/jmockit/">JMockit</a> for test code)</li>
<li>It is clearly indicated, when functionality is incomplete (patches are welcome)</li>
<li>It is clearly indicated, when mock definition is required</li>
<li><a class="externalLink" href="http://code.google.com/p/hamcrest/">Hamcrest</a> is used for validation offering extra detail on various problems</li>
<li>Mock definition is required on the "physical access edges" and the framework does not pretend to own shared resources, like databases and various other stores. What this means in practice for example for JPA, is that even if <a class="externalLink" href="http://java.sun.com/javaee/5/docs/api/javax/persistence/EntityManager.html#persist%28java.lang.Object%29">persist()</a> was just called for an entity, the <a class="externalLink" href="http://java.sun.com/javaee/5/docs/api/javax/persistence/EntityManager.html#find%28java.lang.Class,%20java.lang.Object%29">find()</a> will only return this same object, if it is so coded in the test. While this might sound counter intuitive at first, this approach offers various benefits, like moving the control of multi-client, multi-threading testing back into the test code, a clean way to exercise exception processing in the tested code.</li>
<li>The framework introduces user and system initiated states (e.g. differentiating between COMMIT and AUTOCOMMIT) allowing for fine granularity assertions of state changes.</li>
</ul>
</div>
</div>
<div class="clear">
<hr/>
</div>
<div id="footer">
<div class="xright">©
2009-2010
Smokestack
</div>
<div class="clear">
<hr/>
</div>
</div>
</body>
</html>