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

Code Coverage Receiver

Uploaded by

subashreenata
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views

Code Coverage Receiver

Uploaded by

subashreenata
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Cod e Cover a g e Rec eive r

Doc u m e n t Hist o r y

Revi si o
Dat e Ame n d e d Na m e De s c r i p t i o n
n
1 June 23 rd 2016 T. Aube r t Initial version
2 Sept. 12 th 2016 T. Aube r t Add the xml files desc ri p tio n

3 Marc h 22 nd 2019 S. Sakt hi R19 AMR Review

4 Marc h 25 th 2020 S. Sakt hi R20 AMR Review

Bash e e r
5 April 12 th 2021 R21 AMR review
Aham e d

6 April 25 th 2022 M.Kum a r R22 AMR review

2
Cod e Cover a g e Rec eive r

Copyri g h t

Copyrig h t © Teme n o s Hea d q u a r t e r s SA 2009- 2022.


All right s rese rv e d.
This docu m e n t cont ain s prop rie t a r y inform a tio n that is prote c t e d by copyrig h t. No part of this docu m e n t may
be repro d u c e d , tra ns m i t t e d , or mad e availa ble direc tly or indirec tly to a third party without the expr e s s
writt e n agre e m e n t of TEMENOS UK Limite d. Receipt of this mate ri al direc tly TEMENO S UK Limite d
constit u t e s its expr e s s per mis sion to copy. Per mis sion to use or copy this docu m e n t expr e s sly exclud e s
modifying it for any purpo s e , or using it to cre a t e a derivative the r ef ro m .

Errat a and Com m e n t s


If you have any com m e n t s reg a r di n g this man u al or wish to repor t any error s in the docu m e n t a t i o n ,
plea s e docu m e n t the m and send the m to the add r e s s below:
Technology Depa r t m e n t
Teme no s Hea d q u a r t e r s SA
2 Rue de l’Ecole- de- Chimie,
CH - 1205 Geneva,
Switze rl a n d

Tel SB: +4 1 (0) 22 708 1150


Fax: +4 1 (0) 22 708 1160

Pleas e includ e your na m e , comp a n y, addr e s s, and telep h o n e and fax num b e r s , and email add r e s s if
applica bl e. TAFJdev@t e m e n o s . c o m

3 Teme no s Application Fra m e w o r k Java – (TAFJ)


Cod e Cover a g e Rec eive r
Ta b l e o f C o n t e n t s

Intro d u c ti o n
The Code Cover a g e Receiver (ccr) is a stan d a lo n e prog r a m which will rec eive infor m a t io n s via TCP from
differ e n t runnin g JBC code. This progr a m is able to gene r a t e full html repo r t . It can be man a g e d via a
web inte rf a c e as well as via com m a n d lines. The ccr can be configu r e d to rec eive infor m a t io n s from
differ e n t versions on the JBC.

Quic k start (co m m a n d lin e )


The Code Cover a g e Receiver (ccr) has only one bina ry (ccr / ccr.b a t ). It is locat e d in the
<h o m e_of_cc r > / bi n direct o ry. Before anyt hi n g, make sure you environ m e n t varia bl e JAVA_HOME points
to a jre 1.7.x. From this bina ry, you can do all the nece s s a r y.

To start the serve r


ccr (.bat) star t
This will sta rt the serve r in backg r o u n d .

To stop the serve r


ccr (.bat) shut do w n
Once the serve r is sta r t e d , you nee d to cre at e a new insta n c e (this is effectively wha t will rec eive
infor m a t i o n s from your JBC prog r a m s .

To crea t e an insta n c e
ccr (.bat) cre at e <inst a n c e_ n a m e > <t c p port > [“sta r t ”]
exa m pl e : ccr cre a t e Test 12345 sta r t
If you ommit the sta rt at the end, the inst a n c e is crea t e d but not sta rt e d . You can star t / stop and
inst a n c e like this :

To start an insta n c e
ccr (.bat) star t <inst a n c e nam e)
exa m pl e : ccr star t Test

