]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-6338 Stream reading / writing coverage message
authorJulien Lancelot <julien.lancelot@sonarsource.com>
Tue, 31 Mar 2015 13:25:18 +0000 (15:25 +0200)
committerJulien Lancelot <julien.lancelot@sonarsource.com>
Tue, 31 Mar 2015 13:32:47 +0000 (15:32 +0200)
server/sonar-server/src/main/java/org/sonar/server/computation/step/PersistCoverageStep.java
server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistCoverageStepTest.java
sonar-batch-protocol/src/main/gen-java/org/sonar/batch/protocol/output/BatchReport.java
sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/ProtobufUtil.java
sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/output/BatchReportReader.java
sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/output/BatchReportWriter.java
sonar-batch-protocol/src/main/protobuf/batch_report.proto
sonar-batch-protocol/src/test/java/org/sonar/batch/protocol/output/BatchReportReaderTest.java
sonar-batch-protocol/src/test/java/org/sonar/batch/protocol/output/BatchReportWriterTest.java

index 1cdec57b2b156d65d5c575ff2bc3d45a9d8fd9b2..6669f765053a247850adc0020f117f175f214f0b 100644 (file)
@@ -28,8 +28,6 @@ import org.sonar.batch.protocol.output.BatchReportReader;
 import org.sonar.server.computation.ComputationContext;
 import org.sonar.server.source.db.FileSourceDb;
 
-import javax.annotation.Nullable;
-
 /**
  * Nothing is persist for the moment. Only Coverage are read and not persist for the moment
  */
