Package org.jacoco.core.analysis

Examples of org.jacoco.core.analysis.LinesImpl


  private LinesImpl lines;

  @Before
  public void setup() throws Exception {
    htmlSupport = new HTMLSupport();
    lines = new LinesImpl();
    buffer = new StringWriter();
    html = new HTMLDocument(buffer, "UTF-8");
    html.head().title();
    parent = html.body();
    sourceHighlighter = new SourceHighlighter();
View Full Code Here


  private LinesImpl lines;

  @Before
  public void setup() throws Exception {
    htmlSupport = new HTMLSupport();
    lines = new LinesImpl();
    buffer = new StringWriter();
    html = new HTMLDocument(buffer, "UTF-8");
    html.head().title();
    parent = html.body();
    sourceHighlighter = new SourceHighlighter();
View Full Code Here

*/
public class LinesImplTest {

  @Test
  public void testEmpty1() {
    ILines c = new LinesImpl();
    assertEquals(0, c.getTotalCount(), 0.0);
    assertEquals(0, c.getCoveredCount(), 0.0);
    assertEquals(-1, c.getFirstLine(), 0.0);
    assertEquals(-1, c.getLastLine(), 0.0);
    assertEquals(NO_CODE, c.getStatus(5), 0.0);
  }
View Full Code Here

    assertEquals(NO_CODE, c.getStatus(5), 0.0);
  }

  @Test
  public void testEmpty2() {
    ILines c = new LinesImpl(new int[0], false);
    assertEquals(0, c.getTotalCount(), 0.0);
    assertEquals(0, c.getCoveredCount(), 0.0);
    assertEquals(-1, c.getFirstLine(), 0.0);
    assertEquals(-1, c.getLastLine(), 0.0);
    assertEquals(NO_CODE, c.getStatus(5), 0.0);
  }
View Full Code Here

    assertEquals(NO_CODE, c.getStatus(5), 0.0);
  }

  @Test
  public void testEmpty3() {
    ILines c = new LinesImpl(new int[0], true);
    assertEquals(0, c.getTotalCount(), 0.0);
    assertEquals(0, c.getCoveredCount(), 0.0);
    assertEquals(-1, c.getFirstLine(), 0.0);
    assertEquals(-1, c.getLastLine(), 0.0);
    assertEquals(NO_CODE, c.getStatus(5), 0.0);
  }
View Full Code Here

    assertEquals(NO_CODE, c.getStatus(5), 0.0);
  }

  @Test
  public void testInitNotCovered() {
    ILines c = new LinesImpl(new int[] { 5, 7, 10 }, false);
    assertEquals(3, c.getTotalCount(), 0.0);
    assertEquals(0, c.getCoveredCount(), 0.0);
    assertEquals(5, c.getFirstLine(), 0.0);
    assertEquals(10, c.getLastLine(), 0.0);
    assertEquals(NO_CODE, c.getStatus(4), 0.0);
    assertEquals(NOT_COVERED, c.getStatus(5), 0.0);
    assertEquals(NO_CODE, c.getStatus(6), 0.0);
    assertEquals(NOT_COVERED, c.getStatus(7), 0.0);
    assertEquals(NO_CODE, c.getStatus(8), 0.0);
    assertEquals(NO_CODE, c.getStatus(9), 0.0);
    assertEquals(NOT_COVERED, c.getStatus(10), 0.0);
    assertEquals(NO_CODE, c.getStatus(11), 0.0);
  }
View Full Code Here

    assertEquals(NO_CODE, c.getStatus(11), 0.0);
  }

  @Test
  public void testInitCovered() {
    ILines c = new LinesImpl(new int[] { 5, 7, 10 }, true);
    assertEquals(3, c.getTotalCount(), 0.0);
    assertEquals(3, c.getCoveredCount(), 0.0);
    assertEquals(5, c.getFirstLine(), 0.0);
    assertEquals(10, c.getLastLine(), 0.0);
    assertEquals(NO_CODE, c.getStatus(4), 0.0);
    assertEquals(FULLY_COVERED, c.getStatus(5), 0.0);
    assertEquals(NO_CODE, c.getStatus(6), 0.0);
    assertEquals(FULLY_COVERED, c.getStatus(7), 0.0);
    assertEquals(NO_CODE, c.getStatus(8), 0.0);
    assertEquals(NO_CODE, c.getStatus(9), 0.0);
    assertEquals(FULLY_COVERED, c.getStatus(10), 0.0);
    assertEquals(NO_CODE, c.getStatus(11), 0.0);
  }
View Full Code Here

    // 3: . + . = .
    // 4: . + N = N
    // 5: N + N = N
    // ============
    // 4 total, 0 covered
    LinesImpl c = new LinesImpl(new int[] { 1, 2, 5 }, false);
    c.increment(new LinesImpl(new int[] { 1, 4, 5 }, false));
    assertEquals(4, c.getTotalCount(), 0.0);
    assertEquals(0, c.getCoveredCount(), 0.0);
    assertEquals(1, c.getFirstLine(), 0.0);
    assertEquals(5, c.getLastLine(), 0.0);
    assertEquals(NOT_COVERED, c.getStatus(1), 0.0);
    assertEquals(NOT_COVERED, c.getStatus(2), 0.0);
    assertEquals(NO_CODE, c.getStatus(3), 0.0);
    assertEquals(NOT_COVERED, c.getStatus(4), 0.0);
    assertEquals(NOT_COVERED, c.getStatus(5), 0.0);
  }
View Full Code Here

    // 2: F + . = F
    // 3: . + F = F
    // 4: F + F = F
    // ============
    // 4 total, 4 covered
    LinesImpl c = new LinesImpl(new int[] { 1, 2, 4 }, true);
    c.increment(new LinesImpl(new int[] { 1, 3, 4 }, true));
    assertEquals(4, c.getTotalCount(), 0.0);
    assertEquals(4, c.getCoveredCount(), 0.0);
    assertEquals(1, c.getFirstLine(), 0.0);
    assertEquals(4, c.getLastLine(), 0.0);
    assertEquals(FULLY_COVERED, c.getStatus(1), 0.0);
    assertEquals(FULLY_COVERED, c.getStatus(2), 0.0);
    assertEquals(FULLY_COVERED, c.getStatus(3), 0.0);
    assertEquals(FULLY_COVERED, c.getStatus(4), 0.0);
  }
View Full Code Here

  @Test
  public void testIncrement3() {
    // 1: F + N = P
    // ============
    // 1 total, 1 covered
    LinesImpl c = new LinesImpl(new int[] { 1 }, true);
    c.increment(new LinesImpl(new int[] { 1 }, false));
    assertEquals(1, c.getTotalCount(), 0.0);
    assertEquals(1, c.getCoveredCount(), 0.0);
    assertEquals(1, c.getFirstLine(), 0.0);
    assertEquals(1, c.getLastLine(), 0.0);
    assertEquals(PARTLY_COVERED, c.getStatus(1), 0.0);
  }
View Full Code Here

TOP

Related Classes of org.jacoco.core.analysis.LinesImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.