blob: da7d4e7cdb3c61c38b62617324bf544c6e261658 [file] [log] [blame]
<!DOCTYPE html>
<title>RCPTT Blog</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="">
<link rel="stylesheet" href="">
<link rel="stylesheet" href="">
<link rel="icon" href="">
<link rel="alternate" type="application/atom+xml" href="" title="RCP Testing Tool Blog"/>
<script src=""></script>
<script src=""></script>
<script src=""></script>
<script src=""></script>
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
ga('create', 'UA-39589807-5', '');
ga('send', 'pageview');
<div id="before-footer">
<nav class="navbar navbar-default navbar-static-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<a href=""><span class="navbar-brand">RCPTT Blog</span></a>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li >
<a href="">Latest Entries</a>
<li >
<a href="">Categories</a>
<li >
<a href="">Tags</a>
<a href="">Back to RCPTT Main Site</a>
<a href=""></a>
<section class="content">
<div class="container">
<h2>RCPTT &amp; Code Coverage</h2>
<small>Jun, 17, 2015 by Olga Yurchuk</small> </header>
<p><i>In this blogpost we are going to describe how to configure Eclipse to combine RCPTT UI tests with code coverage analytics tools EclEmma and Jacoco agent. All of that tools are open source and can be downloaded for free.</i></p>
<p>On RCPTT forum users sometimes ask us:</p>
<div class="panel panel-default">
<div class="panel-body">
<i>So I didn't find any hint of Code Coverage in RCP Testing Tool, does that mean there is none?</i>
<p>RCPTT is UI testing tool so it is mostly useful for functional testing. Since it is common practice to combine Functional Testing and Code Coverage analysis, we decided to publish this instruction page. We don't provide this functionality out-of-the-box but it is easy to employ AUT virtual machine arguments to configure an arbitrary covers tool. Find instructions below to configure IDE and add analysis to CI with Maven.</p>
<!-- break -->
<h3>How to get UI and Code Coverage testing from sources with RCPTT IDE&EclEmma in the one Eclipse instance</h3>
<li>Install RCPTT as a plugin from <a href="">Update site (Mars)</a></li>
<li>Install <a href="">EclEmma</a></li>
<li>Download <a href="">JaCoCo agent</a></li>
<li>Extract file to some folder (for me it was /Users/<user-name>/codecoverage/jacoco-0.7.5-20150410.145015-6/lib/jacocoagent.jar)</li>
<li>Import, Build and Run your project</li>
<li>Open Run configuration</li>
<li><i>Add -javaagent:/Users/<user-name>/codecoverage/jacoco-0.7.5-20150410.145015-6/lib/jacocoagent.jar=destfile=/Users/<user-name>/codecoverage/test.exec to VM arguments</i></li>
<p><img src="" /></p>
<li>Add run configuration as Eclipse AUT (It should be done after adding VM argument)</li>
<p><img src="" /></p>
<li>Run Test Suite</li>
<li>After test suite execution had finished go File -> Import -> Coverage Session -> Choose /Users/<user-name>/codecoverage/test.exec -> Select all sources</li>
<li>See coverage details</li>
<p><img src="" /></p>
<h3>How to get UI and Code Coverage testing on Jenkins with RCPTT Runner&EclEmma</h3>
<p>If you use Maven to build your project, you may use RCPTT Runner for functional testing of each build and Jacoco agent to get code coverage analysis.</p>
<p>Do the following steps for that purpose:</p>
<li>Configure RCPTT Maven plugin to execute RCPTT test project as it is described <a href="">here</a></li>
<li>Download Jacoco plugin</li>
<li>Add the following line to your pom.xml</li>
<li>Run the project (start job on Jenkins or just execute <i>mvn clean package -e</i> in the folder with pom.xml)</li>
<li>When AUT is launched, the destination file is created and filled during the test.</li>
<li>After execution, the file can be imported as coverage session to Eclipse/EclEmma to have the results in the known view in Eclipse.</li>
<p>The whole pom.xml with the basic settings will look like:</p>
&lt;name&gt;RCPTT Maven Snapshots repository&lt;/name&gt;
&lt;!-- The main configuration section goes here --&gt;
Now you can play with settings of all of that tools.</p>
<p>Documentation is available here:</p>
<li><a href="">RCPTT docs</a></li>
<li><a href="">Jacoco agent docs</a></li>
<li><a href="">EclEmma user guide</a></li>
<p>If you have any questions about RCPTT please let us know on our forum. </p>
<p class="categories">
<a href="">howtos</a> </p>
<nav class="article">
<li>Previous: <a class="previous" href="" title="Testing About Dialog"><span class="title">Testing About Dialog</span></a></li>
<p><a href="">Discuss</a> this article on forum.</p>
<script src=""></script>