0% found this document useful (0 votes)
10 views

CodeCoverageReceiver

sdf

Uploaded by

Hezron
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

CodeCoverageReceiver

sdf

Uploaded by

Hezron
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

Code Coverage Receiver

R24

Information in this document is subject


to change without notice.
No part of this document may be
reproduced or transmitted in any form or
by any means, for any purpose, without
the express written permission of
TEMENOS HEADQUARTERS SA.
© 2022 Temenos Headquarters SA -
all rights reserved.
Code Coverage Receiver
Document History

Revisio
Date Amended Name Description
n
1 June 23rd 2016 T. Aubert Initial version
2 Sept. 12th 2016 T. Aubert Add the xml files description

3 March 22nd 2019 S. Sakthi R19 AMR Review

4 March 25th 2020 S. Sakthi R20 AMR Review

Basheer
5 April 12th 2021 R21 AMR review
Ahamed

6 April 25th 2022 M.Kumar R22 AMR review

7 April 6th 2023 M.Kumar R23 AMR review

H. Sanofar
8 March 6th 2024 R24 AMR Review
Nisha

2 Temenos Application Framework Java – (TAFJ)


Code Coverage Receiver

Copyright

Copyright © Temenos Headquarters SA 2009-2024.


All rights reserved.
This document contains proprietary information that is protected by copyright. No part of this
document may be reproduced, transmitted, or made available directly or indirectly to a third party
without the express written agreement of TEMENOS UK Limited. Receipt of this material directly
TEMENOS UK Limited constitutes its express permission to copy. Permission to use or copy this
document expressly excludes modifying it for any purpose or using it to create a derivative
therefrom.

Errata and Comments


If you have any comments regarding this manual or wish to report any errors in the
documentation, please document them and send them to the address below:
Technology Department
Temenos Headquarters SA
2 Rue de l’Ecole-de-Chimie,
CH - 1205 Geneva,
Switzerland

Tel SB: +41 (0) 22 708 1150


Fax: +41 (0) 22 708 1160

Please include your name, company, address, and telephone and fax numbers, and email
address if applicable. [email protected]

3 Temenos Application Framework Java – (TAFJ)


Code Coverage Receiver

Table of Contents
Document History................................................................................................................... 2
Copyright................................................................................................................................ 3
Errata and Comments............................................................................................................. 3
Introduction............................................................................................................................. 5
Quick start (command line)..................................................................................................... 5
To start the server..................................................................................................................... 5
To stop the server...................................................................................................................... 5
To create an instance................................................................................................................. 5
To start an instance................................................................................................................... 5
To stop an instance.................................................................................................................... 5
To delete an instance................................................................................................................. 5
To have a full status of your server............................................................................................5
To have a status of one single instance.....................................................................................5
To reset an instance................................................................................................................... 6
To create a report...................................................................................................................... 6
Very Quick start (command line)................................................................................................ 6
The code coverage configuration file.........................................................................................7
Using the UI............................................................................................................................... 8
The inconsistencies.................................................................................................................. 10
Remote management by command line..................................................................................10
Start the receiver:................................................................................................................. 11
Shutdown the receiver:......................................................................................................... 11
Return the status of all (or a single) instance:......................................................................11
List all the instances’ names:................................................................................................ 11
Create a new Instance:......................................................................................................... 11
Delete an instance:............................................................................................................... 11
Reset an instance (clear the collected data):........................................................................11
Start an instance:.................................................................................................................. 11
Stop an instance:.................................................................................................................. 11
Generate a report (can take few minutes):...........................................................................11
The report................................................................................................................................ 12
The welcome page................................................................................................................ 13
The inconsistencies view....................................................................................................... 13
The report details.................................................................................................................. 14
XML files............................................................................................................................... 17

4 Temenos Application Framework Java – (TAFJ)


Code Coverage Receiver
Introduction
The Code Coverage Receiver (ccr) is a standalone program which will receive information via
TCP from different running JBC code. This program can generate full html report. It can be
managed via a web interface as well as via command lines. The ccr can be configured to receive
information from different versions on the JBC.

Quick start (command line)


The Code Coverage Receiver (ccr) has only one binary (ccr / ccr.bat). It is located in the
<home_of_ccr>/bin directory. Before anything, make sure that the environment variable
JAVA_HOME pointing to a jre 1.7.x. From this binary, you can do all the necessary.

To start the server