4
Cod e Cover a g e Rec eive r
To stop an insta n c e
ccr (.bat) stop <ins t a n c e nam e >
exa m pl e : ccr stop Test

To delet e an insta n c e
ccr (.bat) delet e <ins t a n c e nam e >
exa m pl e : ccr delet e Test

To have a full stat u s of your serve r


ccr (.bat) stat u s

To have a stat u s of one single insta n c e


ccr (.bat) stat u s <inst a n c e_ n a m e >

To res e t an inst a n c e
ccr (.bat) rese t <ins t a n c e_ n a m e >
Reset ti n g an insta n c e mea n s cleari n g all dat a rec eive d so far (star ti n g fresh).

To crea t e a repor t
ccr (.bat) make <i ns t a n c e nam e > [-p < p a t h of preco m p il e > ] [-s < p a t h of sourc e s > ] [-d < r e p o r t
destin a ti o n pat h > ]
The pat h of preco m pil e is the pat h cont aini n g all the preco m pil e jars. If it is omitt e d, the Code Cover a g e
Receive r will obviously know nothin g about the subro u ti n e s not having bee n exec ut e d , and the
subr o u t i n e cover a g e ration will always be 100%. Howeve r, the line cover a g e will be corr e c t .
If the <p a t h of sourc e s > is omitt e d, the repo r t won't be able to drill down until the sourc e s (not a big
deal for man a g e m e n t repor ti n g)
If the <r e p o r t destin a t io n pat h > is omitt e d, the repo r t will be crea t e d in the defa ult location :
<h o m e_of_cc r > / d a t a / < i n s t a n c e nam e > / r e p o r t
Note : Crea ti n g a repo r t is time consu mi n g , and it can easily take up to 1- 5 minut e s depe n di n g your
machi n e . Be patie n t !

Very Quic k start (co m m a n d lin e )

Here is in few lines how to sta r t from scra t c h , up to a repor t.


$ ccr star t
$ ccr cre a t e myIn s t a n c e 12 3 4 5 star t

Edit your tafj.pro p e r t i e s like this :


tem n. t afj.r u n ti m e . e n a b l e . c ov e r a g e = true
tem n. t afj.r u n ti m e . c ov e r a g e . h o s t = localhos t (or the ip add r e s s of ccr mac hin e)
tem n. t afj.r u n ti m e . c ov e r a g e . p o r t = 12345

Run your progr a m (eg EX). One done,

$c cr ma k e myIn s t a n c e

5 Teme no s Application Fra m e w o r k Java – (TAFJ)


Cod e Cover a g e Rec eive r
Done !

The cod e cov e r a g e con f i g u r a t i o n file.

At the root of your Code Cover a g e Receive r, you will find a file “CCRec eive r . p r o p e r t i e s”.
This file cont ai n s few inform a t i o n s to make the serve r run nin g :

vm_options = - Xms256 M -Xmx204 8 M -XX:MaxPe r m S iz e = 2 5 6 M

http_po r t = 7470

inst a n c e s = Test;r u n ni n g

vm_op t i o n s is the java VM options used when sta rti n g the rec eive r .
Pleas e consul t the inter n e t for more options.

htt p_p or t is the main port for all the Receive r. You can chan g e it withou t any probl e m , but make sure
your serve r is stopp e d othe r wi s e you won't have any othe r choice to “kill” it.

inst a n c e s is a com a- sepa r a t e d list if nam e s of insta n c e s.

eac h inst a n c e is suppo s e d to have its corre s p o n di n g <i ns t a n c e > direc t o r y in which you will find
<ins t a n c e > . p r o p e r t y file as well as othe r resou r c e s .
There is no need to configu r e anythi n g. The default values are all right for a nor m al activity.

6
Cod e Cover a g e Rec eive r
Usi n g th e UI

This is possibl e to man a g e your receive r via a web interfa c e . For that, open a brows e r a brows e :
http:// < i p_of_cc r > : < h t t p_ p o r t > / C ov e r a g e R e c e i v e r

At that stag e,
you can only
Shut do w n the
rec eive r or
crea t e a new
inst a n c e .
Let's click on “New Inst a n c e ...”

