From: Teryk Bellahsene Date: Fri, 17 Apr 2015 14:17:21 +0000 (+0200) Subject: separate test and coverage details in batch protocol - SONAR-6255 X-Git-Tag: 5.2-RC1~2207 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5b0536c483d31018ec930b8a540306d36c29b243;p=sonarqube.git separate test and coverage details in batch protocol - SONAR-6255 --- diff --git a/sonar-batch-protocol/src/main/gen-java/org/sonar/batch/protocol/Constants.java b/sonar-batch-protocol/src/main/gen-java/org/sonar/batch/protocol/Constants.java index b8b01b3d317..ecae37fd9f7 100644 --- a/sonar-batch-protocol/src/main/gen-java/org/sonar/batch/protocol/Constants.java +++ b/sonar-batch-protocol/src/main/gen-java/org/sonar/batch/protocol/Constants.java @@ -767,9 +767,9 @@ public final class Constants { } /** - * Protobuf enum {@code TestResultStatus} + * Protobuf enum {@code TestStatus} */ - public enum TestResultStatus + public enum TestStatus implements com.google.protobuf.ProtocolMessageEnum { /** * OK = 1; @@ -809,7 +809,7 @@ public final class Constants { public final int getNumber() { return value; } - public static TestResultStatus valueOf(int value) { + public static TestStatus valueOf(int value) { switch (value) { case 1: return OK; case 2: return FAILURE; @@ -819,15 +819,15 @@ public final class Constants { } } - public static com.google.protobuf.Internal.EnumLiteMap + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { return internalValueMap; } - private static com.google.protobuf.Internal.EnumLiteMap + private static com.google.protobuf.Internal.EnumLiteMap internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public TestResultStatus findValueByNumber(int number) { - return TestResultStatus.valueOf(number); + new com.google.protobuf.Internal.EnumLiteMap() { + public TestStatus findValueByNumber(int number) { + return TestStatus.valueOf(number); } }; @@ -844,9 +844,9 @@ public final class Constants { return org.sonar.batch.protocol.Constants.getDescriptor().getEnumTypes().get(7); } - private static final TestResultStatus[] VALUES = values(); + private static final TestStatus[] VALUES = values(); - public static TestResultStatus valueOf( + public static TestStatus valueOf( com.google.protobuf.Descriptors.EnumValueDescriptor desc) { if (desc.getType() != getDescriptor()) { throw new java.lang.IllegalArgumentException( @@ -858,12 +858,12 @@ public final class Constants { private final int index; private final int value; - private TestResultStatus(int index, int value) { + private TestStatus(int index, int value) { this.index = index; this.value = value; } - // @@protoc_insertion_point(enum_scope:TestResultStatus) + // @@protoc_insertion_point(enum_scope:TestStatus) } @@ -889,9 +889,9 @@ public final class Constants { "OC\020\003\022\026\n\022STRUCTURED_COMMENT\020\004\022\013\n\007KEYWORD\020" + "\005\022\027\n\023HIGHLIGHTING_STRING\020\006\022\021\n\rKEYWORD_LI" + "GHT\020\007\022\030\n\024PREPROCESS_DIRECTIVE\020\010*\032\n\010TestT" + - "ype\022\006\n\002UT\020\001\022\006\n\002IT\020\002*?\n\020TestResultStatus\022" + - "\006\n\002OK\020\001\022\013\n\007FAILURE\020\002\022\t\n\005ERROR\020\003\022\013\n\007SKIPP" + - "ED\020\004B\034\n\030org.sonar.batch.protocolH\001" + "ype\022\006\n\002UT\020\001\022\006\n\002IT\020\002*9\n\nTestStatus\022\006\n\002OK\020" + + "\001\022\013\n\007FAILURE\020\002\022\t\n\005ERROR\020\003\022\013\n\007SKIPPED\020\004B\034" + + "\n\030org.sonar.batch.protocolH\001" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { diff --git a/sonar-batch-protocol/src/main/gen-java/org/sonar/batch/protocol/output/BatchReport.java b/sonar-batch-protocol/src/main/gen-java/org/sonar/batch/protocol/output/BatchReport.java index 20794177650..ae6a1498029 100644 --- a/sonar-batch-protocol/src/main/gen-java/org/sonar/batch/protocol/output/BatchReport.java +++ b/sonar-batch-protocol/src/main/gen-java/org/sonar/batch/protocol/output/BatchReport.java @@ -21081,18 +21081,23 @@ public final class BatchReport { // @@protoc_insertion_point(class_scope:SyntaxHighlighting) } - public interface TestResultOrBuilder extends - // @@protoc_insertion_point(interface_extends:TestResult) + public interface TestOrBuilder extends + // @@protoc_insertion_point(interface_extends:Test) com.google.protobuf.MessageOrBuilder { /** - * optional int32 test_file_ref = 1; + * optional string name = 1; */ - boolean hasTestFileRef(); + boolean hasName(); + /** + * optional string name = 1; + */ + java.lang.String getName(); /** - * optional int32 test_file_ref = 1; + * optional string name = 1; */ - int getTestFileRef(); + com.google.protobuf.ByteString + getNameBytes(); /** * optional .TestType type = 2; @@ -21104,13 +21109,13 @@ public final class BatchReport { org.sonar.batch.protocol.Constants.TestType getType(); /** - * optional .TestResultStatus status = 3; + * optional .TestStatus status = 3; */ boolean hasStatus(); /** - * optional .TestResultStatus status = 3; + * optional .TestStatus status = 3; */ - org.sonar.batch.protocol.Constants.TestResultStatus getStatus(); + org.sonar.batch.protocol.Constants.TestStatus getStatus(); /** * optional int64 duration_in_ms = 4; @@ -21121,78 +21126,1065 @@ public final class BatchReport { */ long getDurationInMs(); - /** - * optional string stacktrace = 5; - */ - boolean hasStacktrace(); - /** - * optional string stacktrace = 5; - */ - java.lang.String getStacktrace(); - /** - * optional string stacktrace = 5; - */ - com.google.protobuf.ByteString - getStacktraceBytes(); + /** + * optional string stacktrace = 5; + */ + boolean hasStacktrace(); + /** + * optional string stacktrace = 5; + */ + java.lang.String getStacktrace(); + /** + * optional string stacktrace = 5; + */ + com.google.protobuf.ByteString + getStacktraceBytes(); + + /** + * optional string msg = 6; + */ + boolean hasMsg(); + /** + * optional string msg = 6; + */ + java.lang.String getMsg(); + /** + * optional string msg = 6; + */ + com.google.protobuf.ByteString + getMsgBytes(); + } + /** + * Protobuf type {@code Test} + */ + public static final class Test extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:Test) + TestOrBuilder { + // Use Test.newBuilder() to construct. + private Test(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private Test(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final Test defaultInstance; + public static Test getDefaultInstance() { + return defaultInstance; + } + + public Test getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Test( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000001; + name_ = bs; + break; + } + case 16: { + int rawValue = input.readEnum(); + org.sonar.batch.protocol.Constants.TestType value = org.sonar.batch.protocol.Constants.TestType.valueOf(rawValue); + if (value == null) { + unknownFields.mergeVarintField(2, rawValue); + } else { + bitField0_ |= 0x00000002; + type_ = value; + } + break; + } + case 24: { + int rawValue = input.readEnum(); + org.sonar.batch.protocol.Constants.TestStatus value = org.sonar.batch.protocol.Constants.TestStatus.valueOf(rawValue); + if (value == null) { + unknownFields.mergeVarintField(3, rawValue); + } else { + bitField0_ |= 0x00000004; + status_ = value; + } + break; + } + case 32: { + bitField0_ |= 0x00000008; + durationInMs_ = input.readInt64(); + break; + } + case 42: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000010; + stacktrace_ = bs; + break; + } + case 50: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000020; + msg_ = bs; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.sonar.batch.protocol.output.BatchReport.internal_static_Test_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.sonar.batch.protocol.output.BatchReport.internal_static_Test_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.sonar.batch.protocol.output.BatchReport.Test.class, org.sonar.batch.protocol.output.BatchReport.Test.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public Test parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Test(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + private java.lang.Object name_; + /** + * optional string name = 1; + */ + public boolean hasName() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + name_ = s; + } + return s; + } + } + /** + * optional string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TYPE_FIELD_NUMBER = 2; + private org.sonar.batch.protocol.Constants.TestType type_; + /** + * optional .TestType type = 2; + */ + public boolean hasType() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional .TestType type = 2; + */ + public org.sonar.batch.protocol.Constants.TestType getType() { + return type_; + } + + public static final int STATUS_FIELD_NUMBER = 3; + private org.sonar.batch.protocol.Constants.TestStatus status_; + /** + * optional .TestStatus status = 3; + */ + public boolean hasStatus() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional .TestStatus status = 3; + */ + public org.sonar.batch.protocol.Constants.TestStatus getStatus() { + return status_; + } + + public static final int DURATION_IN_MS_FIELD_NUMBER = 4; + private long durationInMs_; + /** + * optional int64 duration_in_ms = 4; + */ + public boolean hasDurationInMs() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional int64 duration_in_ms = 4; + */ + public long getDurationInMs() { + return durationInMs_; + } + + public static final int STACKTRACE_FIELD_NUMBER = 5; + private java.lang.Object stacktrace_; + /** + * optional string stacktrace = 5; + */ + public boolean hasStacktrace() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional string stacktrace = 5; + */ + public java.lang.String getStacktrace() { + java.lang.Object ref = stacktrace_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + stacktrace_ = s; + } + return s; + } + } + /** + * optional string stacktrace = 5; + */ + public com.google.protobuf.ByteString + getStacktraceBytes() { + java.lang.Object ref = stacktrace_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + stacktrace_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MSG_FIELD_NUMBER = 6; + private java.lang.Object msg_; + /** + * optional string msg = 6; + */ + public boolean hasMsg() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * optional string msg = 6; + */ + public java.lang.String getMsg() { + java.lang.Object ref = msg_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + msg_ = s; + } + return s; + } + } + /** + * optional string msg = 6; + */ + public com.google.protobuf.ByteString + getMsgBytes() { + java.lang.Object ref = msg_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + msg_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private void initFields() { + name_ = ""; + type_ = org.sonar.batch.protocol.Constants.TestType.UT; + status_ = org.sonar.batch.protocol.Constants.TestStatus.OK; + durationInMs_ = 0L; + stacktrace_ = ""; + msg_ = ""; + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBytes(1, getNameBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeEnum(2, type_.getNumber()); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeEnum(3, status_.getNumber()); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeInt64(4, durationInMs_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeBytes(5, getStacktraceBytes()); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + output.writeBytes(6, getMsgBytes()); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(1, getNameBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(2, type_.getNumber()); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(3, status_.getNumber()); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(4, durationInMs_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(5, getStacktraceBytes()); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(6, getMsgBytes()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static org.sonar.batch.protocol.output.BatchReport.Test parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.sonar.batch.protocol.output.BatchReport.Test parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.sonar.batch.protocol.output.BatchReport.Test parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.sonar.batch.protocol.output.BatchReport.Test parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.sonar.batch.protocol.output.BatchReport.Test parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.sonar.batch.protocol.output.BatchReport.Test parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.sonar.batch.protocol.output.BatchReport.Test parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.sonar.batch.protocol.output.BatchReport.Test parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.sonar.batch.protocol.output.BatchReport.Test parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.sonar.batch.protocol.output.BatchReport.Test parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.sonar.batch.protocol.output.BatchReport.Test prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code Test} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:Test) + org.sonar.batch.protocol.output.BatchReport.TestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.sonar.batch.protocol.output.BatchReport.internal_static_Test_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.sonar.batch.protocol.output.BatchReport.internal_static_Test_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.sonar.batch.protocol.output.BatchReport.Test.class, org.sonar.batch.protocol.output.BatchReport.Test.Builder.class); + } + + // Construct using org.sonar.batch.protocol.output.BatchReport.Test.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + name_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + type_ = org.sonar.batch.protocol.Constants.TestType.UT; + bitField0_ = (bitField0_ & ~0x00000002); + status_ = org.sonar.batch.protocol.Constants.TestStatus.OK; + bitField0_ = (bitField0_ & ~0x00000004); + durationInMs_ = 0L; + bitField0_ = (bitField0_ & ~0x00000008); + stacktrace_ = ""; + bitField0_ = (bitField0_ & ~0x00000010); + msg_ = ""; + bitField0_ = (bitField0_ & ~0x00000020); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.sonar.batch.protocol.output.BatchReport.internal_static_Test_descriptor; + } + + public org.sonar.batch.protocol.output.BatchReport.Test getDefaultInstanceForType() { + return org.sonar.batch.protocol.output.BatchReport.Test.getDefaultInstance(); + } + + public org.sonar.batch.protocol.output.BatchReport.Test build() { + org.sonar.batch.protocol.output.BatchReport.Test result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.sonar.batch.protocol.output.BatchReport.Test buildPartial() { + org.sonar.batch.protocol.output.BatchReport.Test result = new org.sonar.batch.protocol.output.BatchReport.Test(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.name_ = name_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.type_ = type_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.status_ = status_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.durationInMs_ = durationInMs_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000010; + } + result.stacktrace_ = stacktrace_; + if (((from_bitField0_ & 0x00000020) == 0x00000020)) { + to_bitField0_ |= 0x00000020; + } + result.msg_ = msg_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.sonar.batch.protocol.output.BatchReport.Test) { + return mergeFrom((org.sonar.batch.protocol.output.BatchReport.Test)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.sonar.batch.protocol.output.BatchReport.Test other) { + if (other == org.sonar.batch.protocol.output.BatchReport.Test.getDefaultInstance()) return this; + if (other.hasName()) { + bitField0_ |= 0x00000001; + name_ = other.name_; + onChanged(); + } + if (other.hasType()) { + setType(other.getType()); + } + if (other.hasStatus()) { + setStatus(other.getStatus()); + } + if (other.hasDurationInMs()) { + setDurationInMs(other.getDurationInMs()); + } + if (other.hasStacktrace()) { + bitField0_ |= 0x00000010; + stacktrace_ = other.stacktrace_; + onChanged(); + } + if (other.hasMsg()) { + bitField0_ |= 0x00000020; + msg_ = other.msg_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.sonar.batch.protocol.output.BatchReport.Test parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.sonar.batch.protocol.output.BatchReport.Test) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * optional string name = 1; + */ + public boolean hasName() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + name_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + name_ = value; + onChanged(); + return this; + } + /** + * optional string name = 1; + */ + public Builder clearName() { + bitField0_ = (bitField0_ & ~0x00000001); + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * optional string name = 1; + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + name_ = value; + onChanged(); + return this; + } + + private org.sonar.batch.protocol.Constants.TestType type_ = org.sonar.batch.protocol.Constants.TestType.UT; + /** + * optional .TestType type = 2; + */ + public boolean hasType() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional .TestType type = 2; + */ + public org.sonar.batch.protocol.Constants.TestType getType() { + return type_; + } + /** + * optional .TestType type = 2; + */ + public Builder setType(org.sonar.batch.protocol.Constants.TestType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + type_ = value; + onChanged(); + return this; + } + /** + * optional .TestType type = 2; + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000002); + type_ = org.sonar.batch.protocol.Constants.TestType.UT; + onChanged(); + return this; + } + + private org.sonar.batch.protocol.Constants.TestStatus status_ = org.sonar.batch.protocol.Constants.TestStatus.OK; + /** + * optional .TestStatus status = 3; + */ + public boolean hasStatus() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional .TestStatus status = 3; + */ + public org.sonar.batch.protocol.Constants.TestStatus getStatus() { + return status_; + } + /** + * optional .TestStatus status = 3; + */ + public Builder setStatus(org.sonar.batch.protocol.Constants.TestStatus value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + status_ = value; + onChanged(); + return this; + } + /** + * optional .TestStatus status = 3; + */ + public Builder clearStatus() { + bitField0_ = (bitField0_ & ~0x00000004); + status_ = org.sonar.batch.protocol.Constants.TestStatus.OK; + onChanged(); + return this; + } + + private long durationInMs_ ; + /** + * optional int64 duration_in_ms = 4; + */ + public boolean hasDurationInMs() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional int64 duration_in_ms = 4; + */ + public long getDurationInMs() { + return durationInMs_; + } + /** + * optional int64 duration_in_ms = 4; + */ + public Builder setDurationInMs(long value) { + bitField0_ |= 0x00000008; + durationInMs_ = value; + onChanged(); + return this; + } + /** + * optional int64 duration_in_ms = 4; + */ + public Builder clearDurationInMs() { + bitField0_ = (bitField0_ & ~0x00000008); + durationInMs_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object stacktrace_ = ""; + /** + * optional string stacktrace = 5; + */ + public boolean hasStacktrace() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional string stacktrace = 5; + */ + public java.lang.String getStacktrace() { + java.lang.Object ref = stacktrace_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + stacktrace_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string stacktrace = 5; + */ + public com.google.protobuf.ByteString + getStacktraceBytes() { + java.lang.Object ref = stacktrace_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + stacktrace_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string stacktrace = 5; + */ + public Builder setStacktrace( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + stacktrace_ = value; + onChanged(); + return this; + } + /** + * optional string stacktrace = 5; + */ + public Builder clearStacktrace() { + bitField0_ = (bitField0_ & ~0x00000010); + stacktrace_ = getDefaultInstance().getStacktrace(); + onChanged(); + return this; + } + /** + * optional string stacktrace = 5; + */ + public Builder setStacktraceBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + stacktrace_ = value; + onChanged(); + return this; + } + + private java.lang.Object msg_ = ""; + /** + * optional string msg = 6; + */ + public boolean hasMsg() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * optional string msg = 6; + */ + public java.lang.String getMsg() { + java.lang.Object ref = msg_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + msg_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string msg = 6; + */ + public com.google.protobuf.ByteString + getMsgBytes() { + java.lang.Object ref = msg_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + msg_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string msg = 6; + */ + public Builder setMsg( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + msg_ = value; + onChanged(); + return this; + } + /** + * optional string msg = 6; + */ + public Builder clearMsg() { + bitField0_ = (bitField0_ & ~0x00000020); + msg_ = getDefaultInstance().getMsg(); + onChanged(); + return this; + } + /** + * optional string msg = 6; + */ + public Builder setMsgBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + msg_ = value; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:Test) + } + + static { + defaultInstance = new Test(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:Test) + } + + public interface CoverageDetailOrBuilder extends + // @@protoc_insertion_point(interface_extends:CoverageDetail) + com.google.protobuf.MessageOrBuilder { /** - * optional string msg = 6; + * optional string test_name = 1; */ - boolean hasMsg(); + boolean hasTestName(); /** - * optional string msg = 6; + * optional string test_name = 1; */ - java.lang.String getMsg(); + java.lang.String getTestName(); /** - * optional string msg = 6; + * optional string test_name = 1; */ com.google.protobuf.ByteString - getMsgBytes(); + getTestNameBytes(); /** - * repeated .TestResult.CoverageBlock coverage_block = 7; + * repeated .CoverageDetail.CoveredFile covered_file = 2; */ - java.util.List - getCoverageBlockList(); + java.util.List + getCoveredFileList(); /** - * repeated .TestResult.CoverageBlock coverage_block = 7; + * repeated .CoverageDetail.CoveredFile covered_file = 2; */ - org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock getCoverageBlock(int index); + org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile getCoveredFile(int index); /** - * repeated .TestResult.CoverageBlock coverage_block = 7; + * repeated .CoverageDetail.CoveredFile covered_file = 2; */ - int getCoverageBlockCount(); + int getCoveredFileCount(); /** - * repeated .TestResult.CoverageBlock coverage_block = 7; + * repeated .CoverageDetail.CoveredFile covered_file = 2; */ - java.util.List - getCoverageBlockOrBuilderList(); + java.util.List + getCoveredFileOrBuilderList(); /** - * repeated .TestResult.CoverageBlock coverage_block = 7; + * repeated .CoverageDetail.CoveredFile covered_file = 2; */ - org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlockOrBuilder getCoverageBlockOrBuilder( + org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFileOrBuilder getCoveredFileOrBuilder( int index); } /** - * Protobuf type {@code TestResult} + * Protobuf type {@code CoverageDetail} */ - public static final class TestResult extends + public static final class CoverageDetail extends com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:TestResult) - TestResultOrBuilder { - // Use TestResult.newBuilder() to construct. - private TestResult(com.google.protobuf.GeneratedMessage.Builder builder) { + // @@protoc_insertion_point(message_implements:CoverageDetail) + CoverageDetailOrBuilder { + // Use CoverageDetail.newBuilder() to construct. + private CoverageDetail(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); this.unknownFields = builder.getUnknownFields(); } - private TestResult(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + private CoverageDetail(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } - private static final TestResult defaultInstance; - public static TestResult getDefaultInstance() { + private static final CoverageDetail defaultInstance; + public static CoverageDetail getDefaultInstance() { return defaultInstance; } - public TestResult getDefaultInstanceForType() { + public CoverageDetail getDefaultInstanceForType() { return defaultInstance; } @@ -21202,7 +22194,7 @@ public final class BatchReport { getUnknownFields() { return this.unknownFields; } - private TestResult( + private CoverageDetail( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -21225,56 +22217,18 @@ public final class BatchReport { } break; } - case 8: { - bitField0_ |= 0x00000001; - testFileRef_ = input.readInt32(); - break; - } - case 16: { - int rawValue = input.readEnum(); - org.sonar.batch.protocol.Constants.TestType value = org.sonar.batch.protocol.Constants.TestType.valueOf(rawValue); - if (value == null) { - unknownFields.mergeVarintField(2, rawValue); - } else { - bitField0_ |= 0x00000002; - type_ = value; - } - break; - } - case 24: { - int rawValue = input.readEnum(); - org.sonar.batch.protocol.Constants.TestResultStatus value = org.sonar.batch.protocol.Constants.TestResultStatus.valueOf(rawValue); - if (value == null) { - unknownFields.mergeVarintField(3, rawValue); - } else { - bitField0_ |= 0x00000004; - status_ = value; - } - break; - } - case 32: { - bitField0_ |= 0x00000008; - durationInMs_ = input.readInt64(); - break; - } - case 42: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000010; - stacktrace_ = bs; - break; - } - case 50: { + case 10: { com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000020; - msg_ = bs; + bitField0_ |= 0x00000001; + testName_ = bs; break; } - case 58: { - if (!((mutable_bitField0_ & 0x00000040) == 0x00000040)) { - coverageBlock_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000040; + case 18: { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + coveredFile_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; } - coverageBlock_.add(input.readMessage(org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock.PARSER, extensionRegistry)); + coveredFile_.add(input.readMessage(org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile.PARSER, extensionRegistry)); break; } } @@ -21285,8 +22239,8 @@ public final class BatchReport { throw new com.google.protobuf.InvalidProtocolBufferException( e.getMessage()).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000040) == 0x00000040)) { - coverageBlock_ = java.util.Collections.unmodifiableList(coverageBlock_); + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + coveredFile_ = java.util.Collections.unmodifiableList(coveredFile_); } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); @@ -21294,33 +22248,33 @@ public final class BatchReport { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return org.sonar.batch.protocol.output.BatchReport.internal_static_TestResult_descriptor; + return org.sonar.batch.protocol.output.BatchReport.internal_static_CoverageDetail_descriptor; } protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return org.sonar.batch.protocol.output.BatchReport.internal_static_TestResult_fieldAccessorTable + return org.sonar.batch.protocol.output.BatchReport.internal_static_CoverageDetail_fieldAccessorTable .ensureFieldAccessorsInitialized( - org.sonar.batch.protocol.output.BatchReport.TestResult.class, org.sonar.batch.protocol.output.BatchReport.TestResult.Builder.class); + org.sonar.batch.protocol.output.BatchReport.CoverageDetail.class, org.sonar.batch.protocol.output.BatchReport.CoverageDetail.Builder.class); } - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public TestResult parsePartialFrom( + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public CoverageDetail parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new TestResult(input, extensionRegistry); + return new CoverageDetail(input, extensionRegistry); } }; @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } - public interface CoverageBlockOrBuilder extends - // @@protoc_insertion_point(interface_extends:TestResult.CoverageBlock) + public interface CoveredFileOrBuilder extends + // @@protoc_insertion_point(interface_extends:CoverageDetail.CoveredFile) com.google.protobuf.MessageOrBuilder { /** @@ -21333,38 +22287,38 @@ public final class BatchReport { int getFileRef(); /** - * repeated int32 line = 2; + * repeated int32 covered_line = 2 [packed = true]; */ - java.util.List getLineList(); + java.util.List getCoveredLineList(); /** - * repeated int32 line = 2; + * repeated int32 covered_line = 2 [packed = true]; */ - int getLineCount(); + int getCoveredLineCount(); /** - * repeated int32 line = 2; + * repeated int32 covered_line = 2 [packed = true]; */ - int getLine(int index); + int getCoveredLine(int index); } /** - * Protobuf type {@code TestResult.CoverageBlock} + * Protobuf type {@code CoverageDetail.CoveredFile} */ - public static final class CoverageBlock extends + public static final class CoveredFile extends com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:TestResult.CoverageBlock) - CoverageBlockOrBuilder { - // Use CoverageBlock.newBuilder() to construct. - private CoverageBlock(com.google.protobuf.GeneratedMessage.Builder builder) { + // @@protoc_insertion_point(message_implements:CoverageDetail.CoveredFile) + CoveredFileOrBuilder { + // Use CoveredFile.newBuilder() to construct. + private CoveredFile(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); this.unknownFields = builder.getUnknownFields(); } - private CoverageBlock(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + private CoveredFile(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } - private static final CoverageBlock defaultInstance; - public static CoverageBlock getDefaultInstance() { + private static final CoveredFile defaultInstance; + public static CoveredFile getDefaultInstance() { return defaultInstance; } - public CoverageBlock getDefaultInstanceForType() { + public CoveredFile getDefaultInstanceForType() { return defaultInstance; } @@ -21374,7 +22328,7 @@ public final class BatchReport { getUnknownFields() { return this.unknownFields; } - private CoverageBlock( + private CoveredFile( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -21404,21 +22358,21 @@ public final class BatchReport { } case 16: { if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - line_ = new java.util.ArrayList(); + coveredLine_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000002; } - line_.add(input.readInt32()); + coveredLine_.add(input.readInt32()); break; } case 18: { int length = input.readRawVarint32(); int limit = input.pushLimit(length); if (!((mutable_bitField0_ & 0x00000002) == 0x00000002) && input.getBytesUntilLimit() > 0) { - line_ = new java.util.ArrayList(); + coveredLine_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000002; } while (input.getBytesUntilLimit() > 0) { - line_.add(input.readInt32()); + coveredLine_.add(input.readInt32()); } input.popLimit(limit); break; @@ -21432,7 +22386,7 @@ public final class BatchReport { e.getMessage()).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - line_ = java.util.Collections.unmodifiableList(line_); + coveredLine_ = java.util.Collections.unmodifiableList(coveredLine_); } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); @@ -21440,28 +22394,28 @@ public final class BatchReport { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return org.sonar.batch.protocol.output.BatchReport.internal_static_TestResult_CoverageBlock_descriptor; + return org.sonar.batch.protocol.output.BatchReport.internal_static_CoverageDetail_CoveredFile_descriptor; } protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return org.sonar.batch.protocol.output.BatchReport.internal_static_TestResult_CoverageBlock_fieldAccessorTable + return org.sonar.batch.protocol.output.BatchReport.internal_static_CoverageDetail_CoveredFile_fieldAccessorTable .ensureFieldAccessorsInitialized( - org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock.class, org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock.Builder.class); + org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile.class, org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile.Builder.class); } - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public CoverageBlock parsePartialFrom( + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public CoveredFile parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new CoverageBlock(input, extensionRegistry); + return new CoveredFile(input, extensionRegistry); } }; @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @@ -21481,31 +22435,32 @@ public final class BatchReport { return fileRef_; } - public static final int LINE_FIELD_NUMBER = 2; - private java.util.List line_; + public static final int COVERED_LINE_FIELD_NUMBER = 2; + private java.util.List coveredLine_; /** - * repeated int32 line = 2; + * repeated int32 covered_line = 2 [packed = true]; */ public java.util.List - getLineList() { - return line_; + getCoveredLineList() { + return coveredLine_; } /** - * repeated int32 line = 2; + * repeated int32 covered_line = 2 [packed = true]; */ - public int getLineCount() { - return line_.size(); + public int getCoveredLineCount() { + return coveredLine_.size(); } /** - * repeated int32 line = 2; + * repeated int32 covered_line = 2 [packed = true]; */ - public int getLine(int index) { - return line_.get(index); + public int getCoveredLine(int index) { + return coveredLine_.get(index); } + private int coveredLineMemoizedSerializedSize = -1; private void initFields() { fileRef_ = 0; - line_ = java.util.Collections.emptyList(); + coveredLine_ = java.util.Collections.emptyList(); } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { @@ -21523,8 +22478,12 @@ public final class BatchReport { if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeInt32(1, fileRef_); } - for (int i = 0; i < line_.size(); i++) { - output.writeInt32(2, line_.get(i)); + if (getCoveredLineList().size() > 0) { + output.writeRawVarint32(18); + output.writeRawVarint32(coveredLineMemoizedSerializedSize); + } + for (int i = 0; i < coveredLine_.size(); i++) { + output.writeInt32NoTag(coveredLine_.get(i)); } getUnknownFields().writeTo(output); } @@ -21541,12 +22500,17 @@ public final class BatchReport { } { int dataSize = 0; - for (int i = 0; i < line_.size(); i++) { + for (int i = 0; i < coveredLine_.size(); i++) { dataSize += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(line_.get(i)); + .computeInt32SizeNoTag(coveredLine_.get(i)); } size += dataSize; - size += 1 * getLineList().size(); + if (!getCoveredLineList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + coveredLineMemoizedSerializedSize = dataSize; } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; @@ -21560,53 +22524,53 @@ public final class BatchReport { return super.writeReplace(); } - public static org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock parseFrom( + public static org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock parseFrom( + public static org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock parseFrom(byte[] data) + public static org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock parseFrom( + public static org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock parseFrom(java.io.InputStream input) + public static org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile parseFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock parseFrom( + public static org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } - public static org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock parseDelimitedFrom(java.io.InputStream input) + public static org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseDelimitedFrom(input); } - public static org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock parseDelimitedFrom( + public static org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseDelimitedFrom(input, extensionRegistry); } - public static org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock parseFrom( + public static org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock parseFrom( + public static org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -21615,7 +22579,7 @@ public final class BatchReport { public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock prototype) { + public static Builder newBuilder(org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } @@ -21627,25 +22591,25 @@ public final class BatchReport { return builder; } /** - * Protobuf type {@code TestResult.CoverageBlock} + * Protobuf type {@code CoverageDetail.CoveredFile} */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:TestResult.CoverageBlock) - org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlockOrBuilder { + // @@protoc_insertion_point(builder_implements:CoverageDetail.CoveredFile) + org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFileOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return org.sonar.batch.protocol.output.BatchReport.internal_static_TestResult_CoverageBlock_descriptor; + return org.sonar.batch.protocol.output.BatchReport.internal_static_CoverageDetail_CoveredFile_descriptor; } protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return org.sonar.batch.protocol.output.BatchReport.internal_static_TestResult_CoverageBlock_fieldAccessorTable + return org.sonar.batch.protocol.output.BatchReport.internal_static_CoverageDetail_CoveredFile_fieldAccessorTable .ensureFieldAccessorsInitialized( - org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock.class, org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock.Builder.class); + org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile.class, org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile.Builder.class); } - // Construct using org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock.newBuilder() + // Construct using org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -21667,7 +22631,7 @@ public final class BatchReport { super.clear(); fileRef_ = 0; bitField0_ = (bitField0_ & ~0x00000001); - line_ = java.util.Collections.emptyList(); + coveredLine_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000002); return this; } @@ -21678,23 +22642,23 @@ public final class BatchReport { public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return org.sonar.batch.protocol.output.BatchReport.internal_static_TestResult_CoverageBlock_descriptor; + return org.sonar.batch.protocol.output.BatchReport.internal_static_CoverageDetail_CoveredFile_descriptor; } - public org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock getDefaultInstanceForType() { - return org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock.getDefaultInstance(); + public org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile getDefaultInstanceForType() { + return org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile.getDefaultInstance(); } - public org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock build() { - org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock result = buildPartial(); + public org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile build() { + org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock buildPartial() { - org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock result = new org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock(this); + public org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile buildPartial() { + org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile result = new org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { @@ -21702,36 +22666,36 @@ public final class BatchReport { } result.fileRef_ = fileRef_; if (((bitField0_ & 0x00000002) == 0x00000002)) { - line_ = java.util.Collections.unmodifiableList(line_); + coveredLine_ = java.util.Collections.unmodifiableList(coveredLine_); bitField0_ = (bitField0_ & ~0x00000002); } - result.line_ = line_; + result.coveredLine_ = coveredLine_; result.bitField0_ = to_bitField0_; onBuilt(); return result; } public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock) { - return mergeFrom((org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock)other); + if (other instanceof org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile) { + return mergeFrom((org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock other) { - if (other == org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock.getDefaultInstance()) return this; + public Builder mergeFrom(org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile other) { + if (other == org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile.getDefaultInstance()) return this; if (other.hasFileRef()) { setFileRef(other.getFileRef()); } - if (!other.line_.isEmpty()) { - if (line_.isEmpty()) { - line_ = other.line_; + if (!other.coveredLine_.isEmpty()) { + if (coveredLine_.isEmpty()) { + coveredLine_ = other.coveredLine_; bitField0_ = (bitField0_ & ~0x00000002); } else { - ensureLineIsMutable(); - line_.addAll(other.line_); + ensureCoveredLineIsMutable(); + coveredLine_.addAll(other.coveredLine_); } onChanged(); } @@ -21747,11 +22711,11 @@ public final class BatchReport { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock parsedMessage = null; + org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock) e.getUnfinishedMessage(); + parsedMessage = (org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { @@ -21794,199 +22758,97 @@ public final class BatchReport { return this; } - private java.util.List line_ = java.util.Collections.emptyList(); - private void ensureLineIsMutable() { + private java.util.List coveredLine_ = java.util.Collections.emptyList(); + private void ensureCoveredLineIsMutable() { if (!((bitField0_ & 0x00000002) == 0x00000002)) { - line_ = new java.util.ArrayList(line_); + coveredLine_ = new java.util.ArrayList(coveredLine_); bitField0_ |= 0x00000002; } } /** - * repeated int32 line = 2; + * repeated int32 covered_line = 2 [packed = true]; */ public java.util.List - getLineList() { - return java.util.Collections.unmodifiableList(line_); + getCoveredLineList() { + return java.util.Collections.unmodifiableList(coveredLine_); } /** - * repeated int32 line = 2; + * repeated int32 covered_line = 2 [packed = true]; */ - public int getLineCount() { - return line_.size(); + public int getCoveredLineCount() { + return coveredLine_.size(); } /** - * repeated int32 line = 2; + * repeated int32 covered_line = 2 [packed = true]; */ - public int getLine(int index) { - return line_.get(index); + public int getCoveredLine(int index) { + return coveredLine_.get(index); } /** - * repeated int32 line = 2; + * repeated int32 covered_line = 2 [packed = true]; */ - public Builder setLine( + public Builder setCoveredLine( int index, int value) { - ensureLineIsMutable(); - line_.set(index, value); + ensureCoveredLineIsMutable(); + coveredLine_.set(index, value); onChanged(); return this; } /** - * repeated int32 line = 2; + * repeated int32 covered_line = 2 [packed = true]; */ - public Builder addLine(int value) { - ensureLineIsMutable(); - line_.add(value); + public Builder addCoveredLine(int value) { + ensureCoveredLineIsMutable(); + coveredLine_.add(value); onChanged(); return this; } /** - * repeated int32 line = 2; + * repeated int32 covered_line = 2 [packed = true]; */ - public Builder addAllLine( + public Builder addAllCoveredLine( java.lang.Iterable values) { - ensureLineIsMutable(); + ensureCoveredLineIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, line_); + values, coveredLine_); onChanged(); return this; } /** - * repeated int32 line = 2; + * repeated int32 covered_line = 2 [packed = true]; */ - public Builder clearLine() { - line_ = java.util.Collections.emptyList(); + public Builder clearCoveredLine() { + coveredLine_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } - // @@protoc_insertion_point(builder_scope:TestResult.CoverageBlock) + // @@protoc_insertion_point(builder_scope:CoverageDetail.CoveredFile) } static { - defaultInstance = new CoverageBlock(true); + defaultInstance = new CoveredFile(true); defaultInstance.initFields(); } - // @@protoc_insertion_point(class_scope:TestResult.CoverageBlock) + // @@protoc_insertion_point(class_scope:CoverageDetail.CoveredFile) } private int bitField0_; - public static final int TEST_FILE_REF_FIELD_NUMBER = 1; - private int testFileRef_; + public static final int TEST_NAME_FIELD_NUMBER = 1; + private java.lang.Object testName_; /** - * optional int32 test_file_ref = 1; + * optional string test_name = 1; */ - public boolean hasTestFileRef() { + public boolean hasTestName() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** - * optional int32 test_file_ref = 1; - */ - public int getTestFileRef() { - return testFileRef_; - } - - public static final int TYPE_FIELD_NUMBER = 2; - private org.sonar.batch.protocol.Constants.TestType type_; - /** - * optional .TestType type = 2; - */ - public boolean hasType() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional .TestType type = 2; - */ - public org.sonar.batch.protocol.Constants.TestType getType() { - return type_; - } - - public static final int STATUS_FIELD_NUMBER = 3; - private org.sonar.batch.protocol.Constants.TestResultStatus status_; - /** - * optional .TestResultStatus status = 3; - */ - public boolean hasStatus() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional .TestResultStatus status = 3; - */ - public org.sonar.batch.protocol.Constants.TestResultStatus getStatus() { - return status_; - } - - public static final int DURATION_IN_MS_FIELD_NUMBER = 4; - private long durationInMs_; - /** - * optional int64 duration_in_ms = 4; - */ - public boolean hasDurationInMs() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - * optional int64 duration_in_ms = 4; - */ - public long getDurationInMs() { - return durationInMs_; - } - - public static final int STACKTRACE_FIELD_NUMBER = 5; - private java.lang.Object stacktrace_; - /** - * optional string stacktrace = 5; - */ - public boolean hasStacktrace() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - * optional string stacktrace = 5; - */ - public java.lang.String getStacktrace() { - java.lang.Object ref = stacktrace_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - stacktrace_ = s; - } - return s; - } - } - /** - * optional string stacktrace = 5; - */ - public com.google.protobuf.ByteString - getStacktraceBytes() { - java.lang.Object ref = stacktrace_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - stacktrace_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int MSG_FIELD_NUMBER = 6; - private java.lang.Object msg_; - /** - * optional string msg = 6; - */ - public boolean hasMsg() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - /** - * optional string msg = 6; + * optional string test_name = 1; */ - public java.lang.String getMsg() { - java.lang.Object ref = msg_; + public java.lang.String getTestName() { + java.lang.Object ref = testName_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { @@ -21994,71 +22856,66 @@ public final class BatchReport { (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { - msg_ = s; + testName_ = s; } return s; } } /** - * optional string msg = 6; + * optional string test_name = 1; */ public com.google.protobuf.ByteString - getMsgBytes() { - java.lang.Object ref = msg_; + getTestNameBytes() { + java.lang.Object ref = testName_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); - msg_ = b; + testName_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } - public static final int COVERAGE_BLOCK_FIELD_NUMBER = 7; - private java.util.List coverageBlock_; + public static final int COVERED_FILE_FIELD_NUMBER = 2; + private java.util.List coveredFile_; /** - * repeated .TestResult.CoverageBlock coverage_block = 7; + * repeated .CoverageDetail.CoveredFile covered_file = 2; */ - public java.util.List getCoverageBlockList() { - return coverageBlock_; + public java.util.List getCoveredFileList() { + return coveredFile_; } /** - * repeated .TestResult.CoverageBlock coverage_block = 7; + * repeated .CoverageDetail.CoveredFile covered_file = 2; */ - public java.util.List - getCoverageBlockOrBuilderList() { - return coverageBlock_; + public java.util.List + getCoveredFileOrBuilderList() { + return coveredFile_; } /** - * repeated .TestResult.CoverageBlock coverage_block = 7; + * repeated .CoverageDetail.CoveredFile covered_file = 2; */ - public int getCoverageBlockCount() { - return coverageBlock_.size(); + public int getCoveredFileCount() { + return coveredFile_.size(); } /** - * repeated .TestResult.CoverageBlock coverage_block = 7; + * repeated .CoverageDetail.CoveredFile covered_file = 2; */ - public org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock getCoverageBlock(int index) { - return coverageBlock_.get(index); + public org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile getCoveredFile(int index) { + return coveredFile_.get(index); } /** - * repeated .TestResult.CoverageBlock coverage_block = 7; + * repeated .CoverageDetail.CoveredFile covered_file = 2; */ - public org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlockOrBuilder getCoverageBlockOrBuilder( + public org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFileOrBuilder getCoveredFileOrBuilder( int index) { - return coverageBlock_.get(index); + return coveredFile_.get(index); } private void initFields() { - testFileRef_ = 0; - type_ = org.sonar.batch.protocol.Constants.TestType.UT; - status_ = org.sonar.batch.protocol.Constants.TestResultStatus.OK; - durationInMs_ = 0L; - stacktrace_ = ""; - msg_ = ""; - coverageBlock_ = java.util.Collections.emptyList(); + testName_ = ""; + coveredFile_ = java.util.Collections.emptyList(); } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { @@ -22074,25 +22931,10 @@ public final class BatchReport { throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeInt32(1, testFileRef_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeEnum(2, type_.getNumber()); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeEnum(3, status_.getNumber()); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - output.writeInt64(4, durationInMs_); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - output.writeBytes(5, getStacktraceBytes()); - } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - output.writeBytes(6, getMsgBytes()); + output.writeBytes(1, getTestNameBytes()); } - for (int i = 0; i < coverageBlock_.size(); i++) { - output.writeMessage(7, coverageBlock_.get(i)); + for (int i = 0; i < coveredFile_.size(); i++) { + output.writeMessage(2, coveredFile_.get(i)); } getUnknownFields().writeTo(output); } @@ -22105,31 +22947,11 @@ public final class BatchReport { size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream - .computeInt32Size(1, testFileRef_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(2, type_.getNumber()); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(3, status_.getNumber()); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(4, durationInMs_); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(5, getStacktraceBytes()); - } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(6, getMsgBytes()); + .computeBytesSize(1, getTestNameBytes()); } - for (int i = 0; i < coverageBlock_.size(); i++) { + for (int i = 0; i < coveredFile_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(7, coverageBlock_.get(i)); + .computeMessageSize(2, coveredFile_.get(i)); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; @@ -22143,53 +22965,53 @@ public final class BatchReport { return super.writeReplace(); } - public static org.sonar.batch.protocol.output.BatchReport.TestResult parseFrom( + public static org.sonar.batch.protocol.output.BatchReport.CoverageDetail parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.sonar.batch.protocol.output.BatchReport.TestResult parseFrom( + public static org.sonar.batch.protocol.output.BatchReport.CoverageDetail parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.sonar.batch.protocol.output.BatchReport.TestResult parseFrom(byte[] data) + public static org.sonar.batch.protocol.output.BatchReport.CoverageDetail parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.sonar.batch.protocol.output.BatchReport.TestResult parseFrom( + public static org.sonar.batch.protocol.output.BatchReport.CoverageDetail parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.sonar.batch.protocol.output.BatchReport.TestResult parseFrom(java.io.InputStream input) + public static org.sonar.batch.protocol.output.BatchReport.CoverageDetail parseFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.sonar.batch.protocol.output.BatchReport.TestResult parseFrom( + public static org.sonar.batch.protocol.output.BatchReport.CoverageDetail parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } - public static org.sonar.batch.protocol.output.BatchReport.TestResult parseDelimitedFrom(java.io.InputStream input) + public static org.sonar.batch.protocol.output.BatchReport.CoverageDetail parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseDelimitedFrom(input); } - public static org.sonar.batch.protocol.output.BatchReport.TestResult parseDelimitedFrom( + public static org.sonar.batch.protocol.output.BatchReport.CoverageDetail parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseDelimitedFrom(input, extensionRegistry); } - public static org.sonar.batch.protocol.output.BatchReport.TestResult parseFrom( + public static org.sonar.batch.protocol.output.BatchReport.CoverageDetail parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.sonar.batch.protocol.output.BatchReport.TestResult parseFrom( + public static org.sonar.batch.protocol.output.BatchReport.CoverageDetail parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -22198,7 +23020,7 @@ public final class BatchReport { public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(org.sonar.batch.protocol.output.BatchReport.TestResult prototype) { + public static Builder newBuilder(org.sonar.batch.protocol.output.BatchReport.CoverageDetail prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } @@ -22210,25 +23032,25 @@ public final class BatchReport { return builder; } /** - * Protobuf type {@code TestResult} + * Protobuf type {@code CoverageDetail} */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:TestResult) - org.sonar.batch.protocol.output.BatchReport.TestResultOrBuilder { + // @@protoc_insertion_point(builder_implements:CoverageDetail) + org.sonar.batch.protocol.output.BatchReport.CoverageDetailOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return org.sonar.batch.protocol.output.BatchReport.internal_static_TestResult_descriptor; + return org.sonar.batch.protocol.output.BatchReport.internal_static_CoverageDetail_descriptor; } protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return org.sonar.batch.protocol.output.BatchReport.internal_static_TestResult_fieldAccessorTable + return org.sonar.batch.protocol.output.BatchReport.internal_static_CoverageDetail_fieldAccessorTable .ensureFieldAccessorsInitialized( - org.sonar.batch.protocol.output.BatchReport.TestResult.class, org.sonar.batch.protocol.output.BatchReport.TestResult.Builder.class); + org.sonar.batch.protocol.output.BatchReport.CoverageDetail.class, org.sonar.batch.protocol.output.BatchReport.CoverageDetail.Builder.class); } - // Construct using org.sonar.batch.protocol.output.BatchReport.TestResult.newBuilder() + // Construct using org.sonar.batch.protocol.output.BatchReport.CoverageDetail.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -22240,7 +23062,7 @@ public final class BatchReport { } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - getCoverageBlockFieldBuilder(); + getCoveredFileFieldBuilder(); } } private static Builder create() { @@ -22249,23 +23071,13 @@ public final class BatchReport { public Builder clear() { super.clear(); - testFileRef_ = 0; + testName_ = ""; bitField0_ = (bitField0_ & ~0x00000001); - type_ = org.sonar.batch.protocol.Constants.TestType.UT; - bitField0_ = (bitField0_ & ~0x00000002); - status_ = org.sonar.batch.protocol.Constants.TestResultStatus.OK; - bitField0_ = (bitField0_ & ~0x00000004); - durationInMs_ = 0L; - bitField0_ = (bitField0_ & ~0x00000008); - stacktrace_ = ""; - bitField0_ = (bitField0_ & ~0x00000010); - msg_ = ""; - bitField0_ = (bitField0_ & ~0x00000020); - if (coverageBlockBuilder_ == null) { - coverageBlock_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000040); + if (coveredFileBuilder_ == null) { + coveredFile_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); } else { - coverageBlockBuilder_.clear(); + coveredFileBuilder_.clear(); } return this; } @@ -22276,57 +23088,37 @@ public final class BatchReport { public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return org.sonar.batch.protocol.output.BatchReport.internal_static_TestResult_descriptor; + return org.sonar.batch.protocol.output.BatchReport.internal_static_CoverageDetail_descriptor; } - public org.sonar.batch.protocol.output.BatchReport.TestResult getDefaultInstanceForType() { - return org.sonar.batch.protocol.output.BatchReport.TestResult.getDefaultInstance(); + public org.sonar.batch.protocol.output.BatchReport.CoverageDetail getDefaultInstanceForType() { + return org.sonar.batch.protocol.output.BatchReport.CoverageDetail.getDefaultInstance(); } - public org.sonar.batch.protocol.output.BatchReport.TestResult build() { - org.sonar.batch.protocol.output.BatchReport.TestResult result = buildPartial(); + public org.sonar.batch.protocol.output.BatchReport.CoverageDetail build() { + org.sonar.batch.protocol.output.BatchReport.CoverageDetail result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public org.sonar.batch.protocol.output.BatchReport.TestResult buildPartial() { - org.sonar.batch.protocol.output.BatchReport.TestResult result = new org.sonar.batch.protocol.output.BatchReport.TestResult(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.testFileRef_ = testFileRef_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.type_ = type_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - result.status_ = status_; - if (((from_bitField0_ & 0x00000008) == 0x00000008)) { - to_bitField0_ |= 0x00000008; - } - result.durationInMs_ = durationInMs_; - if (((from_bitField0_ & 0x00000010) == 0x00000010)) { - to_bitField0_ |= 0x00000010; - } - result.stacktrace_ = stacktrace_; - if (((from_bitField0_ & 0x00000020) == 0x00000020)) { - to_bitField0_ |= 0x00000020; + public org.sonar.batch.protocol.output.BatchReport.CoverageDetail buildPartial() { + org.sonar.batch.protocol.output.BatchReport.CoverageDetail result = new org.sonar.batch.protocol.output.BatchReport.CoverageDetail(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; } - result.msg_ = msg_; - if (coverageBlockBuilder_ == null) { - if (((bitField0_ & 0x00000040) == 0x00000040)) { - coverageBlock_ = java.util.Collections.unmodifiableList(coverageBlock_); - bitField0_ = (bitField0_ & ~0x00000040); + result.testName_ = testName_; + if (coveredFileBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { + coveredFile_ = java.util.Collections.unmodifiableList(coveredFile_); + bitField0_ = (bitField0_ & ~0x00000002); } - result.coverageBlock_ = coverageBlock_; + result.coveredFile_ = coveredFile_; } else { - result.coverageBlock_ = coverageBlockBuilder_.build(); + result.coveredFile_ = coveredFileBuilder_.build(); } result.bitField0_ = to_bitField0_; onBuilt(); @@ -22334,61 +23126,44 @@ public final class BatchReport { } public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.sonar.batch.protocol.output.BatchReport.TestResult) { - return mergeFrom((org.sonar.batch.protocol.output.BatchReport.TestResult)other); + if (other instanceof org.sonar.batch.protocol.output.BatchReport.CoverageDetail) { + return mergeFrom((org.sonar.batch.protocol.output.BatchReport.CoverageDetail)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(org.sonar.batch.protocol.output.BatchReport.TestResult other) { - if (other == org.sonar.batch.protocol.output.BatchReport.TestResult.getDefaultInstance()) return this; - if (other.hasTestFileRef()) { - setTestFileRef(other.getTestFileRef()); - } - if (other.hasType()) { - setType(other.getType()); - } - if (other.hasStatus()) { - setStatus(other.getStatus()); - } - if (other.hasDurationInMs()) { - setDurationInMs(other.getDurationInMs()); - } - if (other.hasStacktrace()) { - bitField0_ |= 0x00000010; - stacktrace_ = other.stacktrace_; - onChanged(); - } - if (other.hasMsg()) { - bitField0_ |= 0x00000020; - msg_ = other.msg_; + public Builder mergeFrom(org.sonar.batch.protocol.output.BatchReport.CoverageDetail other) { + if (other == org.sonar.batch.protocol.output.BatchReport.CoverageDetail.getDefaultInstance()) return this; + if (other.hasTestName()) { + bitField0_ |= 0x00000001; + testName_ = other.testName_; onChanged(); } - if (coverageBlockBuilder_ == null) { - if (!other.coverageBlock_.isEmpty()) { - if (coverageBlock_.isEmpty()) { - coverageBlock_ = other.coverageBlock_; - bitField0_ = (bitField0_ & ~0x00000040); + if (coveredFileBuilder_ == null) { + if (!other.coveredFile_.isEmpty()) { + if (coveredFile_.isEmpty()) { + coveredFile_ = other.coveredFile_; + bitField0_ = (bitField0_ & ~0x00000002); } else { - ensureCoverageBlockIsMutable(); - coverageBlock_.addAll(other.coverageBlock_); + ensureCoveredFileIsMutable(); + coveredFile_.addAll(other.coveredFile_); } onChanged(); } } else { - if (!other.coverageBlock_.isEmpty()) { - if (coverageBlockBuilder_.isEmpty()) { - coverageBlockBuilder_.dispose(); - coverageBlockBuilder_ = null; - coverageBlock_ = other.coverageBlock_; - bitField0_ = (bitField0_ & ~0x00000040); - coverageBlockBuilder_ = + if (!other.coveredFile_.isEmpty()) { + if (coveredFileBuilder_.isEmpty()) { + coveredFileBuilder_.dispose(); + coveredFileBuilder_ = null; + coveredFile_ = other.coveredFile_; + bitField0_ = (bitField0_ & ~0x00000002); + coveredFileBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? - getCoverageBlockFieldBuilder() : null; + getCoveredFileFieldBuilder() : null; } else { - coverageBlockBuilder_.addAllMessages(other.coverageBlock_); + coveredFileBuilder_.addAllMessages(other.coveredFile_); } } } @@ -22404,11 +23179,11 @@ public final class BatchReport { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - org.sonar.batch.protocol.output.BatchReport.TestResult parsedMessage = null; + org.sonar.batch.protocol.output.BatchReport.CoverageDetail parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.sonar.batch.protocol.output.BatchReport.TestResult) e.getUnfinishedMessage(); + parsedMessage = (org.sonar.batch.protocol.output.BatchReport.CoverageDetail) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { @@ -22419,234 +23194,24 @@ public final class BatchReport { } private int bitField0_; - private int testFileRef_ ; + private java.lang.Object testName_ = ""; /** - * optional int32 test_file_ref = 1; + * optional string test_name = 1; */ - public boolean hasTestFileRef() { + public boolean hasTestName() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** - * optional int32 test_file_ref = 1; - */ - public int getTestFileRef() { - return testFileRef_; - } - /** - * optional int32 test_file_ref = 1; - */ - public Builder setTestFileRef(int value) { - bitField0_ |= 0x00000001; - testFileRef_ = value; - onChanged(); - return this; - } - /** - * optional int32 test_file_ref = 1; - */ - public Builder clearTestFileRef() { - bitField0_ = (bitField0_ & ~0x00000001); - testFileRef_ = 0; - onChanged(); - return this; - } - - private org.sonar.batch.protocol.Constants.TestType type_ = org.sonar.batch.protocol.Constants.TestType.UT; - /** - * optional .TestType type = 2; - */ - public boolean hasType() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional .TestType type = 2; - */ - public org.sonar.batch.protocol.Constants.TestType getType() { - return type_; - } - /** - * optional .TestType type = 2; - */ - public Builder setType(org.sonar.batch.protocol.Constants.TestType value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - type_ = value; - onChanged(); - return this; - } - /** - * optional .TestType type = 2; - */ - public Builder clearType() { - bitField0_ = (bitField0_ & ~0x00000002); - type_ = org.sonar.batch.protocol.Constants.TestType.UT; - onChanged(); - return this; - } - - private org.sonar.batch.protocol.Constants.TestResultStatus status_ = org.sonar.batch.protocol.Constants.TestResultStatus.OK; - /** - * optional .TestResultStatus status = 3; - */ - public boolean hasStatus() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional .TestResultStatus status = 3; - */ - public org.sonar.batch.protocol.Constants.TestResultStatus getStatus() { - return status_; - } - /** - * optional .TestResultStatus status = 3; - */ - public Builder setStatus(org.sonar.batch.protocol.Constants.TestResultStatus value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000004; - status_ = value; - onChanged(); - return this; - } - /** - * optional .TestResultStatus status = 3; - */ - public Builder clearStatus() { - bitField0_ = (bitField0_ & ~0x00000004); - status_ = org.sonar.batch.protocol.Constants.TestResultStatus.OK; - onChanged(); - return this; - } - - private long durationInMs_ ; - /** - * optional int64 duration_in_ms = 4; - */ - public boolean hasDurationInMs() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - * optional int64 duration_in_ms = 4; - */ - public long getDurationInMs() { - return durationInMs_; - } - /** - * optional int64 duration_in_ms = 4; - */ - public Builder setDurationInMs(long value) { - bitField0_ |= 0x00000008; - durationInMs_ = value; - onChanged(); - return this; - } - /** - * optional int64 duration_in_ms = 4; - */ - public Builder clearDurationInMs() { - bitField0_ = (bitField0_ & ~0x00000008); - durationInMs_ = 0L; - onChanged(); - return this; - } - - private java.lang.Object stacktrace_ = ""; - /** - * optional string stacktrace = 5; - */ - public boolean hasStacktrace() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - * optional string stacktrace = 5; - */ - public java.lang.String getStacktrace() { - java.lang.Object ref = stacktrace_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - stacktrace_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string stacktrace = 5; - */ - public com.google.protobuf.ByteString - getStacktraceBytes() { - java.lang.Object ref = stacktrace_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - stacktrace_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string stacktrace = 5; - */ - public Builder setStacktrace( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000010; - stacktrace_ = value; - onChanged(); - return this; - } - /** - * optional string stacktrace = 5; - */ - public Builder clearStacktrace() { - bitField0_ = (bitField0_ & ~0x00000010); - stacktrace_ = getDefaultInstance().getStacktrace(); - onChanged(); - return this; - } - /** - * optional string stacktrace = 5; - */ - public Builder setStacktraceBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000010; - stacktrace_ = value; - onChanged(); - return this; - } - - private java.lang.Object msg_ = ""; - /** - * optional string msg = 6; - */ - public boolean hasMsg() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - /** - * optional string msg = 6; + * optional string test_name = 1; */ - public java.lang.String getMsg() { - java.lang.Object ref = msg_; + public java.lang.String getTestName() { + java.lang.Object ref = testName_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { - msg_ = s; + testName_ = s; } return s; } else { @@ -22654,306 +23219,306 @@ public final class BatchReport { } } /** - * optional string msg = 6; + * optional string test_name = 1; */ public com.google.protobuf.ByteString - getMsgBytes() { - java.lang.Object ref = msg_; + getTestNameBytes() { + java.lang.Object ref = testName_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); - msg_ = b; + testName_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** - * optional string msg = 6; + * optional string test_name = 1; */ - public Builder setMsg( + public Builder setTestName( java.lang.String value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000020; - msg_ = value; + bitField0_ |= 0x00000001; + testName_ = value; onChanged(); return this; } /** - * optional string msg = 6; + * optional string test_name = 1; */ - public Builder clearMsg() { - bitField0_ = (bitField0_ & ~0x00000020); - msg_ = getDefaultInstance().getMsg(); + public Builder clearTestName() { + bitField0_ = (bitField0_ & ~0x00000001); + testName_ = getDefaultInstance().getTestName(); onChanged(); return this; } /** - * optional string msg = 6; + * optional string test_name = 1; */ - public Builder setMsgBytes( + public Builder setTestNameBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000020; - msg_ = value; + bitField0_ |= 0x00000001; + testName_ = value; onChanged(); return this; } - private java.util.List coverageBlock_ = + private java.util.List coveredFile_ = java.util.Collections.emptyList(); - private void ensureCoverageBlockIsMutable() { - if (!((bitField0_ & 0x00000040) == 0x00000040)) { - coverageBlock_ = new java.util.ArrayList(coverageBlock_); - bitField0_ |= 0x00000040; + private void ensureCoveredFileIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + coveredFile_ = new java.util.ArrayList(coveredFile_); + bitField0_ |= 0x00000002; } } private com.google.protobuf.RepeatedFieldBuilder< - org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock, org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock.Builder, org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlockOrBuilder> coverageBlockBuilder_; + org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile, org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile.Builder, org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFileOrBuilder> coveredFileBuilder_; /** - * repeated .TestResult.CoverageBlock coverage_block = 7; + * repeated .CoverageDetail.CoveredFile covered_file = 2; */ - public java.util.List getCoverageBlockList() { - if (coverageBlockBuilder_ == null) { - return java.util.Collections.unmodifiableList(coverageBlock_); + public java.util.List getCoveredFileList() { + if (coveredFileBuilder_ == null) { + return java.util.Collections.unmodifiableList(coveredFile_); } else { - return coverageBlockBuilder_.getMessageList(); + return coveredFileBuilder_.getMessageList(); } } /** - * repeated .TestResult.CoverageBlock coverage_block = 7; + * repeated .CoverageDetail.CoveredFile covered_file = 2; */ - public int getCoverageBlockCount() { - if (coverageBlockBuilder_ == null) { - return coverageBlock_.size(); + public int getCoveredFileCount() { + if (coveredFileBuilder_ == null) { + return coveredFile_.size(); } else { - return coverageBlockBuilder_.getCount(); + return coveredFileBuilder_.getCount(); } } /** - * repeated .TestResult.CoverageBlock coverage_block = 7; + * repeated .CoverageDetail.CoveredFile covered_file = 2; */ - public org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock getCoverageBlock(int index) { - if (coverageBlockBuilder_ == null) { - return coverageBlock_.get(index); + public org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile getCoveredFile(int index) { + if (coveredFileBuilder_ == null) { + return coveredFile_.get(index); } else { - return coverageBlockBuilder_.getMessage(index); + return coveredFileBuilder_.getMessage(index); } } /** - * repeated .TestResult.CoverageBlock coverage_block = 7; + * repeated .CoverageDetail.CoveredFile covered_file = 2; */ - public Builder setCoverageBlock( - int index, org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock value) { - if (coverageBlockBuilder_ == null) { + public Builder setCoveredFile( + int index, org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile value) { + if (coveredFileBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureCoverageBlockIsMutable(); - coverageBlock_.set(index, value); + ensureCoveredFileIsMutable(); + coveredFile_.set(index, value); onChanged(); } else { - coverageBlockBuilder_.setMessage(index, value); + coveredFileBuilder_.setMessage(index, value); } return this; } /** - * repeated .TestResult.CoverageBlock coverage_block = 7; + * repeated .CoverageDetail.CoveredFile covered_file = 2; */ - public Builder setCoverageBlock( - int index, org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock.Builder builderForValue) { - if (coverageBlockBuilder_ == null) { - ensureCoverageBlockIsMutable(); - coverageBlock_.set(index, builderForValue.build()); + public Builder setCoveredFile( + int index, org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile.Builder builderForValue) { + if (coveredFileBuilder_ == null) { + ensureCoveredFileIsMutable(); + coveredFile_.set(index, builderForValue.build()); onChanged(); } else { - coverageBlockBuilder_.setMessage(index, builderForValue.build()); + coveredFileBuilder_.setMessage(index, builderForValue.build()); } return this; } /** - * repeated .TestResult.CoverageBlock coverage_block = 7; + * repeated .CoverageDetail.CoveredFile covered_file = 2; */ - public Builder addCoverageBlock(org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock value) { - if (coverageBlockBuilder_ == null) { + public Builder addCoveredFile(org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile value) { + if (coveredFileBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureCoverageBlockIsMutable(); - coverageBlock_.add(value); + ensureCoveredFileIsMutable(); + coveredFile_.add(value); onChanged(); } else { - coverageBlockBuilder_.addMessage(value); + coveredFileBuilder_.addMessage(value); } return this; } /** - * repeated .TestResult.CoverageBlock coverage_block = 7; + * repeated .CoverageDetail.CoveredFile covered_file = 2; */ - public Builder addCoverageBlock( - int index, org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock value) { - if (coverageBlockBuilder_ == null) { + public Builder addCoveredFile( + int index, org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile value) { + if (coveredFileBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureCoverageBlockIsMutable(); - coverageBlock_.add(index, value); + ensureCoveredFileIsMutable(); + coveredFile_.add(index, value); onChanged(); } else { - coverageBlockBuilder_.addMessage(index, value); + coveredFileBuilder_.addMessage(index, value); } return this; } /** - * repeated .TestResult.CoverageBlock coverage_block = 7; + * repeated .CoverageDetail.CoveredFile covered_file = 2; */ - public Builder addCoverageBlock( - org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock.Builder builderForValue) { - if (coverageBlockBuilder_ == null) { - ensureCoverageBlockIsMutable(); - coverageBlock_.add(builderForValue.build()); + public Builder addCoveredFile( + org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile.Builder builderForValue) { + if (coveredFileBuilder_ == null) { + ensureCoveredFileIsMutable(); + coveredFile_.add(builderForValue.build()); onChanged(); } else { - coverageBlockBuilder_.addMessage(builderForValue.build()); + coveredFileBuilder_.addMessage(builderForValue.build()); } return this; } /** - * repeated .TestResult.CoverageBlock coverage_block = 7; + * repeated .CoverageDetail.CoveredFile covered_file = 2; */ - public Builder addCoverageBlock( - int index, org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock.Builder builderForValue) { - if (coverageBlockBuilder_ == null) { - ensureCoverageBlockIsMutable(); - coverageBlock_.add(index, builderForValue.build()); + public Builder addCoveredFile( + int index, org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile.Builder builderForValue) { + if (coveredFileBuilder_ == null) { + ensureCoveredFileIsMutable(); + coveredFile_.add(index, builderForValue.build()); onChanged(); } else { - coverageBlockBuilder_.addMessage(index, builderForValue.build()); + coveredFileBuilder_.addMessage(index, builderForValue.build()); } return this; } /** - * repeated .TestResult.CoverageBlock coverage_block = 7; + * repeated .CoverageDetail.CoveredFile covered_file = 2; */ - public Builder addAllCoverageBlock( - java.lang.Iterable values) { - if (coverageBlockBuilder_ == null) { - ensureCoverageBlockIsMutable(); + public Builder addAllCoveredFile( + java.lang.Iterable values) { + if (coveredFileBuilder_ == null) { + ensureCoveredFileIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, coverageBlock_); + values, coveredFile_); onChanged(); } else { - coverageBlockBuilder_.addAllMessages(values); + coveredFileBuilder_.addAllMessages(values); } return this; } /** - * repeated .TestResult.CoverageBlock coverage_block = 7; + * repeated .CoverageDetail.CoveredFile covered_file = 2; */ - public Builder clearCoverageBlock() { - if (coverageBlockBuilder_ == null) { - coverageBlock_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000040); + public Builder clearCoveredFile() { + if (coveredFileBuilder_ == null) { + coveredFile_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); } else { - coverageBlockBuilder_.clear(); + coveredFileBuilder_.clear(); } return this; } /** - * repeated .TestResult.CoverageBlock coverage_block = 7; + * repeated .CoverageDetail.CoveredFile covered_file = 2; */ - public Builder removeCoverageBlock(int index) { - if (coverageBlockBuilder_ == null) { - ensureCoverageBlockIsMutable(); - coverageBlock_.remove(index); + public Builder removeCoveredFile(int index) { + if (coveredFileBuilder_ == null) { + ensureCoveredFileIsMutable(); + coveredFile_.remove(index); onChanged(); } else { - coverageBlockBuilder_.remove(index); + coveredFileBuilder_.remove(index); } return this; } /** - * repeated .TestResult.CoverageBlock coverage_block = 7; + * repeated .CoverageDetail.CoveredFile covered_file = 2; */ - public org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock.Builder getCoverageBlockBuilder( + public org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile.Builder getCoveredFileBuilder( int index) { - return getCoverageBlockFieldBuilder().getBuilder(index); + return getCoveredFileFieldBuilder().getBuilder(index); } /** - * repeated .TestResult.CoverageBlock coverage_block = 7; + * repeated .CoverageDetail.CoveredFile covered_file = 2; */ - public org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlockOrBuilder getCoverageBlockOrBuilder( + public org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFileOrBuilder getCoveredFileOrBuilder( int index) { - if (coverageBlockBuilder_ == null) { - return coverageBlock_.get(index); } else { - return coverageBlockBuilder_.getMessageOrBuilder(index); + if (coveredFileBuilder_ == null) { + return coveredFile_.get(index); } else { + return coveredFileBuilder_.getMessageOrBuilder(index); } } /** - * repeated .TestResult.CoverageBlock coverage_block = 7; + * repeated .CoverageDetail.CoveredFile covered_file = 2; */ - public java.util.List - getCoverageBlockOrBuilderList() { - if (coverageBlockBuilder_ != null) { - return coverageBlockBuilder_.getMessageOrBuilderList(); + public java.util.List + getCoveredFileOrBuilderList() { + if (coveredFileBuilder_ != null) { + return coveredFileBuilder_.getMessageOrBuilderList(); } else { - return java.util.Collections.unmodifiableList(coverageBlock_); + return java.util.Collections.unmodifiableList(coveredFile_); } } /** - * repeated .TestResult.CoverageBlock coverage_block = 7; + * repeated .CoverageDetail.CoveredFile covered_file = 2; */ - public org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock.Builder addCoverageBlockBuilder() { - return getCoverageBlockFieldBuilder().addBuilder( - org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock.getDefaultInstance()); + public org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile.Builder addCoveredFileBuilder() { + return getCoveredFileFieldBuilder().addBuilder( + org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile.getDefaultInstance()); } /** - * repeated .TestResult.CoverageBlock coverage_block = 7; + * repeated .CoverageDetail.CoveredFile covered_file = 2; */ - public org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock.Builder addCoverageBlockBuilder( + public org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile.Builder addCoveredFileBuilder( int index) { - return getCoverageBlockFieldBuilder().addBuilder( - index, org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock.getDefaultInstance()); + return getCoveredFileFieldBuilder().addBuilder( + index, org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile.getDefaultInstance()); } /** - * repeated .TestResult.CoverageBlock coverage_block = 7; + * repeated .CoverageDetail.CoveredFile covered_file = 2; */ - public java.util.List - getCoverageBlockBuilderList() { - return getCoverageBlockFieldBuilder().getBuilderList(); + public java.util.List + getCoveredFileBuilderList() { + return getCoveredFileFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilder< - org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock, org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock.Builder, org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlockOrBuilder> - getCoverageBlockFieldBuilder() { - if (coverageBlockBuilder_ == null) { - coverageBlockBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< - org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock, org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock.Builder, org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlockOrBuilder>( - coverageBlock_, - ((bitField0_ & 0x00000040) == 0x00000040), + org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile, org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile.Builder, org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFileOrBuilder> + getCoveredFileFieldBuilder() { + if (coveredFileBuilder_ == null) { + coveredFileBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile, org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile.Builder, org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFileOrBuilder>( + coveredFile_, + ((bitField0_ & 0x00000002) == 0x00000002), getParentForChildren(), isClean()); - coverageBlock_ = null; + coveredFile_ = null; } - return coverageBlockBuilder_; + return coveredFileBuilder_; } - // @@protoc_insertion_point(builder_scope:TestResult) + // @@protoc_insertion_point(builder_scope:CoverageDetail) } static { - defaultInstance = new TestResult(true); + defaultInstance = new CoverageDetail(true); defaultInstance.initFields(); } - // @@protoc_insertion_point(class_scope:TestResult) + // @@protoc_insertion_point(class_scope:CoverageDetail) } private static final com.google.protobuf.Descriptors.Descriptor @@ -23047,15 +23612,20 @@ public final class BatchReport { com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_SyntaxHighlighting_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_TestResult_descriptor; + internal_static_Test_descriptor; private static com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_TestResult_fieldAccessorTable; + internal_static_Test_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_TestResult_CoverageBlock_descriptor; + internal_static_CoverageDetail_descriptor; private static com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_TestResult_CoverageBlock_fieldAccessorTable; + internal_static_CoverageDetail_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_CoverageDetail_CoveredFile_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_CoverageDetail_CoveredFile_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -23132,14 +23702,15 @@ public final class BatchReport { "\035\n\025it_covered_conditions\030\006 \001(\005\022\"\n\032overal" + "l_covered_conditions\030\007 \001(\005\"L\n\022SyntaxHigh" + "lighting\022\025\n\005range\030\001 \001(\0132\006.Range\022\037\n\004type\030" + - "\002 \001(\0162\021.HighlightingType\"\374\001\n\nTestResult\022" + - "\025\n\rtest_file_ref\030\001 \001(\005\022\027\n\004type\030\002 \001(\0162\t.T" + - "estType\022!\n\006status\030\003 \001(\0162\021.TestResultStat", - "us\022\026\n\016duration_in_ms\030\004 \001(\003\022\022\n\nstacktrace" + - "\030\005 \001(\t\022\013\n\003msg\030\006 \001(\t\0221\n\016coverage_block\030\007 " + - "\003(\0132\031.TestResult.CoverageBlock\032/\n\rCovera" + - "geBlock\022\020\n\010file_ref\030\001 \001(\005\022\014\n\004line\030\002 \003(\005B" + - "#\n\037org.sonar.batch.protocol.outputH\001" + "\002 \001(\0162\021.HighlightingType\"\203\001\n\004Test\022\014\n\004nam" + + "e\030\001 \001(\t\022\027\n\004type\030\002 \001(\0162\t.TestType\022\033\n\006stat" + + "us\030\003 \001(\0162\013.TestStatus\022\026\n\016duration_in_ms\030", + "\004 \001(\003\022\022\n\nstacktrace\030\005 \001(\t\022\013\n\003msg\030\006 \001(\t\"\221" + + "\001\n\016CoverageDetail\022\021\n\ttest_name\030\001 \001(\t\0221\n\014" + + "covered_file\030\002 \003(\0132\033.CoverageDetail.Cove" + + "redFile\0329\n\013CoveredFile\022\020\n\010file_ref\030\001 \001(\005" + + "\022\030\n\014covered_line\030\002 \003(\005B\002\020\001B#\n\037org.sonar." + + "batch.protocol.outputH\001" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { @@ -23262,18 +23833,24 @@ public final class BatchReport { com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_SyntaxHighlighting_descriptor, new java.lang.String[] { "Range", "Type", }); - internal_static_TestResult_descriptor = + internal_static_Test_descriptor = getDescriptor().getMessageTypes().get(16); - internal_static_TestResult_fieldAccessorTable = new + internal_static_Test_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_Test_descriptor, + new java.lang.String[] { "Name", "Type", "Status", "DurationInMs", "Stacktrace", "Msg", }); + internal_static_CoverageDetail_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_CoverageDetail_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_TestResult_descriptor, - new java.lang.String[] { "TestFileRef", "Type", "Status", "DurationInMs", "Stacktrace", "Msg", "CoverageBlock", }); - internal_static_TestResult_CoverageBlock_descriptor = - internal_static_TestResult_descriptor.getNestedTypes().get(0); - internal_static_TestResult_CoverageBlock_fieldAccessorTable = new + internal_static_CoverageDetail_descriptor, + new java.lang.String[] { "TestName", "CoveredFile", }); + internal_static_CoverageDetail_CoveredFile_descriptor = + internal_static_CoverageDetail_descriptor.getNestedTypes().get(0); + internal_static_CoverageDetail_CoveredFile_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_TestResult_CoverageBlock_descriptor, - new java.lang.String[] { "FileRef", "Line", }); + internal_static_CoverageDetail_CoveredFile_descriptor, + new java.lang.String[] { "FileRef", "CoveredLine", }); org.sonar.batch.protocol.Constants.getDescriptor(); } diff --git a/sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/output/BatchReportReader.java b/sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/output/BatchReportReader.java index e7524bec5aa..d673b58082b 100644 --- a/sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/output/BatchReportReader.java +++ b/sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/output/BatchReportReader.java @@ -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; @@ -141,8 +142,18 @@ public class BatchReportReader { } @CheckForNull - public File readTestResults(int fileRef) { - File file = fileStructure.fileFor(FileStructure.Domain.TEST_RESULT, fileRef); + public File readTests(int testFileRef) { + File file = fileStructure.fileFor(FileStructure.Domain.TESTS, testFileRef); + if (doesFileExists(file)) { + return file; + } + + return null; + } + + @CheckForNull + public File readCoverageDetails(int testFileRef) { + File file = fileStructure.fileFor(FileStructure.Domain.COVERAGE_DETAILS, testFileRef); if (doesFileExists(file)) { return file; } diff --git a/sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/output/BatchReportWriter.java b/sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/output/BatchReportWriter.java index 6e717fbee42..41d98e24ecf 100644 --- a/sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/output/BatchReportWriter.java +++ b/sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/output/BatchReportWriter.java @@ -115,9 +115,14 @@ public class BatchReportWriter { ProtobufUtil.writeMessagesToFile(coverageList, file); } - public void writeTestResults(int componentRef, Iterable testResults) { - File file = fileStructure.fileFor(FileStructure.Domain.TEST_RESULT, componentRef); - ProtobufUtil.writeMessagesToFile(testResults, file); + public void writeTests(int componentRef, Iterable tests) { + File file = fileStructure.fileFor(FileStructure.Domain.TESTS, componentRef); + ProtobufUtil.writeMessagesToFile(tests, file); + } + + public void writeCoverageDetails(int componentRef, Iterable tests) { + File file = fileStructure.fileFor(FileStructure.Domain.COVERAGE_DETAILS, componentRef); + ProtobufUtil.writeMessagesToFile(tests, file); } public File getSourceFile(int componentRef) { diff --git a/sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/output/FileStructure.java b/sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/output/FileStructure.java index d6d52ac0471..664ded567a0 100644 --- a/sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/output/FileStructure.java +++ b/sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/output/FileStructure.java @@ -36,7 +36,8 @@ public class FileStructure { SCM("scm-", Domain.PB), SYMBOLS("symbol-", Domain.PB), COVERAGE("coverage-", Domain.PB), - TEST_RESULT("test-", Domain.PB), + TESTS("tests-", Domain.PB), + COVERAGE_DETAILS("coverage-details-", Domain.PB), SOURCE("source-", ".txt"); private static final String PB = ".pb"; diff --git a/sonar-batch-protocol/src/main/protobuf/batch_report.proto b/sonar-batch-protocol/src/main/protobuf/batch_report.proto index cc0de55f061..99825feb940 100644 --- a/sonar-batch-protocol/src/main/protobuf/batch_report.proto +++ b/sonar-batch-protocol/src/main/protobuf/batch_report.proto @@ -233,17 +233,21 @@ message SyntaxHighlighting { optional HighlightingType type = 2; } -message TestResult { - optional int32 test_file_ref = 1; +message Test { + optional string name = 1; optional TestType type = 2; - optional TestResultStatus status = 3; + optional TestStatus status = 3; optional int64 duration_in_ms = 4; optional string stacktrace = 5; optional string msg = 6; - repeated CoverageBlock coverage_block = 7; +} + +message CoverageDetail { + optional string test_name = 1; + repeated CoveredFile covered_file = 2; - message CoverageBlock { + message CoveredFile { optional int32 file_ref = 1; - repeated int32 line = 2; + repeated int32 covered_line = 2 [packed = true]; } -} \ No newline at end of file +} diff --git a/sonar-batch-protocol/src/main/protobuf/constants.proto b/sonar-batch-protocol/src/main/protobuf/constants.proto index 3e906814029..26eee4a1cd9 100644 --- a/sonar-batch-protocol/src/main/protobuf/constants.proto +++ b/sonar-batch-protocol/src/main/protobuf/constants.proto @@ -78,7 +78,7 @@ enum TestType { IT = 2; } -enum TestResultStatus { +enum TestStatus { OK = 1; FAILURE = 2; ERROR = 3; diff --git a/sonar-batch-protocol/src/test/java/org/sonar/batch/protocol/output/BatchReportReaderTest.java b/sonar-batch-protocol/src/test/java/org/sonar/batch/protocol/output/BatchReportReaderTest.java index 0e942e14ab3..1eacfbd0f75 100644 --- a/sonar-batch-protocol/src/test/java/org/sonar/batch/protocol/output/BatchReportReaderTest.java +++ b/sonar-batch-protocol/src/test/java/org/sonar/batch/protocol/output/BatchReportReaderTest.java @@ -232,29 +232,44 @@ public class BatchReportReaderTest { public void read_tests() throws Exception { initFiles(dir); BatchReportWriter writer = new BatchReportWriter(dir); - writer.writeTestResults(1, Arrays.asList( - BatchReport.TestResult.newBuilder() - .setTestFileRef(1) + writer.writeTests(1, Arrays.asList( + BatchReport.Test.newBuilder() .setDurationInMs(60_000) .setStacktrace("stacktrace") .setMsg("message") - .setStatus(Constants.TestResultStatus.OK) + .setStatus(Constants.TestStatus.OK) .setType(Constants.TestType.IT) - .addCoverageBlock(BatchReport.TestResult.CoverageBlock.newBuilder() - .setFileRef(2) - .addAllLine(Arrays.asList(1, 2, 3, 4, 5))) .build())); - try (InputStream inputStream = FileUtils.openInputStream(sut.readTestResults(1))) { - BatchReport.TestResult testResult = BatchReport.TestResult.PARSER.parseDelimitedFrom(inputStream); - assertThat(testResult.getTestFileRef()).isEqualTo(1); + try (InputStream inputStream = FileUtils.openInputStream(sut.readTests(1))) { + BatchReport.Test testResult = BatchReport.Test.PARSER.parseDelimitedFrom(inputStream); assertThat(testResult.getDurationInMs()).isEqualTo(60_000); assertThat(testResult.getStacktrace()).isEqualTo("stacktrace"); assertThat(testResult.getMsg()).isEqualTo("message"); assertThat(testResult.getType()).isEqualTo(Constants.TestType.IT); - assertThat(testResult.getStatus()).isEqualTo(Constants.TestResultStatus.OK); - assertThat(testResult.getCoverageBlockList().get(0).getFileRef()).isEqualTo(2); - assertThat(testResult.getCoverageBlockList().get(0).getLineList()).containsOnly(1, 2, 3, 4, 5); + assertThat(testResult.getStatus()).isEqualTo(Constants.TestStatus.OK); + } + } + + @Test + public void read_coverage_details() throws Exception { + initFiles(dir); + BatchReportWriter writer = new BatchReportWriter(dir); + writer.writeCoverageDetails(1, Arrays.asList( + BatchReport.CoverageDetail.newBuilder() + .setTestName("test-name") + .addCoveredFile(BatchReport.CoverageDetail.CoveredFile.newBuilder() + .addAllCoveredLine(Arrays.asList(1, 2, 3, 5, 7)) + .setFileRef(2) + ) + .build() + )); + + try (InputStream inputStream = FileUtils.openInputStream(sut.readCoverageDetails(1))) { + BatchReport.CoverageDetail coverageDetail = BatchReport.CoverageDetail.PARSER.parseDelimitedFrom(inputStream); + assertThat(coverageDetail.getTestName()).isEqualTo("test-name"); + assertThat(coverageDetail.getCoveredFile(0).getFileRef()).isEqualTo(2); + assertThat(coverageDetail.getCoveredFile(0).getCoveredLineList()).containsExactly(1, 2, 3, 5, 7); } } @@ -315,7 +330,12 @@ public class BatchReportReaderTest { @Test public void null_if_no_test_found() throws Exception { - assertThat(sut.readTestResults(666)).isNull(); + assertThat(sut.readTests(666)).isNull(); + } + + @Test + public void null_if_no_coverage_detail_found() throws Exception { + assertThat(sut.readCoverageDetails(666)).isNull(); } private void initFiles(File dir) { diff --git a/sonar-batch-protocol/src/test/java/org/sonar/batch/protocol/output/BatchReportWriterTest.java b/sonar-batch-protocol/src/test/java/org/sonar/batch/protocol/output/BatchReportWriterTest.java index dd9e7d83b2d..8fa141e9772 100644 --- a/sonar-batch-protocol/src/test/java/org/sonar/batch/protocol/output/BatchReportWriterTest.java +++ b/sonar-batch-protocol/src/test/java/org/sonar/batch/protocol/output/BatchReportWriterTest.java @@ -295,16 +295,26 @@ public class BatchReportWriterTest { } @Test - public void write_test() throws Exception { - assertThat(sut.hasComponentData(FileStructure.Domain.TEST_RESULT, 1)).isFalse(); + public void write_tests() throws Exception { + assertThat(sut.hasComponentData(FileStructure.Domain.TESTS, 1)).isFalse(); - sut.writeTestResults(1, Arrays.asList( - BatchReport.TestResult.newBuilder() - .setTestFileRef(1) - .build() + sut.writeTests(1, Arrays.asList( + BatchReport.Test.getDefaultInstance() + )); + + assertThat(sut.hasComponentData(FileStructure.Domain.TESTS, 1)).isTrue(); + + } + + @Test + public void write_coverage_details() throws Exception { + assertThat(sut.hasComponentData(FileStructure.Domain.COVERAGE_DETAILS, 1)).isFalse(); + + sut.writeCoverageDetails(1, Arrays.asList( + BatchReport.CoverageDetail.getDefaultInstance() )); - assertThat(sut.hasComponentData(FileStructure.Domain.TEST_RESULT, 1)).isTrue(); + assertThat(sut.hasComponentData(FileStructure.Domain.COVERAGE_DETAILS, 1)).isTrue(); } }