Cobertura "unable to locate file" problem - cobertura

Can anyone please help me to understand what is wrong here?
I am using Cobertura 1.9.4.1 for Java Code Coverage.
I want to attache the source file with HTML report, I am generating report using the below command:
cobertura-report.sh --format html --datafile $COBERTURA_HOME/core/emscore.ser --basedir $COBERTURA_HOME/core/src --destination $REPORT_DIR
HTML report generated successfully. Where I click on the file name in HTML report, it is giving the below error:
"Unable to locate com/airvana/serverImpl/ObjectDao.java. Have you specified the source directory?"
However I have the Java source file at:
$COBERTURA_HOME/core/src/com/airvana/serverImpl/ObjectDao.java

using "--srcdir" instead of "--basedir" worked for me

Got the answer from Cobertura's Developer forum. You can also submit your problem to cobertura-devel#lists.sourceforge.net
The final command I used to attache the source with HTML report is the below ().
cobertura-report.sh --format html --datafile $COBERTURA_HOME/core/emscore.ser --destination $REPORT_DIR $COBERTURA_HOME/core/src

Related

llvm-cov and "unknown command line argument: -format=html"

I did a code coverage test using the llvm utility. After that, I needed to do a html cover file. I used the command
llvm-cov show test -instr-profile=default.profdata -format=html > report.html
Then I received the following error:
Unknown command line argument '-format=html'.
How I can solve my problem ?
According to the documentation the syntax is
llvm-cov show [options] -instr-profile PROFILE BIN [-object BIN,…] [[-object BIN]] [SOURCES]
so the option -format=html needs to go before the profile and binary name.
llvm-cov show -format=html -instr-profile default.profdata test > report.html

Outputting the cucumber junit report to specific xml file

In my cucumber.yml file I gave following line of code to generate the junit report. The objective is to generate the junit report in file report.xml , however after the execution it is creating the folder with name report.xml and generating the report in file TEST-Appllication-Feature.xml
Please let us know how we can specify the file name in the Junit report.
p3: <%= standard_opts %> --tags #p3 --profile html_report --profile junit_report
junit_report: --format junit --out=report.xml
Add this in your plugin and you are good to go.
plugin = {"junit:target/cucumber-results.xml"}
This gives you a junit report.

%AddJar for hellospark_2.10-1.0.jar giving Name: java.util.zip.ZipException Message

I am trying to run AddJar in my new notebook in ibm bluemix.
%AddJar https://github.com/ibm-cds-labs/spark.samples/blob/master/dist/helloSpark-assembly-2.1.jar -f
However, I keep receiving this error -
Starting download from https://github.com/ibm-cds-labs/spark.samples/blob/master/dist/helloSpark-assembly-2.1.jar
Finished download of helloSpark-assembly-2.1.jar
Out[8]:
Name: java.util.zip.ZipException
Message: error in opening zip file
StackTrace: java.util.zip.ZipFile.open(Native Method)
java.util.zip.ZipFile.<init>(ZipFile.java:235)
java.util.zip.ZipFile.<init>(ZipFile.java:165)
java.util.zip.ZipFile.<init>(ZipFile.java:179)
I tried all sort of URLs - raw, file etc. as specified in this other link, but no help.
%AddJar for hellospark_2.10-1.0.jar giving Name: java.util.zip.ZipException Message: error in opening zip file
Please advice.
Thanks
Raj
Your URL points to an HTML page with a download button. You must use a URL that points to the actual JAR file instead. I got it by right-clicking on the download button and selecting "Copy Link Address". The URL has /raw/ instead of /blob/ in the path:
%AddJar https://github.com/ibm-cds-labs/spark.samples/raw/master/dist/helloSpark-assembly-2.1.jar -f
That line "worked" for me, in the sense that I got a totally different error messages on the first try: Assertion failed. After restarting the kernel and re-executing the %AddJar, the error was gone. Maybe my service didn't have the download directory yet when I executed the line for the first time.

"Unrecognized option: --format=COBERTURAXML" in trying to convert JSCover report to cobertura xml

I'm trying to convert JSCover to cobertura xml.
Based on what i've read the command is as follows:
java -cp JSCover-all.jar jscover.report.Main --format=COBERTURAXML REPORT-DIR SRC-DIRECTORY
But I get an error
"Error: Could not find or load main class jscover.report.Main"
Even if I set the fully qualified path of there the JSCover-all.jar is located.
So I tried including the JSCover-al.jar into the classpath and run the following command instead:
java -cp jscover.report.Main --format=COBERTURAXML target/local-storage-proxy target/local-storage-proxy/original-src
I no longer get the first error but i'm now getting the following error:
Unrecognized option: --format=COBERTURAXML
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
I hope someone could help me with it. Many thanks!
The first attempt is the correct approach. The error means that JSCover-all.jar is not in the same directory that you are executing the command from. An absolute path to is not needed - a relative one will do.
In the second approach, you have passed 'jscover.report.Main' as the class-path to the JVM and '--format=COBERTURAXML' as parameter to the 'java' command.

Expressionengine cron email syntax error

I am using expression engine 2.4.0 . I have the plugin in a correct directory, but everytimeI put the sample code it give me an error
{exp:cron plugin="cron_email" day="23" minute="59" to="webmaster#mysite.com" subject="Daily Email"}
Hello There!
{/exp:cron}
The following tag has a syntax error:
{exp:cron}
Please correct the syntax in your template.
Am I doing anything wrong.Any help highly appreciated
You need to have both the Cron plugin and the Cron Send Email plugin installed.

Resources