On Saturday, June 22, 2019 at 5:32:59 PM UTC+2, T CHANDRA SHEKHAR 15BEC1185 
wrote:
>
> Hey Marc,
> Actually I created this jacocoTests target newly. 
>

Is it that hard to precisely answer Marc question and show

> How do you run your application without JaCoCo? 
 

> Earlier it was cobertura based so we decided to shift from cobertura to 
> Jacoco.
> I am having trouble in getting the code containing @Test annotation to run.
>

In absence of above details, one can only guess how you execute your tests 
and can only suggest you to read documentation - 
https://www.jacoco.org/jacoco/trunk/doc/ant.html
JUnit tests in Ant typically executed using junit task - 
https://ant.apache.org/manual/Tasks/junit.html
And above documentation contains example for JUnit:

<jacoco:coverage>
    <junit fork="true" forkmode="once">
        <test name="org.jacoco.examples.HelloJaCoCoTest"/>
        <classpath>
            <pathelement location="./bin"/>
        </classpath>
    </junit>
</jacoco:coverage>

Or one can also suggest to use Google. There are plenty of examples in 
internet - 
https://itaffinity.wordpress.com/2012/06/05/generating-and-customizing-junit-and-code-coverage-reports-with-ant/

If above doesn't help, then please finally provide more details by 
answering the question of Marc.


Thanks 
> Shekhar
>
> On Fri, 21 Jun, 2019, 9:19 PM Marc Hoffmann, <[email protected]> 
> wrote:
>
>> Hi Shekar,
>>
>> and how did your Ant file look before you added JaCoCo (my question 1)?
>>
>> Regards,
>> -marc
>>
>>
>> On 21. Jun 2019, at 17:40, T CHANDRA SHEKHAR 15BEC1185 <
>> [email protected]> wrote:
>>
>> Hey Marc,
>>
>> I am actually using ant to build the code base and have integrated Jacoco 
>> to check the coverage and generate the report, the problem is the code base 
>> mostly consists of Functional testing codes, which don't use main but are 
>> rather run using Junit annotations (@Test), I am unable to get the JVM to 
>> execute those @Test methods and get the coverage. 
>> I have attached the part of ant build file which includes Jacoco.
>>
>> Thanks
>> Shekhar
>>
>> On Friday, June 21, 2019 at 5:02:09 PM UTC+5:30, Marc R. Hoffmann wrote:
>>>
>>> Hi Shekhar, 
>>>
>>> JaCoCo does not require a main method. Actually it is the JVM which 
>>> requires a main method to execute any Java program. 
>>>
>>> 1) How do you run your application without JaCoCo? 
>>> 2) What did you try to run the application with JaCoCo? 
>>>
>>> It will be helpful if you provide your Ant scripts for both cases. 
>>>
>>> Regards, 
>>> -marc 
>>>
>>>
>>> > On 21. Jun 2019, at 11:22, Shekhar <[email protected]> wrote: 
>>> > 
>>> > Hello, 
>>> > 
>>> > I am trying to find coverage of my automation testing code using 
>>> Jacoco-ant plugin. But the issue is my code base doesn't contain any Main 
>>> method, so when I run the Jacoco code coverage over it, it shows -"No Main 
>>> method found, please declare your main method as ...". 
>>> > Is it possible for Jacoco to provide coverage when there are classes 
>>> without any main method or in any way is it possible to skip the check for 
>>> main method? 
>>> > 
>>> > Thanks 
>>> > Shekhar 
>>> > 
>>> > -- 
>>> > You received this message because you are subscribed to the Google 
>>> Groups "JaCoCo and EclEmma Users" group. 
>>> > To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to [email protected]. 
>>> > To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/jacoco/d88e5002-0a95-4671-bdb2-9b8912892ba0%40googlegroups.com.
>>>  
>>>
>>>
>>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "JaCoCo and EclEmma Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jacoco/53fd68b0-44fe-4c30-98a4-4d8c6fbef62b%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jacoco/53fd68b0-44fe-4c30-98a4-4d8c6fbef62b%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> <Jacoco_part.xml>
>>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "JaCoCo and EclEmma Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jacoco/54A9056A-EED0-42F8-BE5F-42F5DF22F596%40mountainminds.com
>>  
>> <https://groups.google.com/d/msgid/jacoco/54A9056A-EED0-42F8-BE5F-42F5DF22F596%40mountainminds.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/2104d5b8-8ec2-4ee8-af72-7eac07358707%40googlegroups.com.

Reply via email to