A very simple wizar d will guide you throu g h the insta n c e crea tio n. Small note : press <t a b > after having
typed som e t hi n g for activatin g the naviga tion s but ton s.

7 Teme no s Application Fra m e w o r k Java – (TAFJ)


Cod e Cover a g e Rec eive r

Once you clicked finishe d, your main scre e n will look like this :

If you rea d the


“Quick star t
(com m a n d line)”
cha pt e r , you will
recog niz e all the
options on your
scre e n. No need
to com m e n t
the m agai n
her e.

Click on “Star t ” and … … you are rea dy to go !

Everyt hi n g is persi st e d , so if you shut down the Receive r and rest a r t if after w a r d s , it will rem ai n in the
exact sam e stat u s as when you stopp e d it.

8
Cod e Cover a g e Rec eive r
The inc o n s i s t e n c i e s

As you can see on the previou s scre e n- shot s, an insta n c e can be eithe r “runni n g” or “stop p e d”, but the
side- icons are showin g thr e e stat e s.

The secon d stat e indicat e s that ther e are som e inconsist e n ci e s in the data receive d (or loade d).
This is the “war ni n g” stat e :

To unde r s t a n d wha t it mea n s, you nee d to unde r s t a n d how it is all worki ng.
At the runti m e side (whe n you run your jBC code), ther e is a speci al proc e ss which collects the line
exec ut e d and send the m in regul a r basis to the Code Cover a g e Receive r. Alongsi de with the line
num b e r s , the r e are 3 othe r inform a t i o n s sent :
1) The Subro u ti n e nam e.
2) The total num b e r of lines in this subro u t i n e s
3) The $PACKAGE inform a ti o n.

The first one is obvious. The secon d one is her e to be able to gen e r a t e a repo r t even if you are not
specifying a preco m pil e direct o ry. Howeve r, imagi n e that you run a first time you prog r a m , the Receive r
receive s a cert ai n total num b e r of lines, the n you modify the progr a m and re- run it withou t rese t t i n g the
inst a n c e .
In that case, we have an inconsi st e n c y. The repor t will cert ai nly be wron g. Fort u n a t e ly, we can see thes e
inconsist e n ci e s (see the “repo r t” chap t e r late r in this docu m e n t ).

The situa tio n is the sam e with the $PACKAGE infor m a t io n. You will see that in the repor t , the dat a are
orga niz e d by “module” / “com po n e n t ” . If, in the sam e inst a n c e , we receive 2 time s the sam e routi n e with
a differ e n t packa g e , this crea t e an “incon sis t e n c y”.

Re m o t e ma n a g e m e n t by co m m a n d lin e

Since this is possible to man a g e a Code Cover a g e Receive r rem o t ely with the UI, this is also possible to
do it com m a n d line.
All the com m a n d s (exept star t) can have the “host:po r t ” inform a ti o n as a prefix.

Exam pl e : to add an insta n c e on a rem ot e machi n e (runni n g ccr !), you can type :
ccr rem o t e_ip:r e m o t e_ po r t cre a t e insta n c e_n a m e port
Exam pl e :

9 Teme no s Application Fra m e w o r k Java – (TAFJ)


Cod e Cover a g e Rec eive r
$c cr 10. 4 1 . 5 . 5 1 : 7 4 7 0 cre a t e myN e w I n s t a n c e 12 1 2