ccr (.bat) start
This will start the server in background.

To stop the server


ccr (.bat) shutdown
Once the server is started, you need to create a new instance (this is effectively what will
receive information from your JBC programs.

To create an instance
ccr (.bat) create <instance_name> <tcp port> [“start”]
example: ccr create Test 12345 start
If you omit the start at the end, the instance is created but not started. You can start / stop and
instance like this:

To start an instance
ccr (.bat) start <instance name)
example: ccr start Test

To stop an instance
ccr (.bat) stop <instance name>
example: ccr stop Test

To delete an instance
ccr (.bat) delete <instance name>
example: ccr delete Test

To have a full status of your server


ccr (.bat) status

To have a status of one single instance


ccr (.bat) status <instance_name>

5 Temenos Application Framework Java – (TAFJ)


Code Coverage Receiver
To reset an instance
ccr (.bat) reset <instance_name>
Resetting an instance means clearing all data received so far (starting fresh).

To create a report
ccr (.bat) make <instance name> [-p <path of precompile>] [-s <path of sources>] [-d <report
destination path>]
The path of precompile is the path containing all the precompile jars. If it is omitted, the Code
Coverage Receiver will obviously know nothing about the subroutines not having been
executed, and the subroutine coverage ratio will always be 100%. However, the line coverage
will be correct.
If the <path of sources> is omitted, the report won't be able to drill down until the sources (not
a big deal for management reporting)
If the <report destination path> is omitted, the report will be created in the default location:
<home_of_ccr>/data/<instance name>/report
Note: Creating a report is time consuming, and it can easily take up to 1-5 minutes depending
on your machine.
Be patient!

Very Quick start (command line)

Here is in few lines how to start from scratch, up to a report.


$ ccr start
$ ccr create myInstance 12345 start

Edit your tafj.properties like this :


temn.tafj.runtime.enable.coverage = true
temn.tafj.runtime.coverage.host = localhost (or the ip address of ccr machine)
temn.tafj.runtime.coverage.port = 12345

Run your program (eg EX). One done,


$ccr make myInstance

Done!

6 Temenos Application Framework Java – (TAFJ)


Code Coverage Receiver

The code coverage configuration file.

At the root of your Code Coverage Receiver, you will find a file “CCReceiver.properties”.
This file contains few information to make the server running:

vm_options=-Xms256M -Xmx2048M -XX:MaxPermSize=256M

http_port = 7470

instances = Test;running
vm_options - is the java VM options used when starting the receiver.
Please consult the internet for more options.

http_port - is the main port for all the Receiver. You can change it without any problem, but
make sure your server is stopped otherwise you won't have any other choice to “kill” it.

Instances - is a coma-separated list if names of instances.

Each instance is supposed to have its corresponding <instance> directory in which you will find
<instance>.property file as well as other resources.
There is no need to configure anything. The default values are all right for a normal activity.

7 Temenos Application Framework Java – (TAFJ)


Code Coverage Receiver

Using the UI

This is possible to manage your receiver via a web interface. For that, open a browser a browse:
http://<ip_of_ccr>:<http_port>/CoverageReceiver

At

that stage, you can only Shutdown the receiver or create a new instance.
Let's click on “New Instance ...”

A very simple wizard will guide you through the instance creation. Small note: press <tab> after
having typed something for activating the navigations buttons.

8 Temenos Application Framework Java – (TAFJ)


Code Coverage Receiver

Once you clicked finished, your main screen will look like this:

If

you read the “Quick start (command line)” chapter, you will recognize all the options on your
screen. No need to comment them again here.

Click on “Start” and … … you are ready to go !

Everything is persisted, so if you shut down the Receiver and restart if afterwards, it will remain
in the exact same status as when you stopped it.

9 Temenos Application Framework Java – (TAFJ)


Code Coverage Receiver

The inconsistencies

As you can see on the previous screenshots, an instance can be either “running” or “stopped”,
but the side-icons are showing three states.

The second state indicates that there are some inconsistencies in the data received (or loaded).
This is the “warning” state!

To understand what it means, you need to understand how it is all working.


At the runtime side (when you run your jBC code), there is a special process which collects the
line executed and send them in regular basis to the Code Coverage Receiver. Alongside with the
line numbers, there are 3 other information sent:
1) The Subroutine name.
2) The total number of lines in this subroutine
3) The $PACKAGE information.

