I'm getting incorrect coverage information for a lambda used in a 
TestNG/AssertJ test.  The EclEmma/JaCoCoo version is one I just installed from 
http://download.eclipselab.org/eclemma/trunk/update into Eclipse 4.5 - EclEmma 
2.3.3.201509111100, JaCoCo 0.7.5.201505241946.  TestNG 6.9.6, AssertJ 3.1.0.

Here's the test code:

   package com.bakins_bits;

   import org.testng.annotations.Test;
   import static org.assertj.core.api.Assertions.*;

   @Test(enabled = true)
   public class TestPlaypen
   {
       public void coverage_with_EclEmma_and_lambdas_and_AssertJ_helper() {
           String s = "abcd".toUpperCase();
           assertThat(s).isEqualTo("ABCD");
           throw new RuntimeException("boo!");
       }

       @Test
       public void coverage_with_EclEmma_and_lambdas_and_AssertJ() {
           assertThatThrownBy(() -> {
               coverage_with_EclEmma_and_lambdas_and_AssertJ_helper();
           }).isInstanceOf(RuntimeException.class);
       }
   }

TL;DR: The lambda shows in red and at 0% coverage in the exported HTML report.  
I would expect it to show green and 100% (given that this version of 
EclEmma/JaCoCo supports lambdas).

Details:

The color-coded coverage results in the text editor window show the body of 
coverage_with_EclEmma_and_lambdas_and_AssertJ_helper() in green, also the
assertThatThrownBy line in coverage_with_EclEmma_and_lambdas_and_AssertJ().  
The call of coverage_with_EclEmma_and_lambdas_and_AssertJ_helper() is RED and 
the
isInstanceOf(...) line is yellow.  I would have expected it all to be green.

The report view window is somewhat better:  Drilling down to the two 
coverage_with_EclEmma_and_lambdas_and_AssertJ.* routines shows 100% coverage of 
instructions.  But the parent TestPlaypen shows only 88.5% coverage with some 
missed instructions.

Finally, the exported HTML report shows 
coverage_with_EclEmma_and_lambdas_and_AssertJ.* and TestPlaypen at 100% 
coverage but lambda$0() at 0%.

Thanks! -- David Bakin

-- 
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/1ae95352-a288-42c8-bf85-60546a69d285%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to