@@ -53,8 +51,8 @@ public class PersistCoverageStep implements ComputationStep {
     BatchReportReader reportReader = context.getReportReader();
     BatchReport.Component component = reportReader.readComponent(componentRef);
     if (component.getType().equals(Constants.ComponentType.FILE)) {
-      BatchReport.Coverage coverage = reportReader.readFileCoverage(componentRef);
-      processCoverage(component, coverage);
+      Iterable<BatchReport.Coverage> coverageList = reportReader.readFileCoverage(componentRef);
+      processCoverage(component, coverageList);
     }
 
     for (Integer childRef : component.getChildRefList()) {
@@ -62,39 +60,37 @@ public class PersistCoverageStep implements ComputationStep {
     }
   }
 
-  private void processCoverage(BatchReport.Component component, @Nullable BatchReport.Coverage coverage) {
+  private void processCoverage(BatchReport.Component component, Iterable<BatchReport.Coverage> coverageList) {
     fileSourceData = null;
-    if (coverage != null) {
       FileSourceDb.Data.Builder dataBuilder = FileSourceDb.Data.newBuilder();
-      for (int line = 0; line < coverage.getConditionsByLineCount(); line ++) {
-        FileSourceDb.Line.Builder lineBuilder = dataBuilder.addLinesBuilder().setLine(line);
-        processLineCoverage(line, lineBuilder, coverage);
+      for (BatchReport.Coverage coverage : coverageList) {
+        FileSourceDb.Line.Builder lineBuilder = dataBuilder.addLinesBuilder().setLine(coverage.getLine());
+        processLineCoverage(coverage.getLine(), lineBuilder, coverage);
       }
       fileSourceData = dataBuilder.build();
-    }
   }
 
   private void processLineCoverage(int line, FileSourceDb.Line.Builder lineBuilder, BatchReport.Coverage coverage){
     // Unit test
-    if (coverage.getUtHitsByLine(line)) {
+    if (coverage.getUtHits()) {
       lineBuilder.setUtLineHits(1);
     }
-    lineBuilder.setUtConditions(coverage.getConditionsByLine(line));
-    lineBuilder.setUtCoveredConditions(coverage.getUtCoveredConditionsByLine(line));
+    lineBuilder.setUtConditions(coverage.getConditions());
+    lineBuilder.setUtCoveredConditions(coverage.getUtCoveredConditions());
 
     // Integration test
-    if (coverage.getItHitsByLine(line)) {
+    if (coverage.getItHits()) {
       lineBuilder.setItLineHits(1);
     }
-    lineBuilder.setItConditions(coverage.getConditionsByLine(line));
-    lineBuilder.setItCoveredConditions(coverage.getItCoveredConditionsByLine(line));
+    lineBuilder.setItConditions(coverage.getConditions());
+    lineBuilder.setItCoveredConditions(coverage.getItCoveredConditions());
 
     // Overall test
-    if (coverage.getUtHitsByLine(line) || coverage.getItHitsByLine(line)) {
+    if (coverage.getUtHits() || coverage.getItHits()) {
       lineBuilder.setOverallLineHits(1);
     }
-    lineBuilder.setOverallConditions(coverage.getConditionsByLine(line));
-    lineBuilder.setOverallCoveredConditions(coverage.getOverallCoveredConditionsByLine(line));
+    lineBuilder.setOverallConditions(coverage.getConditions());
+    lineBuilder.setOverallCoveredConditions(coverage.getOverallCoveredConditions());
   }
 
   @VisibleForTesting
index e044cacc4c678fd9b9e550dcc10b13218bdb0a9e..0d394ad7e1376029778f3295c2ac4026ba46e45d 100644 (file)
@@ -36,8 +36,8 @@ import org.sonar.test.DbTests;
 
 import java.io.File;
 import java.io.IOException;
-import java.util.Arrays;
 
+import static com.google.common.collect.Lists.newArrayList;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.mock;
 
@@ -70,26 +70,28 @@ public class PersistCoverageStepTest extends BaseStepTest {
 
     step.execute(new ComputationContext(new BatchReportReader(reportDir), mock(ComponentDto.class)));
 
-    assertThat(step.getFileSourceData()).isNull();
+    assertThat(step.getFileSourceData().getLinesList()).isEmpty();
   }
 
   @Test
   public void compute_coverage_from_one_line() throws Exception {
     BatchReportWriter writer = initReport();
 
-    writer.writeFileCoverage(BatchReport.Coverage.newBuilder()
-      .setFileRef(FILE_REF)
-      .addAllConditionsByLine(Arrays.asList(10))
-      .addAllUtHitsByLine(Arrays.asList(true))
-      .addAllUtCoveredConditionsByLine(Arrays.asList(2))
-      .addAllItHitsByLine(Arrays.asList(false))
-      .addAllItCoveredConditionsByLine(Arrays.asList(3))
-      .addAllOverallCoveredConditionsByLine(Arrays.asList(4))
-      .build());
+    writer.writeFileCoverage(FILE_REF, newArrayList(BatchReport.Coverage.newBuilder()
+      .setLine(1)
+      .setConditions(10)
+      .setUtHits(true)
+      .setUtCoveredConditions(2)
+      .setItHits(false)
+      .setItCoveredConditions(3)
+      .setOverallCoveredConditions(4)
+      .build()));
 
     step.execute(new ComputationContext(new BatchReportReader(reportDir), mock(ComponentDto.class)));
 
     FileSourceDb.Data data = step.getFileSourceData();
+    assertThat(data.getLinesList()).hasSize(1);
+
     assertThat(data.getLines(0).getUtLineHits()).isEqualTo(1);
     assertThat(data.getLines(0).getUtConditions()).isEqualTo(10);
     assertThat(data.getLines(0).getUtCoveredConditions()).isEqualTo(2);
@@ -105,19 +107,40 @@ public class PersistCoverageStepTest extends BaseStepTest {
   public void compute_coverage_from_lines() throws Exception {
     BatchReportWriter writer = initReport();
 
-    writer.writeFileCoverage(BatchReport.Coverage.newBuilder()
-      .setFileRef(FILE_REF)
-      .addAllConditionsByLine(Arrays.asList(10, 0, 4))
-      .addAllUtHitsByLine(Arrays.asList(true, false, false))
-      .addAllItHitsByLine(Arrays.asList(false, true, true))
-      .addAllUtCoveredConditionsByLine(Arrays.asList(1, 0, 4))
-      .addAllItCoveredConditionsByLine(Arrays.asList(1, 0, 5))
-      .addAllOverallCoveredConditionsByLine(Arrays.asList(1, 0, 5))
-      .build());
+    writer.writeFileCoverage(FILE_REF, newArrayList(
+      BatchReport.Coverage.newBuilder()
+        .setLine(1)
+        .setConditions(10)
+        .setUtHits(true)
+        .setUtCoveredConditions(1)
+        .setItHits(false)
+        .setItCoveredConditions(1)
+        .setOverallCoveredConditions(1)
+        .build(),
+      BatchReport.Coverage.newBuilder()
+        .setLine(2)
+        .setConditions(0)
+        .setUtHits(false)
+        .setUtCoveredConditions(0)
+        .setItHits(true)
+        .setItCoveredConditions(0)
+        .setOverallCoveredConditions(0)
+        .build(),
+      BatchReport.Coverage.newBuilder()
+        .setLine(3)
+        .setConditions(4)
+        .setUtHits(false)
+        .setUtCoveredConditions(4)
+        .setItHits(true)
+        .setItCoveredConditions(5)
+        .setOverallCoveredConditions(5)
+        .build()));
 
     step.execute(new ComputationContext(new BatchReportReader(reportDir), mock(ComponentDto.class)));
 
     FileSourceDb.Data data = step.getFileSourceData();
+    assertThat(data.getLinesList()).hasSize(3);
+
     assertThat(data.getLines(0).getUtLineHits()).isEqualTo(1);
     assertThat(data.getLines(0).hasItLineHits()).isFalse();
 
index 9d49b73741c03dbae520cb98e47bc629c9ef553f..f065690b54b5efb4230418e13bffc749288ff7b8 100644 (file)
@@ -19464,174 +19464,82 @@ public final class BatchReport {
       com.google.protobuf.MessageOrBuilder {
 
     /**
-     * <code>optional int32 file_ref = 1;</code>
-     *
-     * <pre>
-     * Only FILE component has coverage information
-     * </pre>
+     * <code>optional int32 line = 1;</code>
      */
-    boolean hasFileRef();
+    boolean hasLine();
     /**
-     * <code>optional int32 file_ref = 1;</code>
-     *
-     * <pre>
-     * Only FILE component has coverage information
-     * </pre>
+     * <code>optional int32 line = 1;</code>
      */
-    int getFileRef();
+    int getLine();
 
     /**
-     * <code>repeated int32 conditions_by_line = 2 [packed = true];</code>
-     *
-     * <pre>
-     * List of number of conditions by line : 0 =&gt; not to cover, 1+ =&gt; number of conditions to cover
-     * </pre>
-     */
-    java.util.List<java.lang.Integer> getConditionsByLineList();
-    /**
-     * <code>repeated int32 conditions_by_line = 2 [packed = true];</code>
+     * <code>optional int32 conditions = 2;</code>
      *
      * <pre>
-     * List of number of conditions by line : 0 =&gt; not to cover, 1+ =&gt; number of conditions to cover
+     * Number of conditions to cover (never 0)
      * </pre>
      */
-    int getConditionsByLineCount();
+    boolean hasConditions();
     /**
-     * <code>repeated int32 conditions_by_line = 2 [packed = true];</code>
+     * <code>optional int32 conditions = 2;</code>
      *
      * <pre>
-     * List of number of conditions by line : 0 =&gt; not to cover, 1+ =&gt; number of conditions to cover
+     * Number of conditions to cover (never 0)
      * </pre>
      */
-    int getConditionsByLine(int index);
+    int getConditions();
 
     /**
-     * <code>repeated bool ut_hits_by_line = 3 [packed = true];</code>
-     *
-     * <pre>
-     * List of unit test hits by line
-     * </pre>
-     */
-    java.util.List<java.lang.Boolean> getUtHitsByLineList();
-    /**
-     * <code>repeated bool ut_hits_by_line = 3 [packed = true];</code>
-     *
-     * <pre>
-     * List of unit test hits by line
-     * </pre>
+     * <code>optional bool ut_hits = 3;</code>
      */
-    int getUtHitsByLineCount();
+    boolean hasUtHits();
     /**
-     * <code>repeated bool ut_hits_by_line = 3 [packed = true];</code>
-     *
-     * <pre>
-     * List of unit test hits by line
-     * </pre>
+     * <code>optional bool ut_hits = 3;</code>
      */
-    boolean getUtHitsByLine(int index);
+    boolean getUtHits();
 
     /**
-     * <code>repeated bool it_hits_by_line = 4 [packed = true];</code>
-     *
-     * <pre>
-     * List of integration test hits by line
-     * </pre>
-     */
-    java.util.List<java.lang.Boolean> getItHitsByLineList();
-    /**
-     * <code>repeated bool it_hits_by_line = 4 [packed = true];</code>
-     *
-     * <pre>
-     * List of integration test hits by line
-     * </pre>
+     * <code>optional bool it_hits = 4;</code>
      */
-    int getItHitsByLineCount();
+    boolean hasItHits();
     /**
-     * <code>repeated bool it_hits_by_line = 4 [packed = true];</code>
-     *
-     * <pre>
-     * List of integration test hits by line
-     * </pre>
+     * <code>optional bool it_hits = 4;</code>
      */
-    boolean getItHitsByLine(int index);
+    boolean getItHits();
 
     /**
-     * <code>repeated int32 ut_covered_conditions_by_line = 5 [packed = true];</code>
-     *
-     * <pre>
-     * List of number of conditions covered by unit test by line
-     * </pre>
-     */
-    java.util.List<java.lang.Integer> getUtCoveredConditionsByLineList();
-    /**
-     * <code>repeated int32 ut_covered_conditions_by_line = 5 [packed = true];</code>
-     *
-     * <pre>
-     * List of number of conditions covered by unit test by line
-     * </pre>
+     * <code>optional int32 ut_covered_conditions = 5;</code>
      */
-    int getUtCoveredConditionsByLineCount();
+    boolean hasUtCoveredConditions();
     /**
-     * <code>repeated int32 ut_covered_conditions_by_line = 5 [packed = true];</code>
-     *
-     * <pre>
-     * List of number of conditions covered by unit test by line
-     * </pre>
+     * <code>optional int32 ut_covered_conditions = 5;</code>
      */
-    int getUtCoveredConditionsByLine(int index);
+    int getUtCoveredConditions();
 
     /**
-     * <code>repeated int32 it_covered_conditions_by_line = 6 [packed = true];</code>
-     *
-     * <pre>
-     * List of number of conditions covered by integration test by line
-     * </pre>
-     */
-    java.util.List<java.lang.Integer> getItCoveredConditionsByLineList();
-    /**
-     * <code>repeated int32 it_covered_conditions_by_line = 6 [packed = true];</code>
-     *
-     * <pre>
-     * List of number of conditions covered by integration test by line
-     * </pre>
+     * <code>optional int32 it_covered_conditions = 6;</code>
      */
-    int getItCoveredConditionsByLineCount();
+    boolean hasItCoveredConditions();
     /**
-     * <code>repeated int32 it_covered_conditions_by_line = 6 [packed = true];</code>
-     *
-     * <pre>
-     * List of number of conditions covered by integration test by line
-     * </pre>
+     * <code>optional int32 it_covered_conditions = 6;</code>
      */
-    int getItCoveredConditionsByLine(int index);
+    int getItCoveredConditions();
 
     /**
-     * <code>repeated int32 overall_covered_conditions_by_line = 7 [packed = true];</code>
-     *
-     * <pre>
-     * List of number of conditions covered by overall test by line
-     * </pre>
-     */
-    java.util.List<java.lang.Integer> getOverallCoveredConditionsByLineList();
-    /**
-     * <code>repeated int32 overall_covered_conditions_by_line = 7 [packed = true];</code>
-     *
-     * <pre>
-     * List of number of conditions covered by overall test by line
-     * </pre>
+     * <code>optional int32 overall_covered_conditions = 7;</code>
      */
-    int getOverallCoveredConditionsByLineCount();
+    boolean hasOverallCoveredConditions();
     /**
-     * <code>repeated int32 overall_covered_conditions_by_line = 7 [packed = true];</code>
-     *
-     * <pre>
-     * List of number of conditions covered by overall test by line
-     * </pre>
+     * <code>optional int32 overall_covered_conditions = 7;</code>
      */
-    int getOverallCoveredConditionsByLine(int index);
+    int getOverallCoveredConditions();
   }
   /**
    * Protobuf type {@code Coverage}
+   *
+   * <pre>
+   * Only FILE component has coverage information
+   * </pre>
    */
   public static final class Coverage extends
       com.google.protobuf.GeneratedMessage implements
@@ -19684,133 +19592,37 @@ public final class BatchReport {
             }
             case 8: {
               bitField0_ |= 0x00000001;
-              fileRef_ = input.readInt32();
+              line_ = input.readInt32();
               break;
             }
             case 16: {
-              if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
-                conditionsByLine_ = new java.util.ArrayList<java.lang.Integer>();
-                mutable_bitField0_ |= 0x00000002;
-              }
-              conditionsByLine_.add(input.readInt32());
-              break;
-            }
-            case 18: {
-              int length = input.readRawVarint32();
-              int limit = input.pushLimit(length);
-              if (!((mutable_bitField0_ & 0x00000002) == 0x00000002) && input.getBytesUntilLimit() > 0) {
-                conditionsByLine_ = new java.util.ArrayList<java.lang.Integer>();
-                mutable_bitField0_ |= 0x00000002;
-              }
-              while (input.getBytesUntilLimit() > 0) {
-                conditionsByLine_.add(input.readInt32());
-              }
-              input.popLimit(limit);
+              bitField0_ |= 0x00000002;
+              conditions_ = input.readInt32();
               break;
             }
             case 24: {
-              if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
-                utHitsByLine_ = new java.util.ArrayList<java.lang.Boolean>();
-                mutable_bitField0_ |= 0x00000004;
-              }
-              utHitsByLine_.add(input.readBool());
-              break;
-            }
-            case 26: {
-              int length = input.readRawVarint32();
-              int limit = input.pushLimit(length);
-              if (!((mutable_bitField0_ & 0x00000004) == 0x00000004) && input.getBytesUntilLimit() > 0) {
-                utHitsByLine_ = new java.util.ArrayList<java.lang.Boolean>();
-                mutable_bitField0_ |= 0x00000004;
-              }
-              while (input.getBytesUntilLimit() > 0) {
-                utHitsByLine_.add(input.readBool());
-              }
-              input.popLimit(limit);
+              bitField0_ |= 0x00000004;
+              utHits_ = input.readBool();
               break;
             }
             case 32: {
-              if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) {
-                itHitsByLine_ = new java.util.ArrayList<java.lang.Boolean>();
-                mutable_bitField0_ |= 0x00000008;
-              }
-              itHitsByLine_.add(input.readBool());
-              break;
-            }
-            case 34: {
-              int length = input.readRawVarint32();
-              int limit = input.pushLimit(length);
-              if (!((mutable_bitField0_ & 0x00000008) == 0x00000008) && input.getBytesUntilLimit() > 0) {
-                itHitsByLine_ = new java.util.ArrayList<java.lang.Boolean>();
-                mutable_bitField0_ |= 0x00000008;
-              }
-              while (input.getBytesUntilLimit() > 0) {
-                itHitsByLine_.add(input.readBool());
-              }
-              input.popLimit(limit);
+              bitField0_ |= 0x00000008;
+              itHits_ = input.readBool();
               break;
             }
             case 40: {
-              if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) {
-                utCoveredConditionsByLine_ = new java.util.ArrayList<java.lang.Integer>();
-                mutable_bitField0_ |= 0x00000010;
-              }
-              utCoveredConditionsByLine_.add(input.readInt32());
-              break;
-            }
-            case 42: {
-              int length = input.readRawVarint32();
-              int limit = input.pushLimit(length);
-              if (!((mutable_bitField0_ & 0x00000010) == 0x00000010) && input.getBytesUntilLimit() > 0) {
-                utCoveredConditionsByLine_ = new java.util.ArrayList<java.lang.Integer>();
-                mutable_bitField0_ |= 0x00000010;
-              }
-              while (input.getBytesUntilLimit() > 0) {
-                utCoveredConditionsByLine_.add(input.readInt32());
-              }
-              input.popLimit(limit);
+              bitField0_ |= 0x00000010;
+              utCoveredConditions_ = input.readInt32();
               break;
             }
             case 48: {
-              if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) {
-                itCoveredConditionsByLine_ = new java.util.ArrayList<java.lang.Integer>();
-                mutable_bitField0_ |= 0x00000020;
-              }
-              itCoveredConditionsByLine_.add(input.readInt32());
-              break;
-            }
-            case 50: {
-              int length = input.readRawVarint32();
-              int limit = input.pushLimit(length);
-              if (!((mutable_bitField0_ & 0x00000020) == 0x00000020) && input.getBytesUntilLimit() > 0) {
-                itCoveredConditionsByLine_ = new java.util.ArrayList<java.lang.Integer>();
-                mutable_bitField0_ |= 0x00000020;
-              }
-              while (input.getBytesUntilLimit() > 0) {
-                itCoveredConditionsByLine_.add(input.readInt32());
-              }
-              input.popLimit(limit);
+              bitField0_ |= 0x00000020;
+              itCoveredConditions_ = input.readInt32();
               break;
             }
             case 56: {
-              if (!((mutable_bitField0_ & 0x00000040) == 0x00000040)) {
-                overallCoveredConditionsByLine_ = new java.util.ArrayList<java.lang.Integer>();
-                mutable_bitField0_ |= 0x00000040;
-              }
-              overallCoveredConditionsByLine_.add(input.readInt32());
-              break;
-            }
-            case 58: {
-              int length = input.readRawVarint32();
-              int limit = input.pushLimit(length);
-              if (!((mutable_bitField0_ & 0x00000040) == 0x00000040) && input.getBytesUntilLimit() > 0) {
-                overallCoveredConditionsByLine_ = new java.util.ArrayList<java.lang.Integer>();
-                mutable_bitField0_ |= 0x00000040;
-              }
-              while (input.getBytesUntilLimit() > 0) {
-                overallCoveredConditionsByLine_.add(input.readInt32());
-              }
-              input.popLimit(limit);
+              bitField0_ |= 0x00000040;
+              overallCoveredConditions_ = input.readInt32();
               break;
             }
           }
@@ -19821,24 +19633,6 @@ public final class BatchReport {
         throw new com.google.protobuf.InvalidProtocolBufferException(
             e.getMessage()).setUnfinishedMessage(this);
       } finally {
-        if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
-          conditionsByLine_ = java.util.Collections.unmodifiableList(conditionsByLine_);
-        }
-        if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
-          utHitsByLine_ = java.util.Collections.unmodifiableList(utHitsByLine_);
-        }
-        if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) {
-          itHitsByLine_ = java.util.Collections.unmodifiableList(itHitsByLine_);
-        }
-        if (((mutable_bitField0_ & 0x00000010) == 0x00000010)) {
-          utCoveredConditionsByLine_ = java.util.Collections.unmodifiableList(utCoveredConditionsByLine_);
-        }
-        if (((mutable_bitField0_ & 0x00000020) == 0x00000020)) {
-          itCoveredConditionsByLine_ = java.util.Collections.unmodifiableList(itCoveredConditionsByLine_);
-        }
-        if (((mutable_bitField0_ & 0x00000040) == 0x00000040)) {
-          overallCoveredConditionsByLine_ = java.util.Collections.unmodifiableList(overallCoveredConditionsByLine_);
-        }
         this.unknownFields = unknownFields.build();
         makeExtensionsImmutable();
       }
@@ -19871,247 +19665,127 @@ public final class BatchReport {
     }
 
     private int bitField0_;
-    public static final int FILE_REF_FIELD_NUMBER = 1;
-    private int fileRef_;
+    public static final int LINE_FIELD_NUMBER = 1;
+    private int line_;
     /**
-     * <code>optional int32 file_ref = 1;</code>
-     *
-     * <pre>
-     * Only FILE component has coverage information
-     * </pre>
+     * <code>optional int32 line = 1;</code>
      */
-    public boolean hasFileRef() {
+    public boolean hasLine() {
       return ((bitField0_ & 0x00000001) == 0x00000001);
     }
     /**
-     * <code>optional int32 file_ref = 1;</code>
-     *
-     * <pre>
-     * Only FILE component has coverage information
-     * </pre>
+     * <code>optional int32 line = 1;</code>
      */
-    public int getFileRef() {
-      return fileRef_;
+    public int getLine() {
+      return line_;
     }
 
-    public static final int CONDITIONS_BY_LINE_FIELD_NUMBER = 2;
-    private java.util.List<java.lang.Integer> conditionsByLine_;
-    /**
-     * <code>repeated int32 conditions_by_line = 2 [packed = true];</code>
-     *
-     * <pre>
-     * List of number of conditions by line : 0 =&gt; not to cover, 1+ =&gt; number of conditions to cover
-     * </pre>
-     */
-    public java.util.List<java.lang.Integer>
-        getConditionsByLineList() {
-      return conditionsByLine_;
-    }
+    public static final int CONDITIONS_FIELD_NUMBER = 2;
+    private int conditions_;
     /**
-     * <code>repeated int32 conditions_by_line = 2 [packed = true];</code>
+     * <code>optional int32 conditions = 2;</code>
      *
      * <pre>
-     * List of number of conditions by line : 0 =&gt; not to cover, 1+ =&gt; number of conditions to cover
+     * Number of conditions to cover (never 0)
      * </pre>
      */
-    public int getConditionsByLineCount() {
-      return conditionsByLine_.size();
+    public boolean hasConditions() {
+      return ((bitField0_ & 0x00000002) == 0x00000002);
     }
     /**
-     * <code>repeated int32 conditions_by_line = 2 [packed = true];</code>
+     * <code>optional int32 conditions = 2;</code>
      *
      * <pre>
-     * List of number of conditions by line : 0 =&gt; not to cover, 1+ =&gt; number of conditions to cover
+     * Number of conditions to cover (never 0)
      * </pre>
      */
-    public int getConditionsByLine(int index) {
-      return conditionsByLine_.get(index);
+    public int getConditions() {
+      return conditions_;
     }
-    private int conditionsByLineMemoizedSerializedSize = -1;
 
-    public static final int UT_HITS_BY_LINE_FIELD_NUMBER = 3;
-    private java.util.List<java.lang.Boolean> utHitsByLine_;
-    /**
-     * <code>repeated bool ut_hits_by_line = 3 [packed = true];</code>
-     *
-     * <pre>
-     * List of unit test hits by line
-     * </pre>
-     */
-    public java.util.List<java.lang.Boolean>
-        getUtHitsByLineList() {
-      return utHitsByLine_;
-    }
+    public static final int UT_HITS_FIELD_NUMBER = 3;
+    private boolean utHits_;
     /**
-     * <code>repeated bool ut_hits_by_line = 3 [packed = true];</code>
-     *
-     * <pre>
-     * List of unit test hits by line
-     * </pre>
+     * <code>optional bool ut_hits = 3;</code>
      */
-    public int getUtHitsByLineCount() {
-      return utHitsByLine_.size();
+    public boolean hasUtHits() {
+      return ((bitField0_ & 0x00000004) == 0x00000004);
     }
     /**
-     * <code>repeated bool ut_hits_by_line = 3 [packed = true];</code>
-     *
-     * <pre>
-     * List of unit test hits by line
-     * </pre>
+     * <code>optional bool ut_hits = 3;</code>
      */
-    public boolean getUtHitsByLine(int index) {
-      return utHitsByLine_.get(index);
+    public boolean getUtHits() {
+      return utHits_;
     }
-    private int utHitsByLineMemoizedSerializedSize = -1;
 
-    public static final int IT_HITS_BY_LINE_FIELD_NUMBER = 4;
-    private java.util.List<java.lang.Boolean> itHitsByLine_;
-    /**
-     * <code>repeated bool it_hits_by_line = 4 [packed = true];</code>
-     *
-     * <pre>
-     * List of integration test hits by line
-     * </pre>
-     */
-    public java.util.List<java.lang.Boolean>
-        getItHitsByLineList() {
-      return itHitsByLine_;
-    }
+    public static final int IT_HITS_FIELD_NUMBER = 4;
+    private boolean itHits_;
     /**
-     * <code>repeated bool it_hits_by_line = 4 [packed = true];</code>
-     *
-     * <pre>
-     * List of integration test hits by line
-     * </pre>
+     * <code>optional bool it_hits = 4;</code>
      */
-    public int getItHitsByLineCount() {
-      return itHitsByLine_.size();
+    public boolean hasItHits() {
+      return ((bitField0_ & 0x00000008) == 0x00000008);
     }
     /**
-     * <code>repeated bool it_hits_by_line = 4 [packed = true];</code>
-     *
-     * <pre>
-     * List of integration test hits by line
-     * </pre>
+     * <code>optional bool it_hits = 4;</code>
      */
-    public boolean getItHitsByLine(int index) {
-      return itHitsByLine_.get(index);
+    public boolean getItHits() {
+      return itHits_;
     }
-    private int itHitsByLineMemoizedSerializedSize = -1;
 
-    public static final int UT_COVERED_CONDITIONS_BY_LINE_FIELD_NUMBER = 5;
-    private java.util.List<java.lang.Integer> utCoveredConditionsByLine_;
+    public static final int UT_COVERED_CONDITIONS_FIELD_NUMBER = 5;
+    private int utCoveredConditions_;
     /**
-     * <code>repeated int32 ut_covered_conditions_by_line = 5 [packed = true];</code>
-     *
-     * <pre>
-     * List of number of conditions covered by unit test by line
-     * </pre>
+     * <code>optional int32 ut_covered_conditions = 5;</code>
      */
-    public java.util.List<java.lang.Integer>
-        getUtCoveredConditionsByLineList() {
-      return utCoveredConditionsByLine_;
+    public boolean hasUtCoveredConditions() {
+      return ((bitField0_ & 0x00000010) == 0x00000010);
     }
     /**
-     * <code>repeated int32 ut_covered_conditions_by_line = 5 [packed = true];</code>
-     *
-     * <pre>
-     * List of number of conditions covered by unit test by line
-     * </pre>
+     * <code>optional int32 ut_covered_conditions = 5;</code>
      */
-    public int getUtCoveredConditionsByLineCount() {
-      return utCoveredConditionsByLine_.size();
+    public int getUtCoveredConditions() {
+      return utCoveredConditions_;
     }
+
+    public static final int IT_COVERED_CONDITIONS_FIELD_NUMBER = 6;
+    private int itCoveredConditions_;
     /**
-     * <code>repeated int32 ut_covered_conditions_by_line = 5 [packed = true];</code>
-     *
-     * <pre>
-     * List of number of conditions covered by unit test by line
-     * </pre>
+     * <code>optional int32 it_covered_conditions = 6;</code>
      */
-    public int getUtCoveredConditionsByLine(int index) {
-      return utCoveredConditionsByLine_.get(index);
+    public boolean hasItCoveredConditions() {
+      return ((bitField0_ & 0x00000020) == 0x00000020);
     }
-    private int utCoveredConditionsByLineMemoizedSerializedSize = -1;
-
-    public static final int IT_COVERED_CONDITIONS_BY_LINE_FIELD_NUMBER = 6;
-    private java.util.List<java.lang.Integer> itCoveredConditionsByLine_;
     /**
-     * <code>repeated int32 it_covered_conditions_by_line = 6 [packed = true];</code>
-     *
-     * <pre>
-     * List of number of conditions covered by integration test by line
-     * </pre>
+     * <code>optional int32 it_covered_conditions = 6;</code>
      */
-    public java.util.List<java.lang.Integer>
-        getItCoveredConditionsByLineList() {
-      return itCoveredConditionsByLine_;
+    public int getItCoveredConditions() {
+      return itCoveredConditions_;
     }
+
+    public static final int OVERALL_COVERED_CONDITIONS_FIELD_NUMBER = 7;
+    private int overallCoveredConditions_;
     /**
-     * <code>repeated int32 it_covered_conditions_by_line = 6 [packed = true];</code>
-     *
-     * <pre>
-     * List of number of conditions covered by integration test by line
-     * </pre>
+     * <code>optional int32 overall_covered_conditions = 7;</code>
      */
-    public int getItCoveredConditionsByLineCount() {
-      return itCoveredConditionsByLine_.size();
+    public boolean hasOverallCoveredConditions() {
+      return ((bitField0_ & 0x00000040) == 0x00000040);
     }
     /**
-     * <code>repeated int32 it_covered_conditions_by_line = 6 [packed = true];</code>
-     *
-     * <pre>
-     * List of number of conditions covered by integration test by line
-     * </pre>
+     * <code>optional int32 overall_covered_conditions = 7;</code>
      */
-    public int getItCoveredConditionsByLine(int index) {
-      return itCoveredConditionsByLine_.get(index);
+    public int getOverallCoveredConditions() {
+      return overallCoveredConditions_;
     }
-    private int itCoveredConditionsByLineMemoizedSerializedSize = -1;
 
-    public static final int OVERALL_COVERED_CONDITIONS_BY_LINE_FIELD_NUMBER = 7;
-    private java.util.List<java.lang.Integer> overallCoveredConditionsByLine_;
-    /**
-     * <code>repeated int32 overall_covered_conditions_by_line = 7 [packed = true];</code>
-     *
-     * <pre>
-     * List of number of conditions covered by overall test by line
-     * </pre>
-     */
-    public java.util.List<java.lang.Integer>
-        getOverallCoveredConditionsByLineList() {
-      return overallCoveredConditionsByLine_;
-    }
-    /**
-     * <code>repeated int32 overall_covered_conditions_by_line = 7 [packed = true];</code>
-     *
-     * <pre>
-     * List of number of conditions covered by overall test by line
-     * </pre>
-     */
-    public int getOverallCoveredConditionsByLineCount() {
-      return overallCoveredConditionsByLine_.size();
-    }
-    /**
-     * <code>repeated int32 overall_covered_conditions_by_line = 7 [packed = true];</code>
-     *
-     * <pre>
-     * List of number of conditions covered by overall test by line
-     * </pre>
-     */
-    public int getOverallCoveredConditionsByLine(int index) {
-      return overallCoveredConditionsByLine_.get(index);
-    }
-    private int overallCoveredConditionsByLineMemoizedSerializedSize = -1;
-
-    private void initFields() {
-      fileRef_ = 0;
-      conditionsByLine_ = java.util.Collections.emptyList();
-      utHitsByLine_ = java.util.Collections.emptyList();
-      itHitsByLine_ = java.util.Collections.emptyList();
-      utCoveredConditionsByLine_ = java.util.Collections.emptyList();
-      itCoveredConditionsByLine_ = java.util.Collections.emptyList();
-      overallCoveredConditionsByLine_ = java.util.Collections.emptyList();
+    private void initFields() {
+      line_ = 0;
+      conditions_ = 0;
+      utHits_ = false;
+      itHits_ = false;
+      utCoveredConditions_ = 0;
+      itCoveredConditions_ = 0;
+      overallCoveredConditions_ = 0;
     }
     private byte memoizedIsInitialized = -1;
     public final boolean isInitialized() {
@@ -20127,49 +19801,25 @@ public final class BatchReport {
                         throws java.io.IOException {
       getSerializedSize();
       if (((bitField0_ & 0x00000001) == 0x00000001)) {
-        output.writeInt32(1, fileRef_);
-      }
-      if (getConditionsByLineList().size() > 0) {
-        output.writeRawVarint32(18);
-        output.writeRawVarint32(conditionsByLineMemoizedSerializedSize);
-      }
-      for (int i = 0; i < conditionsByLine_.size(); i++) {
-        output.writeInt32NoTag(conditionsByLine_.get(i));
-      }
-      if (getUtHitsByLineList().size() > 0) {
-        output.writeRawVarint32(26);
-        output.writeRawVarint32(utHitsByLineMemoizedSerializedSize);
+        output.writeInt32(1, line_);
       }
-      for (int i = 0; i < utHitsByLine_.size(); i++) {
-        output.writeBoolNoTag(utHitsByLine_.get(i));
-      }
-      if (getItHitsByLineList().size() > 0) {
-        output.writeRawVarint32(34);
-        output.writeRawVarint32(itHitsByLineMemoizedSerializedSize);
-      }
-      for (int i = 0; i < itHitsByLine_.size(); i++) {
-        output.writeBoolNoTag(itHitsByLine_.get(i));
-      }
-      if (getUtCoveredConditionsByLineList().size() > 0) {
-        output.writeRawVarint32(42);
-        output.writeRawVarint32(utCoveredConditionsByLineMemoizedSerializedSize);
+      if (((bitField0_ & 0x00000002) == 0x00000002)) {
+        output.writeInt32(2, conditions_);
       }
-      for (int i = 0; i < utCoveredConditionsByLine_.size(); i++) {
-        output.writeInt32NoTag(utCoveredConditionsByLine_.get(i));
+      if (((bitField0_ & 0x00000004) == 0x00000004)) {
+        output.writeBool(3, utHits_);
       }
-      if (getItCoveredConditionsByLineList().size() > 0) {
-        output.writeRawVarint32(50);
-        output.writeRawVarint32(itCoveredConditionsByLineMemoizedSerializedSize);
+      if (((bitField0_ & 0x00000008) == 0x00000008)) {
+        output.writeBool(4, itHits_);
       }
-      for (int i = 0; i < itCoveredConditionsByLine_.size(); i++) {
-        output.writeInt32NoTag(itCoveredConditionsByLine_.get(i));
+      if (((bitField0_ & 0x00000010) == 0x00000010)) {
+        output.writeInt32(5, utCoveredConditions_);
       }
-      if (getOverallCoveredConditionsByLineList().size() > 0) {
-        output.writeRawVarint32(58);
-        output.writeRawVarint32(overallCoveredConditionsByLineMemoizedSerializedSize);
+      if (((bitField0_ & 0x00000020) == 0x00000020)) {
+        output.writeInt32(6, itCoveredConditions_);
       }
-      for (int i = 0; i < overallCoveredConditionsByLine_.size(); i++) {
-        output.writeInt32NoTag(overallCoveredConditionsByLine_.get(i));
+      if (((bitField0_ & 0x00000040) == 0x00000040)) {
+        output.writeInt32(7, overallCoveredConditions_);
       }
       getUnknownFields().writeTo(output);
     }
@@ -20182,85 +19832,31 @@ public final class BatchReport {
       size = 0;
       if (((bitField0_ & 0x00000001) == 0x00000001)) {
         size += com.google.protobuf.CodedOutputStream
-          .computeInt32Size(1, fileRef_);
+          .computeInt32Size(1, line_);
       }
-      {
-        int dataSize = 0;
-        for (int i = 0; i < conditionsByLine_.size(); i++) {
-          dataSize += com.google.protobuf.CodedOutputStream
-            .computeInt32SizeNoTag(conditionsByLine_.get(i));
-        }
-        size += dataSize;
-        if (!getConditionsByLineList().isEmpty()) {
-          size += 1;
-          size += com.google.protobuf.CodedOutputStream
-              .computeInt32SizeNoTag(dataSize);
-        }
-        conditionsByLineMemoizedSerializedSize = dataSize;
+      if (((bitField0_ & 0x00000002) == 0x00000002)) {
+        size += com.google.protobuf.CodedOutputStream
+          .computeInt32Size(2, conditions_);
       }
-      {
-        int dataSize = 0;
-        dataSize = 1 * getUtHitsByLineList().size();
-        size += dataSize;
-        if (!getUtHitsByLineList().isEmpty()) {
-          size += 1;
-          size += com.google.protobuf.CodedOutputStream
-              .computeInt32SizeNoTag(dataSize);
-        }
-        utHitsByLineMemoizedSerializedSize = dataSize;
+      if (((bitField0_ & 0x00000004) == 0x00000004)) {
+        size += com.google.protobuf.CodedOutputStream
+          .computeBoolSize(3, utHits_);
       }
-      {
-        int dataSize = 0;
-        dataSize = 1 * getItHitsByLineList().size();
-        size += dataSize;
-        if (!getItHitsByLineList().isEmpty()) {
-          size += 1;
-          size += com.google.protobuf.CodedOutputStream
-              .computeInt32SizeNoTag(dataSize);
-        }
-        itHitsByLineMemoizedSerializedSize = dataSize;
+      if (((bitField0_ & 0x00000008) == 0x00000008)) {
+        size += com.google.protobuf.CodedOutputStream
+          .computeBoolSize(4, itHits_);
       }
-      {
-        int dataSize = 0;
-        for (int i = 0; i < utCoveredConditionsByLine_.size(); i++) {
-          dataSize += com.google.protobuf.CodedOutputStream
-            .computeInt32SizeNoTag(utCoveredConditionsByLine_.get(i));
-        }
-        size += dataSize;
-        if (!getUtCoveredConditionsByLineList().isEmpty()) {
-          size += 1;
-          size += com.google.protobuf.CodedOutputStream
-              .computeInt32SizeNoTag(dataSize);
-        }
-        utCoveredConditionsByLineMemoizedSerializedSize = dataSize;
+      if (((bitField0_ & 0x00000010) == 0x00000010)) {
+        size += com.google.protobuf.CodedOutputStream
+          .computeInt32Size(5, utCoveredConditions_);
       }
-      {
-        int dataSize = 0;
-        for (int i = 0; i < itCoveredConditionsByLine_.size(); i++) {
-          dataSize += com.google.protobuf.CodedOutputStream
-            .computeInt32SizeNoTag(itCoveredConditionsByLine_.get(i));
-        }
-        size += dataSize;
-        if (!getItCoveredConditionsByLineList().isEmpty()) {
-          size += 1;
-          size += com.google.protobuf.CodedOutputStream
-              .computeInt32SizeNoTag(dataSize);
-        }
-        itCoveredConditionsByLineMemoizedSerializedSize = dataSize;
+      if (((bitField0_ & 0x00000020) == 0x00000020)) {
+        size += com.google.protobuf.CodedOutputStream
+          .computeInt32Size(6, itCoveredConditions_);
       }
-      {
-        int dataSize = 0;
-        for (int i = 0; i < overallCoveredConditionsByLine_.size(); i++) {
-          dataSize += com.google.protobuf.CodedOutputStream
-            .computeInt32SizeNoTag(overallCoveredConditionsByLine_.get(i));
-        }
-        size += dataSize;
-        if (!getOverallCoveredConditionsByLineList().isEmpty()) {
-          size += 1;
-          size += com.google.protobuf.CodedOutputStream
-              .computeInt32SizeNoTag(dataSize);
-        }
-        overallCoveredConditionsByLineMemoizedSerializedSize = dataSize;
+      if (((bitField0_ & 0x00000040) == 0x00000040)) {
+        size += com.google.protobuf.CodedOutputStream
+          .computeInt32Size(7, overallCoveredConditions_);
       }
       size += getUnknownFields().getSerializedSize();
       memoizedSerializedSize = size;
@@ -20342,6 +19938,10 @@ public final class BatchReport {
     }
     /**
      * Protobuf type {@code Coverage}
+     *
+     * <pre>
+     * Only FILE component has coverage information
+     * </pre>
      */
     public static final class Builder extends
         com.google.protobuf.GeneratedMessage.Builder<Builder> implements
@@ -20379,19 +19979,19 @@ public final class BatchReport {
 
       public Builder clear() {
         super.clear();
-        fileRef_ = 0;
+        line_ = 0;
         bitField0_ = (bitField0_ & ~0x00000001);
-        conditionsByLine_ = java.util.Collections.emptyList();
+        conditions_ = 0;
         bitField0_ = (bitField0_ & ~0x00000002);
-        utHitsByLine_ = java.util.Collections.emptyList();
+        utHits_ = false;
         bitField0_ = (bitField0_ & ~0x00000004);
-        itHitsByLine_ = java.util.Collections.emptyList();
+        itHits_ = false;
         bitField0_ = (bitField0_ & ~0x00000008);
-        utCoveredConditionsByLine_ = java.util.Collections.emptyList();
+        utCoveredConditions_ = 0;
         bitField0_ = (bitField0_ & ~0x00000010);
-        itCoveredConditionsByLine_ = java.util.Collections.emptyList();
+        itCoveredConditions_ = 0;
         bitField0_ = (bitField0_ & ~0x00000020);
-        overallCoveredConditionsByLine_ = java.util.Collections.emptyList();
+        overallCoveredConditions_ = 0;
         bitField0_ = (bitField0_ & ~0x00000040);
         return this;
       }
@@ -20424,37 +20024,31 @@ public final class BatchReport {
         if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
           to_bitField0_ |= 0x00000001;
         }
-        result.fileRef_ = fileRef_;
-        if (((bitField0_ & 0x00000002) == 0x00000002)) {
-          conditionsByLine_ = java.util.Collections.unmodifiableList(conditionsByLine_);
-          bitField0_ = (bitField0_ & ~0x00000002);
+        result.line_ = line_;
+        if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
+          to_bitField0_ |= 0x00000002;
         }
-        result.conditionsByLine_ = conditionsByLine_;
-        if (((bitField0_ & 0x00000004) == 0x00000004)) {
-          utHitsByLine_ = java.util.Collections.unmodifiableList(utHitsByLine_);
-          bitField0_ = (bitField0_ & ~0x00000004);
+        result.conditions_ = conditions_;
+        if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
+          to_bitField0_ |= 0x00000004;
         }
-        result.utHitsByLine_ = utHitsByLine_;
-        if (((bitField0_ & 0x00000008) == 0x00000008)) {
-          itHitsByLine_ = java.util.Collections.unmodifiableList(itHitsByLine_);
-          bitField0_ = (bitField0_ & ~0x00000008);
+        result.utHits_ = utHits_;
+        if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
+          to_bitField0_ |= 0x00000008;
         }
-        result.itHitsByLine_ = itHitsByLine_;
-        if (((bitField0_ & 0x00000010) == 0x00000010)) {
-          utCoveredConditionsByLine_ = java.util.Collections.unmodifiableList(utCoveredConditionsByLine_);
-          bitField0_ = (bitField0_ & ~0x00000010);
+        result.itHits_ = itHits_;
+        if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
+          to_bitField0_ |= 0x00000010;
         }
-        result.utCoveredConditionsByLine_ = utCoveredConditionsByLine_;
-        if (((bitField0_ & 0x00000020) == 0x00000020)) {
-          itCoveredConditionsByLine_ = java.util.Collections.unmodifiableList(itCoveredConditionsByLine_);
-          bitField0_ = (bitField0_ & ~0x00000020);
+        result.utCoveredConditions_ = utCoveredConditions_;
+        if (((from_bitField0_ & 0x00000020) == 0x00000020)) {
+          to_bitField0_ |= 0x00000020;
         }
-        result.itCoveredConditionsByLine_ = itCoveredConditionsByLine_;
-        if (((bitField0_ & 0x00000040) == 0x00000040)) {
-          overallCoveredConditionsByLine_ = java.util.Collections.unmodifiableList(overallCoveredConditionsByLine_);
-          bitField0_ = (bitField0_ & ~0x00000040);
+        result.itCoveredConditions_ = itCoveredConditions_;
+        if (((from_bitField0_ & 0x00000040) == 0x00000040)) {
+          to_bitField0_ |= 0x00000040;
         }
-        result.overallCoveredConditionsByLine_ = overallCoveredConditionsByLine_;
+        result.overallCoveredConditions_ = overallCoveredConditions_;
         result.bitField0_ = to_bitField0_;
         onBuilt();
         return result;
@@ -20471,68 +20065,26 @@ public final class BatchReport {
 
       public Builder mergeFrom(org.sonar.batch.protocol.output.BatchReport.Coverage other) {
         if (other == org.sonar.batch.protocol.output.BatchReport.Coverage.getDefaultInstance()) return this;
-        if (other.hasFileRef()) {
-          setFileRef(other.getFileRef());
+        if (other.hasLine()) {
+          setLine(other.getLine());
         }
-        if (!other.conditionsByLine_.isEmpty()) {
-          if (conditionsByLine_.isEmpty()) {
-            conditionsByLine_ = other.conditionsByLine_;
-            bitField0_ = (bitField0_ & ~0x00000002);
-          } else {
-            ensureConditionsByLineIsMutable();
-            conditionsByLine_.addAll(other.conditionsByLine_);
-          }
-          onChanged();
+        if (other.hasConditions()) {
+          setConditions(other.getConditions());
         }
-        if (!other.utHitsByLine_.isEmpty()) {
-          if (utHitsByLine_.isEmpty()) {
-            utHitsByLine_ = other.utHitsByLine_;
-            bitField0_ = (bitField0_ & ~0x00000004);
-          } else {
-            ensureUtHitsByLineIsMutable();
-            utHitsByLine_.addAll(other.utHitsByLine_);
-          }
-          onChanged();
+        if (other.hasUtHits()) {
+          setUtHits(other.getUtHits());
         }
-        if (!other.itHitsByLine_.isEmpty()) {
-          if (itHitsByLine_.isEmpty()) {
-            itHitsByLine_ = other.itHitsByLine_;
-            bitField0_ = (bitField0_ & ~0x00000008);
-          } else {
-            ensureItHitsByLineIsMutable();
-            itHitsByLine_.addAll(other.itHitsByLine_);
-          }
-          onChanged();
+        if (other.hasItHits()) {
+          setItHits(other.getItHits());
         }
-        if (!other.utCoveredConditionsByLine_.isEmpty()) {
-          if (utCoveredConditionsByLine_.isEmpty()) {
-            utCoveredConditionsByLine_ = other.utCoveredConditionsByLine_;
-            bitField0_ = (bitField0_ & ~0x00000010);
-          } else {
-            ensureUtCoveredConditionsByLineIsMutable();
-            utCoveredConditionsByLine_.addAll(other.utCoveredConditionsByLine_);
-          }
-          onChanged();
+        if (other.hasUtCoveredConditions()) {
+          setUtCoveredConditions(other.getUtCoveredConditions());
         }
-        if (!other.itCoveredConditionsByLine_.isEmpty()) {
-          if (itCoveredConditionsByLine_.isEmpty()) {
-            itCoveredConditionsByLine_ = other.itCoveredConditionsByLine_;
-            bitField0_ = (bitField0_ & ~0x00000020);
-          } else {
-            ensureItCoveredConditionsByLineIsMutable();
-            itCoveredConditionsByLine_.addAll(other.itCoveredConditionsByLine_);
-          }
-          onChanged();
+        if (other.hasItCoveredConditions()) {
+          setItCoveredConditions(other.getItCoveredConditions());
         }
-        if (!other.overallCoveredConditionsByLine_.isEmpty()) {
-          if (overallCoveredConditionsByLine_.isEmpty()) {
-            overallCoveredConditionsByLine_ = other.overallCoveredConditionsByLine_;
-            bitField0_ = (bitField0_ & ~0x00000040);
-          } else {
-            ensureOverallCoveredConditionsByLineIsMutable();
-            overallCoveredConditionsByLine_.addAll(other.overallCoveredConditionsByLine_);
-          }
-          onChanged();
+        if (other.hasOverallCoveredConditions()) {
+          setOverallCoveredConditions(other.getOverallCoveredConditions());
         }
         this.mergeUnknownFields(other.getUnknownFields());
         return this;
@@ -20561,614 +20113,242 @@ public final class BatchReport {
       }
       private int bitField0_;
 
-      private int fileRef_ ;
+      private int line_ ;
       /**
-       * <code>optional int32 file_ref = 1;</code>
-       *
-       * <pre>
-       * Only FILE component has coverage information
-       * </pre>
+       * <code>optional int32 line = 1;</code>
        */
-      public boolean hasFileRef() {
+      public boolean hasLine() {
         return ((bitField0_ & 0x00000001) == 0x00000001);
       }
       /**
-       * <code>optional int32 file_ref = 1;</code>
-       *
-       * <pre>
-       * Only FILE component has coverage information
-       * </pre>
+       * <code>optional int32 line = 1;</code>
        */
-      public int getFileRef() {
-        return fileRef_;
+      public int getLine() {
+        return line_;
       }
       /**
-       * <code>optional int32 file_ref = 1;</code>
-       *
-       * <pre>
-       * Only FILE component has coverage information
-       * </pre>
+       * <code>optional int32 line = 1;</code>
        */
-      public Builder setFileRef(int value) {
+      public Builder setLine(int value) {
         bitField0_ |= 0x00000001;
-        fileRef_ = value;
+        line_ = value;
         onChanged();
         return this;
       }
       /**
-       * <code>optional int32 file_ref = 1;</code>
-       *
-       * <pre>
-       * Only FILE component has coverage information
-       * </pre>
+       * <code>optional int32 line = 1;</code>
        */
-      public Builder clearFileRef() {
+      public Builder clearLine() {
         bitField0_ = (bitField0_ & ~0x00000001);
-        fileRef_ = 0;
+        line_ = 0;
         onChanged();
         return this;
       }
 
-      private java.util.List<java.lang.Integer> conditionsByLine_ = java.util.Collections.emptyList();
-      private void ensureConditionsByLineIsMutable() {
-        if (!((bitField0_ & 0x00000002) == 0x00000002)) {
-          conditionsByLine_ = new java.util.ArrayList<java.lang.Integer>(conditionsByLine_);
-          bitField0_ |= 0x00000002;
-         }
-      }
+      private int conditions_ ;
       /**
-       * <code>repeated int32 conditions_by_line = 2 [packed = true];</code>
+       * <code>optional int32 conditions = 2;</code>
        *
        * <pre>
-       * List of number of conditions by line : 0 =&gt; not to cover, 1+ =&gt; number of conditions to cover
+       * Number of conditions to cover (never 0)
        * </pre>
        */
-      public java.util.List<java.lang.Integer>
-          getConditionsByLineList() {
-        return java.util.Collections.unmodifiableList(conditionsByLine_);
-      }
-      /**
-       * <code>repeated int32 conditions_by_line = 2 [packed = true];</code>
-       *
-       * <pre>
-       * List of number of conditions by line : 0 =&gt; not to cover, 1+ =&gt; number of conditions to cover
-       * </pre>
-       */
-      public int getConditionsByLineCount() {
-        return conditionsByLine_.size();
-      }
-      /**
-       * <code>repeated int32 conditions_by_line = 2 [packed = true];</code>
-       *
-       * <pre>
-       * List of number of conditions by line : 0 =&gt; not to cover, 1+ =&gt; number of conditions to cover
-       * </pre>
-       */
-      public int getConditionsByLine(int index) {
-        return conditionsByLine_.get(index);
-      }
-      /**
-       * <code>repeated int32 conditions_by_line = 2 [packed = true];</code>
-       *
-       * <pre>
-       * List of number of conditions by line : 0 =&gt; not to cover, 1+ =&gt; number of conditions to cover
-       * </pre>
-       */
-      public Builder setConditionsByLine(
-          int index, int value) {
-        ensureConditionsByLineIsMutable();
-        conditionsByLine_.set(index, value);
-        onChanged();
-        return this;
+      public boolean hasConditions() {
+        return ((bitField0_ & 0x00000002) == 0x00000002);
       }
       /**
-       * <code>repeated int32 conditions_by_line = 2 [packed = true];</code>
+       * <code>optional int32 conditions = 2;</code>
        *
        * <pre>
-       * List of number of conditions by line : 0 =&gt; not to cover, 1+ =&gt; number of conditions to cover
+       * Number of conditions to cover (never 0)
        * </pre>
        */
-      public Builder addConditionsByLine(int value) {
-        ensureConditionsByLineIsMutable();
-        conditionsByLine_.add(value);
-        onChanged();
-        return this;
+      public int getConditions() {
+        return conditions_;
       }
       /**
-       * <code>repeated int32 conditions_by_line = 2 [packed = true];</code>
+       * <code>optional int32 conditions = 2;</code>
        *
        * <pre>
-       * List of number of conditions by line : 0 =&gt; not to cover, 1+ =&gt; number of conditions to cover
+       * Number of conditions to cover (never 0)
        * </pre>
        */
-      public Builder addAllConditionsByLine(
-          java.lang.Iterable<? extends java.lang.Integer> values) {
-        ensureConditionsByLineIsMutable();
-        com.google.protobuf.AbstractMessageLite.Builder.addAll(
-            values, conditionsByLine_);
+      public Builder setConditions(int value) {
+        bitField0_ |= 0x00000002;
+        conditions_ = value;
         onChanged();
         return this;
       }
       /**
-       * <code>repeated int32 conditions_by_line = 2 [packed = true];</code>
+       * <code>optional int32 conditions = 2;</code>
        *
        * <pre>
-       * List of number of conditions by line : 0 =&gt; not to cover, 1+ =&gt; number of conditions to cover
+       * Number of conditions to cover (never 0)
        * </pre>
        */
-      public Builder clearConditionsByLine() {
-        conditionsByLine_ = java.util.Collections.emptyList();
+      public Builder clearConditions() {
         bitField0_ = (bitField0_ & ~0x00000002);
+        conditions_ = 0;
         onChanged();
         return this;
       }
 
-      private java.util.List<java.lang.Boolean> utHitsByLine_ = java.util.Collections.emptyList();
-      private void ensureUtHitsByLineIsMutable() {
-        if (!((bitField0_ & 0x00000004) == 0x00000004)) {
-          utHitsByLine_ = new java.util.ArrayList<java.lang.Boolean>(utHitsByLine_);
-          bitField0_ |= 0x00000004;
-         }
-      }
-      /**
-       * <code>repeated bool ut_hits_by_line = 3 [packed = true];</code>
-       *
-       * <pre>
-       * List of unit test hits by line
-       * </pre>
-       */
-      public java.util.List<java.lang.Boolean>
-          getUtHitsByLineList() {
-        return java.util.Collections.unmodifiableList(utHitsByLine_);
-      }
+      private boolean utHits_ ;
       /**
-       * <code>repeated bool ut_hits_by_line = 3 [packed = true];</code>
-       *
-       * <pre>
-       * List of unit test hits by line
-       * </pre>
+       * <code>optional bool ut_hits = 3;</code>
        */
-      public int getUtHitsByLineCount() {
-        return utHitsByLine_.size();
-      }
-      /**
-       * <code>repeated bool ut_hits_by_line = 3 [packed = true];</code>
-       *
-       * <pre>
-       * List of unit test hits by line
-       * </pre>
-       */
-      public boolean getUtHitsByLine(int index) {
-        return utHitsByLine_.get(index);
-      }
-      /**
-       * <code>repeated bool ut_hits_by_line = 3 [packed = true];</code>
-       *
-       * <pre>
-       * List of unit test hits by line
-       * </pre>
-       */
-      public Builder setUtHitsByLine(
-          int index, boolean value) {
-        ensureUtHitsByLineIsMutable();
-        utHitsByLine_.set(index, value);
-        onChanged();
-        return this;
+      public boolean hasUtHits() {
+        return ((bitField0_ & 0x00000004) == 0x00000004);
       }
       /**
-       * <code>repeated bool ut_hits_by_line = 3 [packed = true];</code>
-       *
-       * <pre>
-       * List of unit test hits by line
-       * </pre>
+       * <code>optional bool ut_hits = 3;</code>
        */
-      public Builder addUtHitsByLine(boolean value) {
-        ensureUtHitsByLineIsMutable();
-        utHitsByLine_.add(value);
-        onChanged();
-        return this;
+      public boolean getUtHits() {
+        return utHits_;
       }
       /**
-       * <code>repeated bool ut_hits_by_line = 3 [packed = true];</code>
-       *
-       * <pre>
-       * List of unit test hits by line
-       * </pre>
+       * <code>optional bool ut_hits = 3;</code>
        */
-      public Builder addAllUtHitsByLine(
-          java.lang.Iterable<? extends java.lang.Boolean> values) {
-        ensureUtHitsByLineIsMutable();
-        com.google.protobuf.AbstractMessageLite.Builder.addAll(
-            values, utHitsByLine_);
+      public Builder setUtHits(boolean value) {
+        bitField0_ |= 0x00000004;
+        utHits_ = value;
         onChanged();
         return this;
       }
       /**
-       * <code>repeated bool ut_hits_by_line = 3 [packed = true];</code>
-       *
-       * <pre>
-       * List of unit test hits by line
-       * </pre>
+       * <code>optional bool ut_hits = 3;</code>
        */
-      public Builder clearUtHitsByLine() {
-        utHitsByLine_ = java.util.Collections.emptyList();
+      public Builder clearUtHits() {
         bitField0_ = (bitField0_ & ~0x00000004);
+        utHits_ = false;
         onChanged();
         return this;
       }
 
-      private java.util.List<java.lang.Boolean> itHitsByLine_ = java.util.Collections.emptyList();
-      private void ensureItHitsByLineIsMutable() {
-        if (!((bitField0_ & 0x00000008) == 0x00000008)) {
-          itHitsByLine_ = new java.util.ArrayList<java.lang.Boolean>(itHitsByLine_);
-          bitField0_ |= 0x00000008;
-         }
-      }
-      /**
-       * <code>repeated bool it_hits_by_line = 4 [packed = true];</code>
-       *
-       * <pre>
-       * List of integration test hits by line
-       * </pre>
-       */
-      public java.util.List<java.lang.Boolean>
-          getItHitsByLineList() {
-        return java.util.Collections.unmodifiableList(itHitsByLine_);
-      }
-      /**
-       * <code>repeated bool it_hits_by_line = 4 [packed = true];</code>
-       *
-       * <pre>
-       * List of integration test hits by line
-       * </pre>
-       */
-      public int getItHitsByLineCount() {
-        return itHitsByLine_.size();
-      }
+      private boolean itHits_ ;
       /**
-       * <code>repeated bool it_hits_by_line = 4 [packed = true];</code>
-       *
-       * <pre>
-       * List of integration test hits by line
-       * </pre>
+       * <code>optional bool it_hits = 4;</code>
        */
-      public boolean getItHitsByLine(int index) {
-        return itHitsByLine_.get(index);
+      public boolean hasItHits() {
+        return ((bitField0_ & 0x00000008) == 0x00000008);
       }
       /**
-       * <code>repeated bool it_hits_by_line = 4 [packed = true];</code>
-       *
-       * <pre>
-       * List of integration test hits by line
-       * </pre>
+       * <code>optional bool it_hits = 4;</code>
        */
-      public Builder setItHitsByLine(
-          int index, boolean value) {
-        ensureItHitsByLineIsMutable();
-        itHitsByLine_.set(index, value);
-        onChanged();
-        return this;
+      public boolean getItHits() {
+        return itHits_;
       }
       /**
-       * <code>repeated bool it_hits_by_line = 4 [packed = true];</code>
-       *
-       * <pre>
-       * List of integration test hits by line
-       * </pre>
+       * <code>optional bool it_hits = 4;</code>
        */
-      public Builder addItHitsByLine(boolean value) {
-        ensureItHitsByLineIsMutable();
-        itHitsByLine_.add(value);
+      public Builder setItHits(boolean value) {
+        bitField0_ |= 0x00000008;
+        itHits_ = value;
         onChanged();
         return this;
       }
       /**
-       * <code>repeated bool it_hits_by_line = 4 [packed = true];</code>
-       *
-       * <pre>
-       * List of integration test hits by line
-       * </pre>
+       * <code>optional bool it_hits = 4;</code>
        */
-      public Builder addAllItHitsByLine(
-          java.lang.Iterable<? extends java.lang.Boolean> values) {
-        ensureItHitsByLineIsMutable();
-        com.google.protobuf.AbstractMessageLite.Builder.addAll(
-            values, itHitsByLine_);
-        onChanged();
-        return this;
-      }
-      /**
-       * <code>repeated bool it_hits_by_line = 4 [packed = true];</code>
-       *
-       * <pre>
-       * List of integration test hits by line
-       * </pre>
-       */
-      public Builder clearItHitsByLine() {
-        itHitsByLine_ = java.util.Collections.emptyList();
+      public Builder clearItHits() {
         bitField0_ = (bitField0_ & ~0x00000008);
+        itHits_ = false;
         onChanged();
         return this;
       }
 
-      private java.util.List<java.lang.Integer> utCoveredConditionsByLine_ = java.util.Collections.emptyList();
-      private void ensureUtCoveredConditionsByLineIsMutable() {
-        if (!((bitField0_ & 0x00000010) == 0x00000010)) {
-          utCoveredConditionsByLine_ = new java.util.ArrayList<java.lang.Integer>(utCoveredConditionsByLine_);
-          bitField0_ |= 0x00000010;
-         }
-      }
-      /**
-       * <code>repeated int32 ut_covered_conditions_by_line = 5 [packed = true];</code>
-       *
-       * <pre>
-       * List of number of conditions covered by unit test by line
-       * </pre>
-       */
-      public java.util.List<java.lang.Integer>
-          getUtCoveredConditionsByLineList() {
-        return java.util.Collections.unmodifiableList(utCoveredConditionsByLine_);
-      }
-      /**
-       * <code>repeated int32 ut_covered_conditions_by_line = 5 [packed = true];</code>
-       *
-       * <pre>
-       * List of number of conditions covered by unit test by line
-       * </pre>
-       */
-      public int getUtCoveredConditionsByLineCount() {
-        return utCoveredConditionsByLine_.size();
-      }
+      private int utCoveredConditions_ ;
       /**
-       * <code>repeated int32 ut_covered_conditions_by_line = 5 [packed = true];</code>
-       *
-       * <pre>
-       * List of number of conditions covered by unit test by line
-       * </pre>
-       */
-      public int getUtCoveredConditionsByLine(int index) {
-        return utCoveredConditionsByLine_.get(index);
-      }
-      /**
-       * <code>repeated int32 ut_covered_conditions_by_line = 5 [packed = true];</code>
-       *
-       * <pre>
-       * List of number of conditions covered by unit test by line
-       * </pre>
+       * <code>optional int32 ut_covered_conditions = 5;</code>
        */
-      public Builder setUtCoveredConditionsByLine(
-          int index, int value) {
-        ensureUtCoveredConditionsByLineIsMutable();
-        utCoveredConditionsByLine_.set(index, value);
-        onChanged();
-        return this;
+      public boolean hasUtCoveredConditions() {
+        return ((bitField0_ & 0x00000010) == 0x00000010);
       }
       /**
-       * <code>repeated int32 ut_covered_conditions_by_line = 5 [packed = true];</code>
-       *
-       * <pre>
-       * List of number of conditions covered by unit test by line
-       * </pre>
+       * <code>optional int32 ut_covered_conditions = 5;</code>
        */
-      public Builder addUtCoveredConditionsByLine(int value) {
-        ensureUtCoveredConditionsByLineIsMutable();
-        utCoveredConditionsByLine_.add(value);
-        onChanged();
-        return this;
+      public int getUtCoveredConditions() {
+        return utCoveredConditions_;
       }
       /**
-       * <code>repeated int32 ut_covered_conditions_by_line = 5 [packed = true];</code>
-       *
-       * <pre>
-       * List of number of conditions covered by unit test by line
-       * </pre>
+       * <code>optional int32 ut_covered_conditions = 5;</code>
        */
-      public Builder addAllUtCoveredConditionsByLine(
-          java.lang.Iterable<? extends java.lang.Integer> values) {
-        ensureUtCoveredConditionsByLineIsMutable();
-        com.google.protobuf.AbstractMessageLite.Builder.addAll(
-            values, utCoveredConditionsByLine_);
+      public Builder setUtCoveredConditions(int value) {
+        bitField0_ |= 0x00000010;
+        utCoveredConditions_ = value;
         onChanged();
         return this;
       }
       /**
-       * <code>repeated int32 ut_covered_conditions_by_line = 5 [packed = true];</code>
-       *
-       * <pre>
-       * List of number of conditions covered by unit test by line
-       * </pre>
+       * <code>optional int32 ut_covered_conditions = 5;</code>
        */
-      public Builder clearUtCoveredConditionsByLine() {
-        utCoveredConditionsByLine_ = java.util.Collections.emptyList();
+      public Builder clearUtCoveredConditions() {
         bitField0_ = (bitField0_ & ~0x00000010);
+        utCoveredConditions_ = 0;
         onChanged();
         return this;
       }
 
-      private java.util.List<java.lang.Integer> itCoveredConditionsByLine_ = java.util.Collections.emptyList();
-      private void ensureItCoveredConditionsByLineIsMutable() {
-        if (!((bitField0_ & 0x00000020) == 0x00000020)) {
-          itCoveredConditionsByLine_ = new java.util.ArrayList<java.lang.Integer>(itCoveredConditionsByLine_);
-          bitField0_ |= 0x00000020;
-         }
-      }
+      private int itCoveredConditions_ ;
       /**
-       * <code>repeated int32 it_covered_conditions_by_line = 6 [packed = true];</code>
-       *
-       * <pre>
-       * List of number of conditions covered by integration test by line
-       * </pre>
+       * <code>optional int32 it_covered_conditions = 6;</code>
        */
-      public java.util.List<java.lang.Integer>
-          getItCoveredConditionsByLineList() {
-        return java.util.Collections.unmodifiableList(itCoveredConditionsByLine_);
-      }
-      /**
-       * <code>repeated int32 it_covered_conditions_by_line = 6 [packed = true];</code>
-       *
-       * <pre>
-       * List of number of conditions covered by integration test by line
-       * </pre>
-       */
-      public int getItCoveredConditionsByLineCount() {
-        return itCoveredConditionsByLine_.size();
-      }
-      /**
-       * <code>repeated int32 it_covered_conditions_by_line = 6 [packed = true];</code>
-       *
-       * <pre>
-       * List of number of conditions covered by integration test by line
-       * </pre>
-       */
-      public int getItCoveredConditionsByLine(int index) {
-        return itCoveredConditionsByLine_.get(index);
-      }
-      /**
-       * <code>repeated int32 it_covered_conditions_by_line = 6 [packed = true];</code>
-       *
-       * <pre>
-       * List of number of conditions covered by integration test by line
-       * </pre>
-       */
-      public Builder setItCoveredConditionsByLine(
-          int index, int value) {
-        ensureItCoveredConditionsByLineIsMutable();
-        itCoveredConditionsByLine_.set(index, value);
-        onChanged();
-        return this;
+      public boolean hasItCoveredConditions() {
+        return ((bitField0_ & 0x00000020) == 0x00000020);
       }
       /**
-       * <code>repeated int32 it_covered_conditions_by_line = 6 [packed = true];</code>
-       *
-       * <pre>
-       * List of number of conditions covered by integration test by line
-       * </pre>
+       * <code>optional int32 it_covered_conditions = 6;</code>
        */
-      public Builder addItCoveredConditionsByLine(int value) {
-        ensureItCoveredConditionsByLineIsMutable();
-        itCoveredConditionsByLine_.add(value);
-        onChanged();
-        return this;
+      public int getItCoveredConditions() {
+        return itCoveredConditions_;
       }
       /**
-       * <code>repeated int32 it_covered_conditions_by_line = 6 [packed = true];</code>
-       *
-       * <pre>
-       * List of number of conditions covered by integration test by line
-       * </pre>
+       * <code>optional int32 it_covered_conditions = 6;</code>
        */
-      public Builder addAllItCoveredConditionsByLine(
-          java.lang.Iterable<? extends java.lang.Integer> values) {
-        ensureItCoveredConditionsByLineIsMutable();
-        com.google.protobuf.AbstractMessageLite.Builder.addAll(
-            values, itCoveredConditionsByLine_);
+      public Builder setItCoveredConditions(int value) {
+        bitField0_ |= 0x00000020;
+        itCoveredConditions_ = value;
         onChanged();
         return this;
       }
       /**
-       * <code>repeated int32 it_covered_conditions_by_line = 6 [packed = true];</code>
-       *
-       * <pre>
-       * List of number of conditions covered by integration test by line
-       * </pre>
+       * <code>optional int32 it_covered_conditions = 6;</code>
        */
-      public Builder clearItCoveredConditionsByLine() {
-        itCoveredConditionsByLine_ = java.util.Collections.emptyList();
+      public Builder clearItCoveredConditions() {
         bitField0_ = (bitField0_ & ~0x00000020);
+        itCoveredConditions_ = 0;
         onChanged();
         return this;
       }
 
-      private java.util.List<java.lang.Integer> overallCoveredConditionsByLine_ = java.util.Collections.emptyList();
-      private void ensureOverallCoveredConditionsByLineIsMutable() {
-        if (!((bitField0_ & 0x00000040) == 0x00000040)) {
-          overallCoveredConditionsByLine_ = new java.util.ArrayList<java.lang.Integer>(overallCoveredConditionsByLine_);
-          bitField0_ |= 0x00000040;
-         }
-      }
+      private int overallCoveredConditions_ ;
       /**
-       * <code>repeated int32 overall_covered_conditions_by_line = 7 [packed = true];</code>
-       *
-       * <pre>
-       * List of number of conditions covered by overall test by line
-       * </pre>
+       * <code>optional int32 overall_covered_conditions = 7;</code>
        */
-      public java.util.List<java.lang.Integer>
-          getOverallCoveredConditionsByLineList() {
-        return java.util.Collections.unmodifiableList(overallCoveredConditionsByLine_);
-      }
-      /**
-       * <code>repeated int32 overall_covered_conditions_by_line = 7 [packed = true];</code>
-       *
-       * <pre>
-       * List of number of conditions covered by overall test by line
-       * </pre>
-       */
-      public int getOverallCoveredConditionsByLineCount() {
-        return overallCoveredConditionsByLine_.size();
-      }
-      /**
-       * <code>repeated int32 overall_covered_conditions_by_line = 7 [packed = true];</code>
-       *
-       * <pre>
-       * List of number of conditions covered by overall test by line
-       * </pre>
-       */
-      public int getOverallCoveredConditionsByLine(int index) {
-        return overallCoveredConditionsByLine_.get(index);
-      }
-      /**
-       * <code>repeated int32 overall_covered_conditions_by_line = 7 [packed = true];</code>
-       *
-       * <pre>
-       * List of number of conditions covered by overall test by line
-       * </pre>
-       */
-      public Builder setOverallCoveredConditionsByLine(
-          int index, int value) {
-        ensureOverallCoveredConditionsByLineIsMutable();
-        overallCoveredConditionsByLine_.set(index, value);
-        onChanged();
-        return this;
+      public boolean hasOverallCoveredConditions() {
+        return ((bitField0_ & 0x00000040) == 0x00000040);
       }
       /**
-       * <code>repeated int32 overall_covered_conditions_by_line = 7 [packed = true];</code>
-       *
-       * <pre>
-       * List of number of conditions covered by overall test by line
-       * </pre>
+       * <code>optional int32 overall_covered_conditions = 7;</code>
        */
-      public Builder addOverallCoveredConditionsByLine(int value) {
-        ensureOverallCoveredConditionsByLineIsMutable();
-        overallCoveredConditionsByLine_.add(value);
-        onChanged();
-        return this;
+      public int getOverallCoveredConditions() {
+        return overallCoveredConditions_;
       }
       /**
-       * <code>repeated int32 overall_covered_conditions_by_line = 7 [packed = true];</code>
-       *
-       * <pre>
-       * List of number of conditions covered by overall test by line
-       * </pre>
+       * <code>optional int32 overall_covered_conditions = 7;</code>
        */
-      public Builder addAllOverallCoveredConditionsByLine(
-          java.lang.Iterable<? extends java.lang.Integer> values) {
-        ensureOverallCoveredConditionsByLineIsMutable();
-        com.google.protobuf.AbstractMessageLite.Builder.addAll(
-            values, overallCoveredConditionsByLine_);
+      public Builder setOverallCoveredConditions(int value) {
+        bitField0_ |= 0x00000040;
+        overallCoveredConditions_ = value;
         onChanged();
         return this;
       }
       /**
-       * <code>repeated int32 overall_covered_conditions_by_line = 7 [packed = true];</code>
-       *
-       * <pre>
-       * List of number of conditions covered by overall test by line
-       * </pre>
+       * <code>optional int32 overall_covered_conditions = 7;</code>
        */
-      public Builder clearOverallCoveredConditionsByLine() {
-        overallCoveredConditionsByLine_ = java.util.Collections.emptyList();
+      public Builder clearOverallCoveredConditions() {
         bitField0_ = (bitField0_ & ~0x00000040);
+        overallCoveredConditions_ = 0;
         onChanged();
         return this;
       }
@@ -22812,19 +21992,17 @@ public final class BatchReport {
       " \001(\005\022\022\n\nend_offset\030\004 \001(\005\"~\n\007Symbols\022\020\n\010f" +
       "ile_ref\030\001 \001(\005\022\037\n\006symbol\030\002 \003(\0132\017.Symbols." +
       "Symbol\032@\n\006Symbol\022\033\n\013declaration\030\001 \001(\0132\006.",
-      "Range\022\031\n\treference\030\002 \003(\0132\006.Range\"\374\001\n\010Cov" +
-      "erage\022\020\n\010file_ref\030\001 \001(\005\022\036\n\022conditions_by" +
-      "_line\030\002 \003(\005B\002\020\001\022\033\n\017ut_hits_by_line\030\003 \003(\010" +
-      "B\002\020\001\022\033\n\017it_hits_by_line\030\004 \003(\010B\002\020\001\022)\n\035ut_" +
-      "covered_conditions_by_line\030\005 \003(\005B\002\020\001\022)\n\035" +
-      "it_covered_conditions_by_line\030\006 \003(\005B\002\020\001\022" +
-      ".\n\"overall_covered_conditions_by_line\030\007 " +
-      "\003(\005B\002\020\001\"\263\001\n\022SyntaxHighlighting\022\020\n\010file_r" +
-      "ef\030\001 \001(\005\022?\n\021highlighting_rule\030\002 \003(\0132$.Sy" +
-      "ntaxHighlighting.HighlightingRule\032J\n\020Hig",
-      "hlightingRule\022\025\n\005range\030\001 \001(\0132\006.Range\022\037\n\004" +
-      "type\030\002 \001(\0162\021.HighlightingTypeB#\n\037org.son" +
-      "ar.batch.protocol.outputH\001"
+      "Range\022\031\n\treference\030\002 \003(\0132\006.Range\"\260\001\n\010Cov" +
+      "erage\022\014\n\004line\030\001 \001(\005\022\022\n\nconditions\030\002 \001(\005\022" +
+      "\017\n\007ut_hits\030\003 \001(\010\022\017\n\007it_hits\030\004 \001(\010\022\035\n\025ut_" +
+      "covered_conditions\030\005 \001(\005\022\035\n\025it_covered_c" +
+      "onditions\030\006 \001(\005\022\"\n\032overall_covered_condi" +
+      "tions\030\007 \001(\005\"\263\001\n\022SyntaxHighlighting\022\020\n\010fi" +
+      "le_ref\030\001 \001(\005\022?\n\021highlighting_rule\030\002 \003(\0132" +
+      "$.SyntaxHighlighting.HighlightingRule\032J\n" +
+      "\020HighlightingRule\022\025\n\005range\030\001 \001(\0132\006.Range" +
+      "\022\037\n\004type\030\002 \001(\0162\021.HighlightingTypeB#\n\037org",
+      ".sonar.batch.protocol.outputH\001"
     };
     com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
         new com.google.protobuf.Descriptors.FileDescriptor.    InternalDescriptorAssigner() {
@@ -22940,7 +22118,7 @@ public final class BatchReport {
     internal_static_Coverage_fieldAccessorTable = new
       com.google.protobuf.GeneratedMessage.FieldAccessorTable(
         internal_static_Coverage_descriptor,
-        new java.lang.String[] { "FileRef", "ConditionsByLine", "UtHitsByLine", "ItHitsByLine", "UtCoveredConditionsByLine", "ItCoveredConditionsByLine", "OverallCoveredConditionsByLine", });
+        new java.lang.String[] { "Line", "Conditions", "UtHits", "ItHits", "UtCoveredConditions", "ItCoveredConditions", "OverallCoveredConditions", });
     internal_static_SyntaxHighlighting_descriptor =
       getDescriptor().getMessageTypes().get(15);
     internal_static_SyntaxHighlighting_fieldAccessorTable = new
index 8d7d5a671d4816d02c299be91c212337965f4b32..d8c2d8f838a990e78442927f198bebd77859ef5c 100644 (file)
  */
 package org.sonar.batch.protocol;
 
+import com.google.protobuf.InvalidProtocolBufferException;
 import com.google.protobuf.Message;
 import com.google.protobuf.Parser;
 
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
+import java.io.*;
+import java.util.Iterator;
+import java.util.NoSuchElementException;
 
 public class ProtobufUtil {
   private ProtobufUtil() {
@@ -44,6 +40,55 @@ public class ProtobufUtil {
     }
   }
 
+  public static <M extends Message> Iterable<M> readFileMessages(final File file, final Parser<M> parser) {
+    return new Iterable<M>() {
+      @Override
+      public Iterator<M> iterator() {
+        try {
+          return new Iterator<M>() {
+            final InputStream inputStream = new BufferedInputStream(new FileInputStream(file));
+
+            private M currentMessage;
+
+            @Override
+            public boolean hasNext() {
+              if (currentMessage == null) {
+                try {
+                  currentMessage = parser.parseDelimitedFrom(inputStream);
+                  if (currentMessage == null) {
+                    inputStream.close();
+                  }
+                } catch (InvalidProtocolBufferException e) {
+                  throw new IllegalStateException("Failed to read input stream", e);
+                } catch (IOException e) {
+                  throw new IllegalStateException("Failed to close input stream", e);
+                }
+              }
+              return currentMessage != null;
+            }
+
+            @Override
+            public M next() {
+              if (!hasNext()) {
+                throw new NoSuchElementException();
+              }
+              M messageToReturn = currentMessage;
+              currentMessage = null;
+              return messageToReturn;
+            }
+
+            @Override
+            public void remove() {
+              throw new UnsupportedOperationException();
+            }
+          };
+        } catch (FileNotFoundException e) {
+          throw new IllegalStateException("Unable to find file " + file, e);
+        }
+      }
+    };
+  }
+
   public static void writeToFile(Message message, File toFile) {
     try (OutputStream out = new BufferedOutputStream(new FileOutputStream(toFile, false))) {
       message.writeTo(out);
@@ -51,4 +96,15 @@ public class ProtobufUtil {
       throw new IllegalStateException("Unable to write protocol buffer data to file " + toFile, e);
     }
   }
+
+  public static <MESSAGE extends Message> void writeMessagesToFile(Iterable<MESSAGE> messages, File file) {
+    try (OutputStream out = new BufferedOutputStream(new FileOutputStream(file, true))) {
+      for (MESSAGE message : messages) {
+        message.writeDelimitedTo(out);
+      }
+    } catch (IOException e) {
+      throw new IllegalStateException("Failed to read file: " + file, e);
+    }
+  }
+
 }
index 9621c208d8c40b29e372f7ba7931a8090126c34c..a35560839ce4d38aa8f549be8efc1ba0dbf06202 100644 (file)
@@ -23,6 +23,7 @@ import org.sonar.batch.protocol.ProtobufUtil;
 import org.sonar.batch.protocol.output.BatchReport.Issues;
 
 import javax.annotation.CheckForNull;
+
 import java.io.File;
 import java.util.Collections;
 import java.util.List;
@@ -119,13 +120,12 @@ public class BatchReportReader {
     return Collections.emptyList();
   }
 
-  @CheckForNull
-  public BatchReport.Coverage readFileCoverage(int fileRef) {
+  public Iterable<BatchReport.Coverage> readFileCoverage(int fileRef) {
     File file = fileStructure.fileFor(FileStructure.Domain.COVERAGE, fileRef);
     if (doesFileExists(file)) {
-      return ProtobufUtil.readFile(file, BatchReport.Coverage.PARSER);
+      return ProtobufUtil.readFileMessages(file, BatchReport.Coverage.PARSER);
     }
-    return null;
+    return Collections.emptyList();
   }
 
   private boolean doesFileExists(File file) {
index 30fa2919100a5a8714d6fcbc502d2ca765ededea..c08ed0e1156e8e5174be4a67218f3be24f453abb 100644 (file)
@@ -21,7 +21,7 @@ package org.sonar.batch.protocol.output;
 
 import org.sonar.batch.protocol.ProtobufUtil;
 
-import java.io.File;
+import java.io.*;
 
 public class BatchReportWriter {
 
@@ -113,9 +113,18 @@ public class BatchReportWriter {
     ProtobufUtil.writeToFile(builder.build(), file);
   }
 
-  public void writeFileCoverage(BatchReport.Coverage coverage) {
-    File file = fileStructure.fileFor(FileStructure.Domain.COVERAGE, coverage.getFileRef());
-    ProtobufUtil.writeToFile(coverage, file);
+  public void writeFileCoverage(int componentRef, Iterable<BatchReport.Coverage> coverageList) {
+    File file = fileStructure.fileFor(FileStructure.Domain.COVERAGE, componentRef);
+    ProtobufUtil.writeMessagesToFile(coverageList, file);
+  }
+
+  public OutputStream openCoverageOutputStream(int componentRef) {
+    File file = fileStructure.fileFor(FileStructure.Domain.COVERAGE, componentRef);
+    try {
+      return new BufferedOutputStream(new FileOutputStream(file, true));
+    } catch (FileNotFoundException e) {
+      throw new IllegalStateException("Unable to find file " + file, e);
+    }
   }
 
 }
index 39f1750400f4fc3a847c8cd21942482b0e707cd2..4f16fa760b7effec40c520454b26944a20734c7e 100644 (file)
@@ -210,22 +210,17 @@ message Symbols {
   }
 }
 
+// Only FILE component has coverage information
 message Coverage {
-  // Only FILE component has coverage information
-  optional int32 file_ref = 1;
-
-  // List of number of conditions by line : 0 => not to cover, 1+ => number of conditions to cover
-  repeated int32 conditions_by_line = 2 [packed = true];
-  // List of unit test hits by line
-  repeated bool ut_hits_by_line = 3 [packed = true];
-  // List of integration test hits by line
-  repeated bool it_hits_by_line = 4 [packed = true];
-  // List of number of conditions covered by unit test by line
-  repeated int32 ut_covered_conditions_by_line = 5 [packed = true];
-  // List of number of conditions covered by integration test by line
-  repeated int32 it_covered_conditions_by_line = 6 [packed = true];
-  // List of number of conditions covered by overall test by line
-  repeated int32 overall_covered_conditions_by_line = 7 [packed = true];
+  optional int32 line = 1;
+
+  // Number of conditions to cover (never 0)
+  optional int32 conditions = 2;
+  optional bool ut_hits = 3;
+  optional bool it_hits = 4;
+  optional int32 ut_covered_conditions = 5;
+  optional int32 it_covered_conditions = 6;
+  optional int32 overall_covered_conditions = 7;
 }
 
 message SyntaxHighlighting {
index 1f7af3de10508ad97d65e4048a7d1e01943b1b4a..817c0a6fd97837832c8e1c58df634676acaebfb4 100644 (file)
@@ -30,8 +30,10 @@ import org.sonar.batch.protocol.output.BatchReport.Range;
 
 import java.io.File;
 import java.util.Arrays;
+import java.util.List;
 
 import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.util.Lists.newArrayList;
 
 public class BatchReportReaderTest {
 
@@ -171,24 +173,47 @@ public class BatchReportReaderTest {
     writer.writeComponent(BatchReport.Component.newBuilder()
       .setRef(1).build());
 
-    writer.writeFileCoverage(BatchReport.Coverage.newBuilder()
-      .setFileRef(1)
-      .addAllConditionsByLine(Arrays.asList(1, 5))
-      .addAllUtHitsByLine(Arrays.asList(true, false))
-      .addAllItHitsByLine(Arrays.asList(false, false))
-      .addAllUtCoveredConditionsByLine(Arrays.asList(1, 4))
-      .addAllItCoveredConditionsByLine(Arrays.asList(1, 5))
-      .addAllOverallCoveredConditionsByLine(Arrays.asList(1, 5))
-      .build());
+    writer.writeFileCoverage(1, Arrays.asList(
+      BatchReport.Coverage.newBuilder()
+        .setLine(1)
+        .setConditions(1)
+        .setUtHits(true)
+        .setItHits(false)
+        .setUtCoveredConditions(1)
+        .setItCoveredConditions(1)
+        .setOverallCoveredConditions(1)
+        .build(),
+      BatchReport.Coverage.newBuilder()
+        .setLine(2)
+        .setConditions(5)
+        .setUtHits(false)
+        .setItHits(false)
+        .setUtCoveredConditions(4)
+        .setItCoveredConditions(5)
+        .setOverallCoveredConditions(5)
+        .build()));
 
     sut = new BatchReportReader(dir);
-    assertThat(sut.readFileCoverage(1).getFileRef()).isEqualTo(1);
-    assertThat(sut.readFileCoverage(1).getConditionsByLineList()).hasSize(2);
-    assertThat(sut.readFileCoverage(1).getUtHitsByLineList()).hasSize(2);
-    assertThat(sut.readFileCoverage(1).getItHitsByLineList()).hasSize(2);
-    assertThat(sut.readFileCoverage(1).getUtCoveredConditionsByLineList()).hasSize(2);
-    assertThat(sut.readFileCoverage(1).getItCoveredConditionsByLineList()).hasSize(2);
-    assertThat(sut.readFileCoverage(1).getOverallCoveredConditionsByLineList()).hasSize(2);
+    List<BatchReport.Coverage> coverageList = newArrayList(sut.readFileCoverage(1));
+    assertThat(coverageList).hasSize(2);
+
+    BatchReport.Coverage coverage = coverageList.get(0);
+    assertThat(coverage.getLine()).isEqualTo(1);
+    assertThat(coverage.getConditions()).isEqualTo(1);
+    assertThat(coverage.getUtHits()).isTrue();
+    assertThat(coverage.getItHits()).isFalse();
+    assertThat(coverage.getUtCoveredConditions()).isEqualTo(1);
+    assertThat(coverage.getItCoveredConditions()).isEqualTo(1);
+    assertThat(coverage.getOverallCoveredConditions()).isEqualTo(1);
+
+    coverage = coverageList.get(1);
+    assertThat(coverage.getLine()).isEqualTo(2);
+    assertThat(coverage.getConditions()).isEqualTo(5);
+    assertThat(coverage.getUtHits()).isFalse();
+    assertThat(coverage.getItHits()).isFalse();
+    assertThat(coverage.getUtCoveredConditions()).isEqualTo(4);
+    assertThat(coverage.getItCoveredConditions()).isEqualTo(5);
+    assertThat(coverage.getOverallCoveredConditions()).isEqualTo(5);
   }
 
   @Test(expected = IllegalStateException.class)
index d4475c1548c313a02b7ee13785c88df71b6efd70..d0bb79169baa9f531d46090ba600bbb6211a76b1 100644 (file)
@@ -27,7 +27,10 @@ import org.sonar.batch.protocol.Constants;
 import org.sonar.batch.protocol.ProtobufUtil;
 import org.sonar.batch.protocol.output.BatchReport.Range;
 
+import java.io.BufferedInputStream;
 import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
 import java.util.Arrays;
 
 import static org.assertj.core.api.Assertions.assertThat;
@@ -294,28 +297,49 @@ public class BatchReportWriterTest {
     // no data yet
     assertThat(writer.hasComponentData(FileStructure.Domain.COVERAGE, 1)).isFalse();
 
-    // write data
-    writer.writeFileCoverage(BatchReport.Coverage.newBuilder()
-      .setFileRef(1)
-      .addAllConditionsByLine(Arrays.asList(1, 5))
-      .addAllUtHitsByLine(Arrays.asList(true, false))
-      .addAllItHitsByLine(Arrays.asList(false, false))
-      .addAllUtCoveredConditionsByLine(Arrays.asList(1, 4))
-      .addAllItCoveredConditionsByLine(Arrays.asList(1, 5))
-      .addAllOverallCoveredConditionsByLine(Arrays.asList(1, 5))
-      .build());
+    writer.writeFileCoverage(1, Arrays.asList(
+      BatchReport.Coverage.newBuilder()
+        .setLine(1)
+        .setConditions(1)
+        .setUtHits(true)
+        .setItHits(false)
+        .setUtCoveredConditions(1)
+        .setItCoveredConditions(1)
+        .setOverallCoveredConditions(1)
+        .build(),
+      BatchReport.Coverage.newBuilder()
+        .setLine(2)
+        .setConditions(5)
+        .setUtHits(false)
+        .setItHits(false)
+        .setUtCoveredConditions(4)
+        .setItCoveredConditions(5)
+        .setOverallCoveredConditions(5)
+        .build()
+      ));
 
     assertThat(writer.hasComponentData(FileStructure.Domain.COVERAGE, 1)).isTrue();
 
     File file = writer.getFileStructure().fileFor(FileStructure.Domain.COVERAGE, 1);
     assertThat(file).exists().isFile();
-    BatchReport.Coverage read = ProtobufUtil.readFile(file, BatchReport.Coverage.PARSER);
-    assertThat(read.getFileRef()).isEqualTo(1);
-    assertThat(read.getConditionsByLineList()).hasSize(2);
-    assertThat(read.getUtHitsByLineList()).hasSize(2);
-    assertThat(read.getItHitsByLineList()).hasSize(2);
-    assertThat(read.getUtCoveredConditionsByLineList()).hasSize(2);
-    assertThat(read.getItCoveredConditionsByLineList()).hasSize(2);
-    assertThat(read.getOverallCoveredConditionsByLineList()).hasSize(2);
+
+    InputStream inputStream = new BufferedInputStream(new FileInputStream(file));
+    BatchReport.Coverage read = BatchReport.Coverage.PARSER.parseDelimitedFrom(inputStream);
+    assertThat(read.getLine()).isEqualTo(1);
+    assertThat(read.getConditions()).isEqualTo(1);
+    assertThat(read.getUtHits()).isTrue();
+    assertThat(read.getItHits()).isFalse();
+    assertThat(read.getUtCoveredConditions()).isEqualTo(1);
+    assertThat(read.getItCoveredConditions()).isEqualTo(1);
+    assertThat(read.getOverallCoveredConditions()).isEqualTo(1);
+
+    read = BatchReport.Coverage.PARSER.parseDelimitedFrom(inputStream);
+    assertThat(read.getLine()).isEqualTo(2);
+    assertThat(read.getConditions()).isEqualTo(5);
+    assertThat(read.getUtHits()).isFalse();
+    assertThat(read.getItHits()).isFalse();
+    assertThat(read.getUtCoveredConditions()).isEqualTo(4);
+    assertThat(read.getItCoveredConditions()).isEqualTo(5);
+    assertThat(read.getOverallCoveredConditions()).isEqualTo(5);
   }
 }