The first one is obvious. The second one is here to be able to generate a report even if you are
not specifying a precompile directory. However, imagine that you run a first time you program,
the Receiver receives a certain total number of lines, then you modify the program and re-run it
without resetting the instance.
In that case, we have an inconsistency. The report will certainly be wrong. Fortunately, we can
see these inconsistencies (see the “report” chapter later in this document).

The situation is the same with the $PACKAGE information. You will see that in the report, the
data are organized by “module” / “component”. If, in the same instance, we receive 2 times the
same routine with a different package, this creates an “inconsistency”.

Remote management by command line

Since this is possible to manage a Code Coverage Receiver remotely with the UI, this is also
possible to do it command line.
All the commands (except start) can have the “host:port” information as a prefix.

Example: to add an instance on a remote machine (running ccr!), you can type:
ccr remote_ip:remote_port create instance_name port
Example:
$ccr 10.41.5.51:7470 create myNewInstance 1212

10 Temenos Application Framework Java – (TAFJ)


Code Coverage Receiver

The only command which cannot have a remote ip address is “start”. This seems obvious.
However, we can do something like this:
$ccr localhost:7480 start
This will start the Code Coverage Receiver on the port 7480.
In other words, for the start command, the host “localhost” is forced.
Here is the full syntaxes of all the available commands
[…] means “optional”
<...> means “any” value
“...” means a “strict” value

Start the receiver:


ccr [“localhost”:<ip>] start

Shutdown the receiver:


ccr [<host>:<ip>] shutdown

Return the status of all (or a single) instance:


ccr [<host>:<ip>] status [<instance name>]

List all the instances’ names:


ccr [<host>:<ip>] instances

Create a new Instance:


ccr [<host>:<ip>] create <instance name> <instance_port> [“start”]

Delete an instance:
ccr [<host>:<ip>] delete <instance name>

Reset an instance (clear the collected data):


ccr [<host>:<ip>] reset <instance name>

Start an instance:
ccr [<host>:<ip>] start <instance name>

Stop an instance:
ccr [<host>:<ip>] stop <instance name>

Generate a report (can take few minutes):


ccr [<host>:<ip>] make <instance name> [-p <precompile dir>] [-s <source dir>] [-d
<destination dir>]

11 Temenos Application Framework Java – (TAFJ)


Code Coverage Receiver

12 Temenos Application Framework Java – (TAFJ)


Code Coverage Receiver

The report

Once the report is generated (either by command line with the “make” option or from the UI,
you will have a “report” directory containing “static” html pages.
This report is completely detached of anything and can be moved to a new machine.
Also, a zip file of the “report” directory is generated at the same time to make a download
easier.
From the UI (Browser) perspective, the links to the report (for immediate consultation) and to
the zip (for download) appears as shown here:

The zip file can be downloaded from command line with the wget program. The url is:
http://<host>:<port>/CoverageReceiver/download/<instance name>/report.zip
eg :
http://localhost:7470/CoverageReceiver/download/myInstance/report.zip
The report url (if generated in default location) is:
http://<host>:<port>/report/<instance name>/report/index.html

13 Temenos Application Framework Java – (TAFJ)


Code Coverage Receiver

The welcome page

The welcome page will give an instant view on the coverage as follows:

Note: For the purpose of the documentation, the report has been based on a full component
build of T24 (running all the unit tests). Then, the report has been generated passing AN OLDER
version of the precompiled jars to force some inconsistencies.
You can see that this report has some inconsistencies. By clicking on the “<click for full list>,
you will see all the inconsistencies. Please read the “inconsistencies” chapter for more details.

The inconsistencies view


Here is a view of the inconsistencies:

14 Temenos Application Framework Java – (TAFJ)


Code Coverage Receiver

The report details


The report is organized by module / component / subroutines.
Here is the different view you will have:
The “full” initial view:

One module view

15 Temenos Application Framework Java – (TAFJ)


Code Coverage Receiver
All the components

You can sort the column by clicking on them:

One component:

16 Temenos Application Framework Java – (TAFJ)


Code Coverage Receiver

One routine:

XML files
In addition to the static html files composing the report, you can find a subdirectory called
“xml”. This directory contains xml files representing the coverage information by module /
component.
Here is an example of the “module” files:

17 Temenos Application Framework Java – (TAFJ)


Code Coverage Receiver
and here an example of the “component” files:

18 Temenos Application Framework Java – (TAFJ)

You might also like