Cobertura (Coverage Tool): How to display the form

  • Thread starter zak100
  • Start date
  • Tags
    Form
In summary, the conversation discusses the use of cobertura for coverage and the steps taken to install and run it on an Ubuntu system. The conversation also mentions issues with running the EC-Cobertura.jar file and provides solutions for executing it. The purpose of EC-Cobertura.jar is to create a parameter for passing arguments to cobertura.
  • #1
zak100
462
11
TL;DR Summary
I am trying to run cobertura. I found a website which displays a for but I can't display it. I want to know how to display the form,
Hi,
I want to use cobertura for coverage. I followed the following link:
https://electric-cloud.com/plugins/directory/p/cobertura/
That link provides a EC-Cobertura.jar file through download. I think it creates a parameter for passing arguments to cobertura. I am trying to run EC-Cobertura.jar but its giving me error:

~/cobertura$ ls -l EC-Cobertura.jar

-rw-rw-r-- 1 zulfi zulfi 165174 Mar 8 17:53 EC-Cobertura.jar

:~/cobertura$ java -jar EC-Cobertura.jar

no main manifest attribute, in EC-Cobertura.jar

:~/cobertura$ sudo apt-get install binfmt-support

[sudo] password for zulfi:

Reading package lists... Done

Building dependency tree

Reading state information... Done

binfmt-support is already the newest version (2.1.8-2).

binfmt-support set to manually installed.

0 upgraded, 0 newly installed, 0 to remove and 258 not upgraded.

:~/cobertura$ ./EC-Cobertura.jar

bash: ./EC-Cobertura.jar: Permission denied

:~/cobertura$ chmod a+rx EC-Cobertura.jar

zulfi@lc2530hz:~/cobertura$ ./EC-Cobertura.jar

no main manifest attribute, in /home/zulfi/cobertura/EC-Cobertura.jar

:~/cobertura$
I have already downloaded the cobertura and its installed on my ubuntu 18.04.
:~$ whereis cobertura-instrument

cobertura-instrument: /usr/bin/cobertura-instrument /usr/share/man/man1/cobertura-instrument.1.gz

:~$
And it has the same version as the tar file provides whose link is :
https://sourceforge.net/projects/cobertura/
provided in the link of the associated help button page:
:~$ cobertura-instrument -version

Cobertura 2.1.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file

[INFO] Cobertura: Saved information on 0 classes.

[INFO] Cobertura: Saved information on 0 classes.

:~$
But the help file does not say anything about the jar file. I still don't know how to execute the jar file and how to display the form shown on the link:
http://downloads.electric-cloud.com/plugins/EC-Cobertura/EC-Cobertura_help.xhtmlSomebody please guide me how to display the form? What is the purpose of EC-Cobertura.jar in this connection.
Zulfi.
 
Technology news on Phys.org
  • #2
When there's no manifest then you have to run a java app via the java command.

$ java -cp <your_jar_file_path> xxx.yyy.zzz.<The_App_Name>

or

$ java -jar <your_jar_file_path> xxx.yyy.zzz.<The_App_Name>

The -cp adds the app's jar to the classpath that java searches. The xxx.yyy.zzz.<The_App_Name> is the class containing the app's main method. The java command will search for the xxx.yyy.zzz.<The_App_Name> in all jars in the classpath which then causes other classes to be loaded.

https://stackoverflow.com/questions/15626369/how-to-run-java-jar-without-manifest-mf

The reference below has other ways of building and/or running the jar file:

https://exceptionshub.com/cant-execute-jar-file-no-main-manifest-attribute.html
 
  • Like
Likes sysprog

1. How do I display the form in Cobertura?

To display the form in Cobertura, you will need to first install the software and set up your project. Once this is done, navigate to the project's coverage folder and look for the "index.html" file. This file contains the form and can be opened in a web browser to display it.

2. Can I customize the form in Cobertura?

Yes, you can customize the form in Cobertura to fit your specific needs. This can be done by editing the source code of the "index.html" file or by using CSS to style the form. Keep in mind that certain changes may affect the functionality of the form.

3. How do I interpret the results displayed in the form?

The form in Cobertura displays the code coverage results for your project. This includes the number of lines covered, the percentage of coverage, and the areas of code that have not been covered. These results can help you identify areas of your code that may need further testing.

4. Can I export the results from the form in Cobertura?

Yes, you can export the results from the form in Cobertura for further analysis. The form allows you to save the results as an XML or HTML file, which can be opened in other programs or shared with team members.

5. Is Cobertura the only coverage tool available?

No, there are other coverage tools available in the market. Some popular options include JaCoCo, Clover, and Istanbul. It's important to research and compare different tools to find the one that best fits your project's needs and budget.

Back
Top