Jacoco Code coverage on a java file that is manually tested

47 views
Skip to first unread message

ra...@waterlinedata.com

unread,
Sep 1, 2016, 12:21:44 PM9/1/16
to JaCoCo and EclEmma Users

I have a jar file, and invoke java class with different input values(manually testing it). How can i get the code coverage in this scenario. I have made sure to invoke the java class with -javaagent opts, i do not see the jacoco.exec files getting created. Can any one help me here?

Evgeny Mandrikov

unread,
Sep 2, 2016, 4:21:44 PM9/2/16
to JaCoCo and EclEmma Users, ra...@waterlinedata.com
Check documentation and make sure that you configured/executed everything correctly. Or please provide more details about unsuccessful usage.

ra...@waterlinedata.com

unread,
Sep 2, 2016, 4:44:11 PM9/2/16
to JaCoCo and EclEmma Users, ra...@waterlinedata.com
On Thursday, September 1, 2016 at 9:21:44 AM UTC-7, ra...@waterlinedata.com wrote:
> I have a jar file, and invoke java class with different input values(manually testing it). How can i get the code coverage in this scenario. I have made sure to invoke the java class with -javaagent opts, i do not see the jacoco.exec files getting created. Can any one help me here?

Here is the more detail information of my issue:
thanks for the information,
Here is a sample :
i have a test.jar, i have script (test.sh) that calls the java class
I specified -javaagent opts while calling the java class,

I test this java class by passing differnt parameters, somehting like
./test.sh /user/wld
i do not see jacoco.exec file getting created

Another complication is , the class are executed in hadoop environment, that means,
in test.sh , the command to invoke the java class
hadoop com.test.main {specifed the -javagent opts} -classpath {has list of jar files & my test.jar} $1

can you help me here?
thanks
Rama

Evgeny Mandrikov

unread,
Sep 5, 2016, 6:24:01 AM9/5/16
to JaCoCo and EclEmma Users, ra...@waterlinedata.com
I doubt that this is correct way to specify "javaagent" for Hadoop. Please check Hadoop documentation.
For example https://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-common/ClusterSetup.html mentions "child jvms" and options "mapreduce.map.java.opts", "mapreduce.reduce.java.opts".
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages