Update documentation for 6.3.0
[egit/eclipse.git] / org.eclipse.egit.doc / help / EGit / Contributor_Guide / Tests.html
blob3bf0c01889116d6dd819c84924a4ad803e6466d1
1 <?xml version='1.0' encoding='utf-8' ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml">
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
5 <title>EGit Contributor Guide - Tests</title>
6 <link type="text/css" rel="stylesheet" href="../../book.css"/>
7 </head>
8 <body>
9 <table class="navigation" style="width: 100%;" border="0" summary="navigation">
10 <tr>
11 <th style="width: 100%" align="center" colspan="3">Tests</th>
12 </tr>
13 <tr>
14 <td style="width: 20%" align="left">
15 <a href="Documentation.html" title="Documentation">
16 <img alt="Previous" border="0" src="../../images/prev.gif"/>
17 </a>
18 </td>
19 <td style="width: 60%" align="center"></td>
20 <td style="width: 20%" align="right">
21 <a href="Bugs.html" title="Bugs">
22 <img alt="Next" border="0" src="../../images/next.gif"/>
23 </a>
24 </td>
25 </tr>
26 <tr>
27 <td style="width: 20%" align="left" valign="top">Documentation</td>
28 <td style="width: 60%" align="center"></td>
29 <td style="width: 20%" align="right" valign="top">Bugs</td>
30 </tr>
31 </table><hr class="navigation-separator"/>
32 <h1 id="Tests">Tests</h1>
33 <h2 id="JGit_Unit_Tests">JGit Unit Tests</h2>
34 <p>The JGit unit tests are executed during the maven build.
35 To run them from the Eclipse workbench use the launch configurations which are part of the sources of the test bundles'.</p>
36 <h2 id="JGit_HTTP_Tests">JGit HTTP Tests</h2>
37 <p>The JGit HTTP tests in
38 <i>org.eclipse.jgit.http.test</i> rely on the Jetty web container.
39 </p>
40 <p>To run these tests from Eclipse the Jetty feature is needed. Use one of the target platforms as described in
41 <a href="Manual-Developer-Setup.html#Dependencies">dependencies</a>.
42 </p>
43 <h2 id="EGit_Core_Tests">EGit Core Tests</h2>
44 <p>The EGit Core tests are executed during the maven build for the bundle
45 <i>org.eclipse.egit.core.test</i>.
46 </p>
47 <p>To run them from the Eclipse workbench use the launch configuration which is part of the sources of the test bundle
48 <i>org.eclipse.egit.core.test</i>.
49 </p>
50 <h2 id="EGit_UI_Tests">EGit UI Tests</h2>
51 <p>The EGit UI tests are using SWTBot, using the 'SWTBot for Eclipse Testing' feature.</p>
52 <p>You need to install at least "SWTBot for Eclipse Testing" and "SWTBot IDE Feature":</p>
53 <ul>
54 <li>
55 <a href="https://download.eclipse.org/technology/swtbot/snapshots/" target="egit_external">https://download.eclipse.org/technology/swtbot/snapshots/</a>
56 </li>
57 </ul>
58 <p>Starting a UI test from Eclipse:</p>
59 <ul>
60 <li>select the test class or test method</li>
61 <li>click
62 <b>Run As &gt; SWTBot Test</b>
63 </li>
64 </ul>
65 <p>
66 <img border="0" src="images/Start-swtbot-test.png"/>
67 </p>
68 <p>Do not touch the mouse or keyboard when the UI test is running since this may
69 disturb the UI test by e.g. moving the current focus to another window.</p>
70 <h3 id="During_Maven_Build">During Maven Build</h3>
71 <p>The tests are executed in the integration-test phase of the
72 <a href="https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html" target="egit_external">default Maven lifecycle</a>.
73 </p>
74 <p>If you want to skip execution of UI tests (only execute core tests):</p>
75 <pre>mvn -P skip-ui-tests clean install
76 </pre>
77 <p>If you want to skip all tests:</p>
78 <pre>mvn clean install -Dmaven.test.skip=true
79 </pre>
80 <h2 id="Auxilary_testing_tools">Auxilary testing tools</h2>
81 <p>Any code, including testing code, does not always do what you expected it to. The most common failure is probably the failure to actually execute the part of the code you wanted to test. Code coverage tools like
82 <a href="https://www.eclemma.org/" target="egit_external">EclEmma</a> can easily visualize what part of the code is being executed.
83 </p><hr class="navigation-separator"/>
84 <table class="navigation" style="width: 100%;" border="0" summary="navigation">
85 <tr>
86 <td style="width: 20%" align="left">
87 <a href="Documentation.html" title="Documentation">
88 <img alt="Previous" border="0" src="../../images/prev.gif"/>
89 </a>
90 </td>
91 <td style="width: 60%" align="center">
92 <a href="Contributor-Guide.html" title="EGit Contributor Guide">
93 <img alt="EGit Contributor Guide" border="0" src="../../images/home.gif"/>
94 </a>
95 </td>
96 <td style="width: 20%" align="right">
97 <a href="Bugs.html" title="Bugs">
98 <img alt="Next" border="0" src="../../images/next.gif"/>
99 </a>
100 </td>
101 </tr>
102 <tr>
103 <td style="width: 20%" align="left" valign="top">Documentation</td>
104 <td style="width: 60%" align="center"></td>
105 <td style="width: 20%" align="right" valign="top">Bugs</td>
106 </tr>
107 </table>
108 </body>
109 </html>