The only com m a n d which cannot have a rem ot e ip addr e s s is “sta r t”. This see m s obvious. Howeve r, we
can do som e t hi n g like this :
$c cr loc al h o s t : 7 4 8 0 start
This will sta rt the Code Cover a g e Receive r on the port 7480.
In othe r words, for the star t com m a n d , the host “localhos t ” is force d.
Here is the full syntaxe s of all the availabl e com m a n d s
[…] mea n s “option al”
<... > mea n s “any” value
“...” me a n s a “strict” value
Start the receiver :
ccr [“local ho s t”: < i p > ] sta rt
Shutdown the receiver :
ccr [< hos t > : < i p > ] shut d o w n
Return the status of all (or a single) instance :
ccr [< hos t > : < i p > ] stat u s [<ins t a n c e nam e > ]
List all the instances names :
ccr [< hos t > : < i p > ] inst a n c e s
Create a new Instance :
ccr [< hos t > : < i p > ] cre a t e <inst a n c e nam e > <ins t a n c e_p o r t > [“sta r t ”]
Delete an instance :
ccr [< hos t > : < i p > ] delet e <i nst a n c e nam e >
Reset an instance (clear the collected data) :
ccr [< hos t > : < i p > ] rese t <i nst a n c e nam e >
Start an instance :
ccr [< hos t > : < i p > ] star t <inst a n c e nam e >
Stop an instance :
ccr [< hos t > : < i p > ] stop <i nst a n c e nam e >
Generate a report (can take few minutes) :
ccr [< hos t > : < i p > ] make <ins t a n c e nam e > [-p < p r e c o m p il e dir > ] [-s <so u r c e dir > ] [-d < d e s t i n a t i o n
dir > ]

10
Cod e Cover a g e Rec eive r
The rep or t

Once the repo r t is gene r a t e d (eithe r by com m a n d line with the “make” option or from the UI, you will
have a “repor t” direc t o ry cont ai ni n g “static” html page s.
This repor t is comple t ely deta c h e d of anyt hi n g and can be moved to a new mac hin e.
Also, a zip file of the “repo r t ” direct o ry is gen e r a t e d at the sam e time to make a downlo a d easi e r.
From the UI (Brows e r ) per sp e c t ive, the links to the repor t (for imm e di a t e consult a ti o n) and to the zip (for
downloa d) appe a r s as show n her e :

The zip file can be downloa d e d from com m a n d line with the wget progr a m . The url is
http:// < h o s t > : < p o r t > / C o v e r a g e R e c e i v e r / d o w nl o a d/ < i n s t a n c e nam e > / r e p o r t . zi p
eg :
http://localho s t : 7 4 7 0/ C ov e r a g e R e c e i v e r/ d o w nl o a d/ m yI n s t a n c e / r e p o r t . zi p
The repo r t url (if gene r a t e d in default location) is :
http:// < h o s t > : < p o r t > / r e p o r t / < i n s t a n c e nam e > / r e p o r t / i n d e x. h t m l

11 Teme n o s Application Fra m e w o r k Java – (TAFJ)


Cod e Cover a g e Rec eive r
The welco m e pag e

The welco m e page will give an inst a n t view on the cover a g e as follows :
No t e : For the purpos e of the docu m e n t a ti o n, the report has bee n base d on a full com po n e n t build of T24
(runni n g all the unitT e s t s). The n, the report has bee n gene ra t e d passi ng AN OLDER version of the
preco m p il e d jars to force som e inconsist e n ci e s .
You can see that this repor t has som e inconsist e n c i e s. By clicking on the “<click for full list > , you will
see all the inconsist e n c i e s. Pleas e rea d the “inconsi st e n ci e s ” cha pt e r for more det ails.

The inconsist e n ci e s view


Here is a view of the inconsis t e n c i e s :

12
Cod e Cover a g e Rec eive r
The repo r t details
The repo r t is orga niz e d by modul e / compo n e n t / subro u ti n e s.
Here are the differ e n t view you will have :
The “full” initial view :

13 Teme n o s Application Fra m e w o r k Java – (TAFJ)


Cod e Cover a g e Rec eive r
One modul e view

All the

compo n e n t s

You can sort the


colum n by
clicking on the m :

One compo n e n t :

One routi n e:

14
Cod e Cover a g e Rec eive r

XML files
In addition to the static html files com posi n g the repor t , you can find a subdi r e c t o r y called “xml”. This
direct o ry cont ain s xml files repr e s e n t i n g the cover a g e inform a ti o n by modul e / com po n e n t .
Here is an exam pl e of the “modul e” files :

and her e an
exam pl e of the
“com po n e n t ”
files :

15 Teme n o s Application Fra m e w o r k Java – (TAFJ)

You might also like