-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex.html
66 lines (60 loc) · 2.42 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<title>The JMockit testing toolkit</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="description"
content="Home of the JMockit open source project.
JMockit is a Java toolkit for developer testing, including mocking APIs and a code coverage tool.">
<link rel="stylesheet" type="text/css" href="prettify.css"/>
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico"/>
<script type="text/javascript" src="highlight.pack.js"></script>
<script type="text/javascript">hljs.initHighlightingOnLoad()</script>
</head>
<body>
<h1 class="header">
<a href="http://jmockit.github.io">JMockit</a>
<span>An automated testing toolkit for Java</span>
</h1>
<table class="navBar"><tr>
<th><a href="tutorial.html">Tutorial</a></th>
<th><a href="http://github.com/jmockit/jmockit1">Source</a></th>
<th><a href="http://github.com/jmockit/jmockit1/issues">Issues</a></th>
<th><a href="changes.html">Release notes</a></th>
</tr></table>
<h2>Features</h2>
<ul>
<li>
out-of-container <a href="tutorial/EnterpriseApplications.html">integration testing</a> for Java EE and
Spring-based apps
</li>
<li><a href="tutorial/Mocking.html">mocking</a> API with recording & verification syntax</li>
<li><a href="tutorial/Faking.html">faking</a> API for replacing implementations</li>
<li><a href="tutorial/CodeCoverage.html">code coverage</a> tool</li>
</ul>
<h2>Example</h2>
<pre><code>class ExampleTest {
@Tested ServiceAbc <b>tested</b>;
@Injectable DependencyXyz <b>mockXyz</b>;
@Test
void doOperationAbc(@Mocked AnotherDependency anyInstance) {
new Expectations() {{
anyInstance.doSomething(<b>anyString</b>); <b>result</b> = 123;
AnotherDependency.<em>someStaticMethod</em>(); <b>result</b> = new IOException();
}};
<b>tested</b>.doOperationAbc("some data");
new Verifications() {{ <b>mockXyz</b>.complexOperation(true, <b>anyInt</b>, null); <b>times</b> = 1; }};
}
}
</code></pre>
<h2>Get JMockit</h2>
<p>In a Maven <code>pom.xml</code> file:</p>
<pre><code><dependency>
<groupId>org.jmockit</groupId> <artifactId>jmockit</artifactId> <version>1.xy</version>
<scope>test</scope>
</dependency>
</code></pre>
<p>In a <code>build.gradle</code> file:</p>
<pre><code>testImplementation 'org.jmockit:jmockit:1.xy'</code></pre>
</body>
</html>