diff options
author | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2015-04-09 11:55:55 +0200 |
---|---|---|
committer | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2015-04-16 11:47:58 +0200 |
commit | 598bce548a3420f88ab89e1dc6bc4b2ca24a808c (patch) | |
tree | d5520f1b8773d60fb9cc34519d6fdfc15607ef88 /sonar-batch-protocol | |
parent | 8ad882a51708f79204b89cf8fb8b6406a49f04df (diff) | |
download | sonarqube-598bce548a3420f88ab89e1dc6bc4b2ca24a808c.tar.gz sonarqube-598bce548a3420f88ab89e1dc6bc4b2ca24a808c.zip |
Move tests persistence from batch to compute - SONAR-6255
- define index and check the 3 use cases
- define batch report format
- create file_sources.test_data
Diffstat (limited to 'sonar-batch-protocol')
11 files changed, 5694 insertions, 88 deletions
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 1e58e9104fb..b8b01b3d317 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 @@ -684,6 +684,188 @@ public final class Constants { // @@protoc_insertion_point(enum_scope:HighlightingType) } + /** + * Protobuf enum {@code TestType} + */ + public enum TestType + implements com.google.protobuf.ProtocolMessageEnum { + /** + * <code>UT = 1;</code> + */ + UT(0, 1), + /** + * <code>IT = 2;</code> + */ + IT(1, 2), + ; + + /** + * <code>UT = 1;</code> + */ + public static final int UT_VALUE = 1; + /** + * <code>IT = 2;</code> + */ + public static final int IT_VALUE = 2; + + + public final int getNumber() { return value; } + + public static TestType valueOf(int value) { + switch (value) { + case 1: return UT; + case 2: return IT; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap<TestType> + internalGetValueMap() { + return internalValueMap; + } + private static com.google.protobuf.Internal.EnumLiteMap<TestType> + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap<TestType>() { + public TestType findValueByNumber(int number) { + return TestType.valueOf(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(index); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return org.sonar.batch.protocol.Constants.getDescriptor().getEnumTypes().get(6); + } + + private static final TestType[] VALUES = values(); + + public static TestType valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + return VALUES[desc.getIndex()]; + } + + private final int index; + private final int value; + + private TestType(int index, int value) { + this.index = index; + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:TestType) + } + + /** + * Protobuf enum {@code TestResultStatus} + */ + public enum TestResultStatus + implements com.google.protobuf.ProtocolMessageEnum { + /** + * <code>OK = 1;</code> + */ + OK(0, 1), + /** + * <code>FAILURE = 2;</code> + */ + FAILURE(1, 2), + /** + * <code>ERROR = 3;</code> + */ + ERROR(2, 3), + /** + * <code>SKIPPED = 4;</code> + */ + SKIPPED(3, 4), + ; + + /** + * <code>OK = 1;</code> + */ + public static final int OK_VALUE = 1; + /** + * <code>FAILURE = 2;</code> + */ + public static final int FAILURE_VALUE = 2; + /** + * <code>ERROR = 3;</code> + */ + public static final int ERROR_VALUE = 3; + /** + * <code>SKIPPED = 4;</code> + */ + public static final int SKIPPED_VALUE = 4; + + + public final int getNumber() { return value; } + + public static TestResultStatus valueOf(int value) { + switch (value) { + case 1: return OK; + case 2: return FAILURE; + case 3: return ERROR; + case 4: return SKIPPED; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap<TestResultStatus> + internalGetValueMap() { + return internalValueMap; + } + private static com.google.protobuf.Internal.EnumLiteMap<TestResultStatus> + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap<TestResultStatus>() { + public TestResultStatus findValueByNumber(int number) { + return TestResultStatus.valueOf(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(index); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return org.sonar.batch.protocol.Constants.getDescriptor().getEnumTypes().get(7); + } + + private static final TestResultStatus[] VALUES = values(); + + public static TestResultStatus valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + return VALUES[desc.getIndex()]; + } + + private final int index; + private final int value; + + private TestResultStatus(int index, int value) { + this.index = index; + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:TestResultStatus) + } + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -706,8 +888,10 @@ public final class Constants { "ON\020\000\022\014\n\010CONSTANT\020\001\022\013\n\007COMMENT\020\002\022\013\n\007CPP_D" + "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\010B\034\n\030org.s" + - "onar.batch.protocolH\001" + "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" }; 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 4b04e4ff9e2..20794177650 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,6 +21081,1881 @@ public final class BatchReport { // @@protoc_insertion_point(class_scope:SyntaxHighlighting) } + public interface TestResultOrBuilder extends + // @@protoc_insertion_point(interface_extends:TestResult) + com.google.protobuf.MessageOrBuilder { + + /** + * <code>optional int32 test_file_ref = 1;</code> + */ + boolean hasTestFileRef(); + /** + * <code>optional int32 test_file_ref = 1;</code> + */ + int getTestFileRef(); + + /** + * <code>optional .TestType type = 2;</code> + */ + boolean hasType(); + /** + * <code>optional .TestType type = 2;</code> + */ + org.sonar.batch.protocol.Constants.TestType getType(); + + /** + * <code>optional .TestResultStatus status = 3;</code> + */ + boolean hasStatus(); + /** + * <code>optional .TestResultStatus status = 3;</code> + */ + org.sonar.batch.protocol.Constants.TestResultStatus getStatus(); + + /** + * <code>optional int64 duration_in_ms = 4;</code> + */ + boolean hasDurationInMs(); + /** + * <code>optional int64 duration_in_ms = 4;</code> + */ + long getDurationInMs(); + + /** + * <code>optional string stacktrace = 5;</code> + */ + boolean hasStacktrace(); + /** + * <code>optional string stacktrace = 5;</code> + */ + java.lang.String getStacktrace(); + /** + * <code>optional string stacktrace = 5;</code> + */ + com.google.protobuf.ByteString + getStacktraceBytes(); + + /** + * <code>optional string msg = 6;</code> + */ + boolean hasMsg(); + /** + * <code>optional string msg = 6;</code> + */ + java.lang.String getMsg(); + /** + * <code>optional string msg = 6;</code> + */ + com.google.protobuf.ByteString + getMsgBytes(); + + /** + * <code>repeated .TestResult.CoverageBlock coverage_block = 7;</code> + */ + java.util.List<org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock> + getCoverageBlockList(); + /** + * <code>repeated .TestResult.CoverageBlock coverage_block = 7;</code> + */ + org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock getCoverageBlock(int index); + /** + * <code>repeated .TestResult.CoverageBlock coverage_block = 7;</code> + */ + int getCoverageBlockCount(); + /** + * <code>repeated .TestResult.CoverageBlock coverage_block = 7;</code> + */ + java.util.List<? extends org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlockOrBuilder> + getCoverageBlockOrBuilderList(); + /** + * <code>repeated .TestResult.CoverageBlock coverage_block = 7;</code> + */ + org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlockOrBuilder getCoverageBlockOrBuilder( + int index); + } + /** + * Protobuf type {@code TestResult} + */ + public static final class TestResult 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) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private TestResult(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final TestResult defaultInstance; + public static TestResult getDefaultInstance() { + return defaultInstance; + } + + public TestResult getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private TestResult( + 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 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: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000020; + msg_ = bs; + break; + } + case 58: { + if (!((mutable_bitField0_ & 0x00000040) == 0x00000040)) { + coverageBlock_ = new java.util.ArrayList<org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock>(); + mutable_bitField0_ |= 0x00000040; + } + coverageBlock_.add(input.readMessage(org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock.PARSER, extensionRegistry)); + 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 { + if (((mutable_bitField0_ & 0x00000040) == 0x00000040)) { + coverageBlock_ = java.util.Collections.unmodifiableList(coverageBlock_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.sonar.batch.protocol.output.BatchReport.internal_static_TestResult_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.sonar.batch.protocol.output.BatchReport.internal_static_TestResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.sonar.batch.protocol.output.BatchReport.TestResult.class, org.sonar.batch.protocol.output.BatchReport.TestResult.Builder.class); + } + + public static com.google.protobuf.Parser<TestResult> PARSER = + new com.google.protobuf.AbstractParser<TestResult>() { + public TestResult parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TestResult(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser<TestResult> getParserForType() { + return PARSER; + } + + public interface CoverageBlockOrBuilder extends + // @@protoc_insertion_point(interface_extends:TestResult.CoverageBlock) + com.google.protobuf.MessageOrBuilder { + + /** + * <code>optional int32 file_ref = 1;</code> + */ + boolean hasFileRef(); + /** + * <code>optional int32 file_ref = 1;</code> + */ + int getFileRef(); + + /** + * <code>repeated int32 line = 2;</code> + */ + java.util.List<java.lang.Integer> getLineList(); + /** + * <code>repeated int32 line = 2;</code> + */ + int getLineCount(); + /** + * <code>repeated int32 line = 2;</code> + */ + int getLine(int index); + } + /** + * Protobuf type {@code TestResult.CoverageBlock} + */ + public static final class CoverageBlock 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) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private CoverageBlock(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final CoverageBlock defaultInstance; + public static CoverageBlock getDefaultInstance() { + return defaultInstance; + } + + public CoverageBlock getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CoverageBlock( + 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 8: { + bitField0_ |= 0x00000001; + fileRef_ = input.readInt32(); + break; + } + case 16: { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + line_ = new java.util.ArrayList<java.lang.Integer>(); + mutable_bitField0_ |= 0x00000002; + } + line_.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<java.lang.Integer>(); + mutable_bitField0_ |= 0x00000002; + } + while (input.getBytesUntilLimit() > 0) { + line_.add(input.readInt32()); + } + input.popLimit(limit); + 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 { + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + line_ = java.util.Collections.unmodifiableList(line_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.sonar.batch.protocol.output.BatchReport.internal_static_TestResult_CoverageBlock_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.sonar.batch.protocol.output.BatchReport.internal_static_TestResult_CoverageBlock_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock.class, org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock.Builder.class); + } + + public static com.google.protobuf.Parser<CoverageBlock> PARSER = + new com.google.protobuf.AbstractParser<CoverageBlock>() { + public CoverageBlock parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CoverageBlock(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser<CoverageBlock> getParserForType() { + return PARSER; + } + + private int bitField0_; + public static final int FILE_REF_FIELD_NUMBER = 1; + private int fileRef_; + /** + * <code>optional int32 file_ref = 1;</code> + */ + public boolean hasFileRef() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * <code>optional int32 file_ref = 1;</code> + */ + public int getFileRef() { + return fileRef_; + } + + public static final int LINE_FIELD_NUMBER = 2; + private java.util.List<java.lang.Integer> line_; + /** + * <code>repeated int32 line = 2;</code> + */ + public java.util.List<java.lang.Integer> + getLineList() { + return line_; + } + /** + * <code>repeated int32 line = 2;</code> + */ + public int getLineCount() { + return line_.size(); + } + /** + * <code>repeated int32 line = 2;</code> + */ + public int getLine(int index) { + return line_.get(index); + } + + private void initFields() { + fileRef_ = 0; + line_ = java.util.Collections.emptyList(); + } + 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.writeInt32(1, fileRef_); + } + for (int i = 0; i < line_.size(); i++) { + output.writeInt32(2, line_.get(i)); + } + 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 + .computeInt32Size(1, fileRef_); + } + { + int dataSize = 0; + for (int i = 0; i < line_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(line_.get(i)); + } + size += dataSize; + size += 1 * getLineList().size(); + } + 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.TestResult.CoverageBlock 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( + 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) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock 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) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock 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) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock 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( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock 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.TestResult.CoverageBlock 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 TestResult.CoverageBlock} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:TestResult.CoverageBlock) + org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlockOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.sonar.batch.protocol.output.BatchReport.internal_static_TestResult_CoverageBlock_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.sonar.batch.protocol.output.BatchReport.internal_static_TestResult_CoverageBlock_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock.class, org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock.Builder.class); + } + + // Construct using org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock.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(); + fileRef_ = 0; + bitField0_ = (bitField0_ & ~0x00000001); + line_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + 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_TestResult_CoverageBlock_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.TestResult.CoverageBlock build() { + org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock 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); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.fileRef_ = fileRef_; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + line_ = java.util.Collections.unmodifiableList(line_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.line_ = line_; + 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); + } 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; + if (other.hasFileRef()) { + setFileRef(other.getFileRef()); + } + if (!other.line_.isEmpty()) { + if (line_.isEmpty()) { + line_ = other.line_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureLineIsMutable(); + line_.addAll(other.line_); + } + 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.TestResult.CoverageBlock 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(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private int fileRef_ ; + /** + * <code>optional int32 file_ref = 1;</code> + */ + public boolean hasFileRef() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * <code>optional int32 file_ref = 1;</code> + */ + public int getFileRef() { + return fileRef_; + } + /** + * <code>optional int32 file_ref = 1;</code> + */ + public Builder setFileRef(int value) { + bitField0_ |= 0x00000001; + fileRef_ = value; + onChanged(); + return this; + } + /** + * <code>optional int32 file_ref = 1;</code> + */ + public Builder clearFileRef() { + bitField0_ = (bitField0_ & ~0x00000001); + fileRef_ = 0; + onChanged(); + return this; + } + + private java.util.List<java.lang.Integer> line_ = java.util.Collections.emptyList(); + private void ensureLineIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + line_ = new java.util.ArrayList<java.lang.Integer>(line_); + bitField0_ |= 0x00000002; + } + } + /** + * <code>repeated int32 line = 2;</code> + */ + public java.util.List<java.lang.Integer> + getLineList() { + return java.util.Collections.unmodifiableList(line_); + } + /** + * <code>repeated int32 line = 2;</code> + */ + public int getLineCount() { + return line_.size(); + } + /** + * <code>repeated int32 line = 2;</code> + */ + public int getLine(int index) { + return line_.get(index); + } + /** + * <code>repeated int32 line = 2;</code> + */ + public Builder setLine( + int index, int value) { + ensureLineIsMutable(); + line_.set(index, value); + onChanged(); + return this; + } + /** + * <code>repeated int32 line = 2;</code> + */ + public Builder addLine(int value) { + ensureLineIsMutable(); + line_.add(value); + onChanged(); + return this; + } + /** + * <code>repeated int32 line = 2;</code> + */ + public Builder addAllLine( + java.lang.Iterable<? extends java.lang.Integer> values) { + ensureLineIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, line_); + onChanged(); + return this; + } + /** + * <code>repeated int32 line = 2;</code> + */ + public Builder clearLine() { + line_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:TestResult.CoverageBlock) + } + + static { + defaultInstance = new CoverageBlock(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:TestResult.CoverageBlock) + } + + private int bitField0_; + public static final int TEST_FILE_REF_FIELD_NUMBER = 1; + private int testFileRef_; + /** + * <code>optional int32 test_file_ref = 1;</code> + */ + public boolean hasTestFileRef() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * <code>optional int32 test_file_ref = 1;</code> + */ + public int getTestFileRef() { + return testFileRef_; + } + + public static final int TYPE_FIELD_NUMBER = 2; + private org.sonar.batch.protocol.Constants.TestType type_; + /** + * <code>optional .TestType type = 2;</code> + */ + public boolean hasType() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * <code>optional .TestType type = 2;</code> + */ + 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_; + /** + * <code>optional .TestResultStatus status = 3;</code> + */ + public boolean hasStatus() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * <code>optional .TestResultStatus status = 3;</code> + */ + public org.sonar.batch.protocol.Constants.TestResultStatus getStatus() { + return status_; + } + + public static final int DURATION_IN_MS_FIELD_NUMBER = 4; + private long durationInMs_; + /** + * <code>optional int64 duration_in_ms = 4;</code> + */ + public boolean hasDurationInMs() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * <code>optional int64 duration_in_ms = 4;</code> + */ + public long getDurationInMs() { + return durationInMs_; + } + + public static final int STACKTRACE_FIELD_NUMBER = 5; + private java.lang.Object stacktrace_; + /** + * <code>optional string stacktrace = 5;</code> + */ + public boolean hasStacktrace() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * <code>optional string stacktrace = 5;</code> + */ + 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; + } + } + /** + * <code>optional string stacktrace = 5;</code> + */ + 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_; + /** + * <code>optional string msg = 6;</code> + */ + public boolean hasMsg() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * <code>optional string msg = 6;</code> + */ + 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; + } + } + /** + * <code>optional string msg = 6;</code> + */ + 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; + } + } + + public static final int COVERAGE_BLOCK_FIELD_NUMBER = 7; + private java.util.List<org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock> coverageBlock_; + /** + * <code>repeated .TestResult.CoverageBlock coverage_block = 7;</code> + */ + public java.util.List<org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock> getCoverageBlockList() { + return coverageBlock_; + } + /** + * <code>repeated .TestResult.CoverageBlock coverage_block = 7;</code> + */ + public java.util.List<? extends org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlockOrBuilder> + getCoverageBlockOrBuilderList() { + return coverageBlock_; + } + /** + * <code>repeated .TestResult.CoverageBlock coverage_block = 7;</code> + */ + public int getCoverageBlockCount() { + return coverageBlock_.size(); + } + /** + * <code>repeated .TestResult.CoverageBlock coverage_block = 7;</code> + */ + public org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock getCoverageBlock(int index) { + return coverageBlock_.get(index); + } + /** + * <code>repeated .TestResult.CoverageBlock coverage_block = 7;</code> + */ + public org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlockOrBuilder getCoverageBlockOrBuilder( + int index) { + return coverageBlock_.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(); + } + 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.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()); + } + for (int i = 0; i < coverageBlock_.size(); i++) { + output.writeMessage(7, coverageBlock_.get(i)); + } + 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 + .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()); + } + for (int i = 0; i < coverageBlock_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, coverageBlock_.get(i)); + } + 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.TestResult 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( + 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) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.sonar.batch.protocol.output.BatchReport.TestResult 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) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.sonar.batch.protocol.output.BatchReport.TestResult 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) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.sonar.batch.protocol.output.BatchReport.TestResult 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( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.sonar.batch.protocol.output.BatchReport.TestResult 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.TestResult 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 TestResult} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:TestResult) + org.sonar.batch.protocol.output.BatchReport.TestResultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.sonar.batch.protocol.output.BatchReport.internal_static_TestResult_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.sonar.batch.protocol.output.BatchReport.internal_static_TestResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.sonar.batch.protocol.output.BatchReport.TestResult.class, org.sonar.batch.protocol.output.BatchReport.TestResult.Builder.class); + } + + // Construct using org.sonar.batch.protocol.output.BatchReport.TestResult.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + getCoverageBlockFieldBuilder(); + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + testFileRef_ = 0; + 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); + } else { + coverageBlockBuilder_.clear(); + } + 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_TestResult_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.TestResult build() { + org.sonar.batch.protocol.output.BatchReport.TestResult 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; + } + result.msg_ = msg_; + if (coverageBlockBuilder_ == null) { + if (((bitField0_ & 0x00000040) == 0x00000040)) { + coverageBlock_ = java.util.Collections.unmodifiableList(coverageBlock_); + bitField0_ = (bitField0_ & ~0x00000040); + } + result.coverageBlock_ = coverageBlock_; + } else { + result.coverageBlock_ = coverageBlockBuilder_.build(); + } + 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) { + return mergeFrom((org.sonar.batch.protocol.output.BatchReport.TestResult)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_; + onChanged(); + } + if (coverageBlockBuilder_ == null) { + if (!other.coverageBlock_.isEmpty()) { + if (coverageBlock_.isEmpty()) { + coverageBlock_ = other.coverageBlock_; + bitField0_ = (bitField0_ & ~0x00000040); + } else { + ensureCoverageBlockIsMutable(); + coverageBlock_.addAll(other.coverageBlock_); + } + onChanged(); + } + } else { + if (!other.coverageBlock_.isEmpty()) { + if (coverageBlockBuilder_.isEmpty()) { + coverageBlockBuilder_.dispose(); + coverageBlockBuilder_ = null; + coverageBlock_ = other.coverageBlock_; + bitField0_ = (bitField0_ & ~0x00000040); + coverageBlockBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getCoverageBlockFieldBuilder() : null; + } else { + coverageBlockBuilder_.addAllMessages(other.coverageBlock_); + } + } + } + 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.TestResult parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.sonar.batch.protocol.output.BatchReport.TestResult) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private int testFileRef_ ; + /** + * <code>optional int32 test_file_ref = 1;</code> + */ + public boolean hasTestFileRef() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * <code>optional int32 test_file_ref = 1;</code> + */ + public int getTestFileRef() { + return testFileRef_; + } + /** + * <code>optional int32 test_file_ref = 1;</code> + */ + public Builder setTestFileRef(int value) { + bitField0_ |= 0x00000001; + testFileRef_ = value; + onChanged(); + return this; + } + /** + * <code>optional int32 test_file_ref = 1;</code> + */ + 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; + /** + * <code>optional .TestType type = 2;</code> + */ + public boolean hasType() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * <code>optional .TestType type = 2;</code> + */ + public org.sonar.batch.protocol.Constants.TestType getType() { + return type_; + } + /** + * <code>optional .TestType type = 2;</code> + */ + public Builder setType(org.sonar.batch.protocol.Constants.TestType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + type_ = value; + onChanged(); + return this; + } + /** + * <code>optional .TestType type = 2;</code> + */ + 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; + /** + * <code>optional .TestResultStatus status = 3;</code> + */ + public boolean hasStatus() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * <code>optional .TestResultStatus status = 3;</code> + */ + public org.sonar.batch.protocol.Constants.TestResultStatus getStatus() { + return status_; + } + /** + * <code>optional .TestResultStatus status = 3;</code> + */ + public Builder setStatus(org.sonar.batch.protocol.Constants.TestResultStatus value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + status_ = value; + onChanged(); + return this; + } + /** + * <code>optional .TestResultStatus status = 3;</code> + */ + public Builder clearStatus() { + bitField0_ = (bitField0_ & ~0x00000004); + status_ = org.sonar.batch.protocol.Constants.TestResultStatus.OK; + onChanged(); + return this; + } + + private long durationInMs_ ; + /** + * <code>optional int64 duration_in_ms = 4;</code> + */ + public boolean hasDurationInMs() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * <code>optional int64 duration_in_ms = 4;</code> + */ + public long getDurationInMs() { + return durationInMs_; + } + /** + * <code>optional int64 duration_in_ms = 4;</code> + */ + public Builder setDurationInMs(long value) { + bitField0_ |= 0x00000008; + durationInMs_ = value; + onChanged(); + return this; + } + /** + * <code>optional int64 duration_in_ms = 4;</code> + */ + public Builder clearDurationInMs() { + bitField0_ = (bitField0_ & ~0x00000008); + durationInMs_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object stacktrace_ = ""; + /** + * <code>optional string stacktrace = 5;</code> + */ + public boolean hasStacktrace() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * <code>optional string stacktrace = 5;</code> + */ + 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; + } + } + /** + * <code>optional string stacktrace = 5;</code> + */ + 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; + } + } + /** + * <code>optional string stacktrace = 5;</code> + */ + public Builder setStacktrace( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + stacktrace_ = value; + onChanged(); + return this; + } + /** + * <code>optional string stacktrace = 5;</code> + */ + public Builder clearStacktrace() { + bitField0_ = (bitField0_ & ~0x00000010); + stacktrace_ = getDefaultInstance().getStacktrace(); + onChanged(); + return this; + } + /** + * <code>optional string stacktrace = 5;</code> + */ + 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_ = ""; + /** + * <code>optional string msg = 6;</code> + */ + public boolean hasMsg() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * <code>optional string msg = 6;</code> + */ + 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; + } + } + /** + * <code>optional string msg = 6;</code> + */ + 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; + } + } + /** + * <code>optional string msg = 6;</code> + */ + public Builder setMsg( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + msg_ = value; + onChanged(); + return this; + } + /** + * <code>optional string msg = 6;</code> + */ + public Builder clearMsg() { + bitField0_ = (bitField0_ & ~0x00000020); + msg_ = getDefaultInstance().getMsg(); + onChanged(); + return this; + } + /** + * <code>optional string msg = 6;</code> + */ + public Builder setMsgBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + msg_ = value; + onChanged(); + return this; + } + + private java.util.List<org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock> coverageBlock_ = + java.util.Collections.emptyList(); + private void ensureCoverageBlockIsMutable() { + if (!((bitField0_ & 0x00000040) == 0x00000040)) { + coverageBlock_ = new java.util.ArrayList<org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock>(coverageBlock_); + bitField0_ |= 0x00000040; + } + } + + 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_; + + /** + * <code>repeated .TestResult.CoverageBlock coverage_block = 7;</code> + */ + public java.util.List<org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock> getCoverageBlockList() { + if (coverageBlockBuilder_ == null) { + return java.util.Collections.unmodifiableList(coverageBlock_); + } else { + return coverageBlockBuilder_.getMessageList(); + } + } + /** + * <code>repeated .TestResult.CoverageBlock coverage_block = 7;</code> + */ + public int getCoverageBlockCount() { + if (coverageBlockBuilder_ == null) { + return coverageBlock_.size(); + } else { + return coverageBlockBuilder_.getCount(); + } + } + /** + * <code>repeated .TestResult.CoverageBlock coverage_block = 7;</code> + */ + public org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock getCoverageBlock(int index) { + if (coverageBlockBuilder_ == null) { + return coverageBlock_.get(index); + } else { + return coverageBlockBuilder_.getMessage(index); + } + } + /** + * <code>repeated .TestResult.CoverageBlock coverage_block = 7;</code> + */ + public Builder setCoverageBlock( + int index, org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock value) { + if (coverageBlockBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCoverageBlockIsMutable(); + coverageBlock_.set(index, value); + onChanged(); + } else { + coverageBlockBuilder_.setMessage(index, value); + } + return this; + } + /** + * <code>repeated .TestResult.CoverageBlock coverage_block = 7;</code> + */ + public Builder setCoverageBlock( + int index, org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock.Builder builderForValue) { + if (coverageBlockBuilder_ == null) { + ensureCoverageBlockIsMutable(); + coverageBlock_.set(index, builderForValue.build()); + onChanged(); + } else { + coverageBlockBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * <code>repeated .TestResult.CoverageBlock coverage_block = 7;</code> + */ + public Builder addCoverageBlock(org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock value) { + if (coverageBlockBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCoverageBlockIsMutable(); + coverageBlock_.add(value); + onChanged(); + } else { + coverageBlockBuilder_.addMessage(value); + } + return this; + } + /** + * <code>repeated .TestResult.CoverageBlock coverage_block = 7;</code> + */ + public Builder addCoverageBlock( + int index, org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock value) { + if (coverageBlockBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCoverageBlockIsMutable(); + coverageBlock_.add(index, value); + onChanged(); + } else { + coverageBlockBuilder_.addMessage(index, value); + } + return this; + } + /** + * <code>repeated .TestResult.CoverageBlock coverage_block = 7;</code> + */ + public Builder addCoverageBlock( + org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock.Builder builderForValue) { + if (coverageBlockBuilder_ == null) { + ensureCoverageBlockIsMutable(); + coverageBlock_.add(builderForValue.build()); + onChanged(); + } else { + coverageBlockBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * <code>repeated .TestResult.CoverageBlock coverage_block = 7;</code> + */ + public Builder addCoverageBlock( + int index, org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock.Builder builderForValue) { + if (coverageBlockBuilder_ == null) { + ensureCoverageBlockIsMutable(); + coverageBlock_.add(index, builderForValue.build()); + onChanged(); + } else { + coverageBlockBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * <code>repeated .TestResult.CoverageBlock coverage_block = 7;</code> + */ + public Builder addAllCoverageBlock( + java.lang.Iterable<? extends org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock> values) { + if (coverageBlockBuilder_ == null) { + ensureCoverageBlockIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, coverageBlock_); + onChanged(); + } else { + coverageBlockBuilder_.addAllMessages(values); + } + return this; + } + /** + * <code>repeated .TestResult.CoverageBlock coverage_block = 7;</code> + */ + public Builder clearCoverageBlock() { + if (coverageBlockBuilder_ == null) { + coverageBlock_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + } else { + coverageBlockBuilder_.clear(); + } + return this; + } + /** + * <code>repeated .TestResult.CoverageBlock coverage_block = 7;</code> + */ + public Builder removeCoverageBlock(int index) { + if (coverageBlockBuilder_ == null) { + ensureCoverageBlockIsMutable(); + coverageBlock_.remove(index); + onChanged(); + } else { + coverageBlockBuilder_.remove(index); + } + return this; + } + /** + * <code>repeated .TestResult.CoverageBlock coverage_block = 7;</code> + */ + public org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock.Builder getCoverageBlockBuilder( + int index) { + return getCoverageBlockFieldBuilder().getBuilder(index); + } + /** + * <code>repeated .TestResult.CoverageBlock coverage_block = 7;</code> + */ + public org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlockOrBuilder getCoverageBlockOrBuilder( + int index) { + if (coverageBlockBuilder_ == null) { + return coverageBlock_.get(index); } else { + return coverageBlockBuilder_.getMessageOrBuilder(index); + } + } + /** + * <code>repeated .TestResult.CoverageBlock coverage_block = 7;</code> + */ + public java.util.List<? extends org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlockOrBuilder> + getCoverageBlockOrBuilderList() { + if (coverageBlockBuilder_ != null) { + return coverageBlockBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(coverageBlock_); + } + } + /** + * <code>repeated .TestResult.CoverageBlock coverage_block = 7;</code> + */ + public org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock.Builder addCoverageBlockBuilder() { + return getCoverageBlockFieldBuilder().addBuilder( + org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock.getDefaultInstance()); + } + /** + * <code>repeated .TestResult.CoverageBlock coverage_block = 7;</code> + */ + public org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock.Builder addCoverageBlockBuilder( + int index) { + return getCoverageBlockFieldBuilder().addBuilder( + index, org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock.getDefaultInstance()); + } + /** + * <code>repeated .TestResult.CoverageBlock coverage_block = 7;</code> + */ + public java.util.List<org.sonar.batch.protocol.output.BatchReport.TestResult.CoverageBlock.Builder> + getCoverageBlockBuilderList() { + return getCoverageBlockFieldBuilder().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), + getParentForChildren(), + isClean()); + coverageBlock_ = null; + } + return coverageBlockBuilder_; + } + + // @@protoc_insertion_point(builder_scope:TestResult) + } + + static { + defaultInstance = new TestResult(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:TestResult) + } + private static final com.google.protobuf.Descriptors.Descriptor internal_static_Metadata_descriptor; private static @@ -21171,6 +23046,16 @@ public final class BatchReport { private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_SyntaxHighlighting_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_TestResult_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_TestResult_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_TestResult_CoverageBlock_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_TestResult_CoverageBlock_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -21247,8 +23132,14 @@ 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.HighlightingTypeB#\n\037org.sonar.ba" + - "tch.protocol.outputH\001" + "\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" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { @@ -21371,6 +23262,18 @@ public final class BatchReport { com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_SyntaxHighlighting_descriptor, new java.lang.String[] { "Range", "Type", }); + internal_static_TestResult_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_TestResult_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 + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_TestResult_CoverageBlock_descriptor, + new java.lang.String[] { "FileRef", "Line", }); org.sonar.batch.protocol.Constants.getDescriptor(); } diff --git a/sonar-batch-protocol/src/main/gen-java/org/sonar/server/source/db/FileSourceTestDb.java b/sonar-batch-protocol/src/main/gen-java/org/sonar/server/source/db/FileSourceTestDb.java new file mode 100644 index 00000000000..ac69f62aa29 --- /dev/null +++ b/sonar-batch-protocol/src/main/gen-java/org/sonar/server/source/db/FileSourceTestDb.java @@ -0,0 +1,3400 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: file_source_test_db.proto + +package org.sonar.server.source.db; + +public final class FileSourceTestDb { + private FileSourceTestDb() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + } + public interface TestOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.sonar.server.source.db.Test) + com.google.protobuf.MessageOrBuilder { + + /** + * <code>optional string uuid = 1;</code> + */ + boolean hasUuid(); + /** + * <code>optional string uuid = 1;</code> + */ + java.lang.String getUuid(); + /** + * <code>optional string uuid = 1;</code> + */ + com.google.protobuf.ByteString + getUuidBytes(); + + /** + * <code>optional string key = 2;</code> + */ + boolean hasKey(); + /** + * <code>optional string key = 2;</code> + */ + java.lang.String getKey(); + /** + * <code>optional string key = 2;</code> + */ + com.google.protobuf.ByteString + getKeyBytes(); + + /** + * <code>optional string method_name = 3;</code> + */ + boolean hasMethodName(); + /** + * <code>optional string method_name = 3;</code> + */ + java.lang.String getMethodName(); + /** + * <code>optional string method_name = 3;</code> + */ + com.google.protobuf.ByteString + getMethodNameBytes(); + + /** + * <code>optional string status = 4;</code> + */ + boolean hasStatus(); + /** + * <code>optional string status = 4;</code> + */ + java.lang.String getStatus(); + /** + * <code>optional string status = 4;</code> + */ + com.google.protobuf.ByteString + getStatusBytes(); + + /** + * <code>optional string test_message = 5;</code> + */ + boolean hasTestMessage(); + /** + * <code>optional string test_message = 5;</code> + */ + java.lang.String getTestMessage(); + /** + * <code>optional string test_message = 5;</code> + */ + com.google.protobuf.ByteString + getTestMessageBytes(); + + /** + * <code>optional string type = 6;</code> + */ + boolean hasType(); + /** + * <code>optional string type = 6;</code> + */ + java.lang.String getType(); + /** + * <code>optional string type = 6;</code> + */ + com.google.protobuf.ByteString + getTypeBytes(); + + /** + * <code>repeated .org.sonar.server.source.db.Test.CoverageBlock coverage_block = 7;</code> + */ + java.util.List<org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock> + getCoverageBlockList(); + /** + * <code>repeated .org.sonar.server.source.db.Test.CoverageBlock coverage_block = 7;</code> + */ + org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock getCoverageBlock(int index); + /** + * <code>repeated .org.sonar.server.source.db.Test.CoverageBlock coverage_block = 7;</code> + */ + int getCoverageBlockCount(); + /** + * <code>repeated .org.sonar.server.source.db.Test.CoverageBlock coverage_block = 7;</code> + */ + java.util.List<? extends org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlockOrBuilder> + getCoverageBlockOrBuilderList(); + /** + * <code>repeated .org.sonar.server.source.db.Test.CoverageBlock coverage_block = 7;</code> + */ + org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlockOrBuilder getCoverageBlockOrBuilder( + int index); + } + /** + * Protobuf type {@code org.sonar.server.source.db.Test} + */ + public static final class Test extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:org.sonar.server.source.db.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; + uuid_ = bs; + break; + } + case 18: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000002; + key_ = bs; + break; + } + case 26: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000004; + methodName_ = bs; + break; + } + case 34: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000008; + status_ = bs; + break; + } + case 42: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000010; + testMessage_ = bs; + break; + } + case 50: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000020; + type_ = bs; + break; + } + case 58: { + if (!((mutable_bitField0_ & 0x00000040) == 0x00000040)) { + coverageBlock_ = new java.util.ArrayList<org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock>(); + mutable_bitField0_ |= 0x00000040; + } + coverageBlock_.add(input.readMessage(org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock.PARSER, extensionRegistry)); + 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 { + if (((mutable_bitField0_ & 0x00000040) == 0x00000040)) { + coverageBlock_ = java.util.Collections.unmodifiableList(coverageBlock_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.sonar.server.source.db.FileSourceTestDb.internal_static_org_sonar_server_source_db_Test_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.sonar.server.source.db.FileSourceTestDb.internal_static_org_sonar_server_source_db_Test_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.sonar.server.source.db.FileSourceTestDb.Test.class, org.sonar.server.source.db.FileSourceTestDb.Test.Builder.class); + } + + public static com.google.protobuf.Parser<Test> PARSER = + new com.google.protobuf.AbstractParser<Test>() { + 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<Test> getParserForType() { + return PARSER; + } + + public interface CoverageBlockOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.sonar.server.source.db.Test.CoverageBlock) + com.google.protobuf.MessageOrBuilder { + + /** + * <code>optional string uuid = 1;</code> + */ + boolean hasUuid(); + /** + * <code>optional string uuid = 1;</code> + */ + java.lang.String getUuid(); + /** + * <code>optional string uuid = 1;</code> + */ + com.google.protobuf.ByteString + getUuidBytes(); + + /** + * <code>optional string key = 2;</code> + */ + boolean hasKey(); + /** + * <code>optional string key = 2;</code> + */ + java.lang.String getKey(); + /** + * <code>optional string key = 2;</code> + */ + com.google.protobuf.ByteString + getKeyBytes(); + + /** + * <code>optional string long_name = 3;</code> + */ + boolean hasLongName(); + /** + * <code>optional string long_name = 3;</code> + */ + java.lang.String getLongName(); + /** + * <code>optional string long_name = 3;</code> + */ + com.google.protobuf.ByteString + getLongNameBytes(); + + /** + * <code>repeated int32 lines = 4;</code> + */ + java.util.List<java.lang.Integer> getLinesList(); + /** + * <code>repeated int32 lines = 4;</code> + */ + int getLinesCount(); + /** + * <code>repeated int32 lines = 4;</code> + */ + int getLines(int index); + + /** + * <code>optional int32 nb_covered_lines = 5;</code> + */ + boolean hasNbCoveredLines(); + /** + * <code>optional int32 nb_covered_lines = 5;</code> + */ + int getNbCoveredLines(); + } + /** + * Protobuf type {@code org.sonar.server.source.db.Test.CoverageBlock} + */ + public static final class CoverageBlock extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:org.sonar.server.source.db.Test.CoverageBlock) + CoverageBlockOrBuilder { + // Use CoverageBlock.newBuilder() to construct. + private CoverageBlock(com.google.protobuf.GeneratedMessage.Builder<?> builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private CoverageBlock(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final CoverageBlock defaultInstance; + public static CoverageBlock getDefaultInstance() { + return defaultInstance; + } + + public CoverageBlock getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CoverageBlock( + 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; + uuid_ = bs; + break; + } + case 18: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000002; + key_ = bs; + break; + } + case 26: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000004; + longName_ = bs; + break; + } + case 32: { + if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + lines_ = new java.util.ArrayList<java.lang.Integer>(); + mutable_bitField0_ |= 0x00000008; + } + lines_.add(input.readInt32()); + break; + } + case 34: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00000008) == 0x00000008) && input.getBytesUntilLimit() > 0) { + lines_ = new java.util.ArrayList<java.lang.Integer>(); + mutable_bitField0_ |= 0x00000008; + } + while (input.getBytesUntilLimit() > 0) { + lines_.add(input.readInt32()); + } + input.popLimit(limit); + break; + } + case 40: { + bitField0_ |= 0x00000008; + nbCoveredLines_ = input.readInt32(); + 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 { + if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + lines_ = java.util.Collections.unmodifiableList(lines_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.sonar.server.source.db.FileSourceTestDb.internal_static_org_sonar_server_source_db_Test_CoverageBlock_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.sonar.server.source.db.FileSourceTestDb.internal_static_org_sonar_server_source_db_Test_CoverageBlock_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock.class, org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock.Builder.class); + } + + public static com.google.protobuf.Parser<CoverageBlock> PARSER = + new com.google.protobuf.AbstractParser<CoverageBlock>() { + public CoverageBlock parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CoverageBlock(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser<CoverageBlock> getParserForType() { + return PARSER; + } + + private int bitField0_; + public static final int UUID_FIELD_NUMBER = 1; + private java.lang.Object uuid_; + /** + * <code>optional string uuid = 1;</code> + */ + public boolean hasUuid() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * <code>optional string uuid = 1;</code> + */ + public java.lang.String getUuid() { + java.lang.Object ref = uuid_; + 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()) { + uuid_ = s; + } + return s; + } + } + /** + * <code>optional string uuid = 1;</code> + */ + public com.google.protobuf.ByteString + getUuidBytes() { + java.lang.Object ref = uuid_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + uuid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KEY_FIELD_NUMBER = 2; + private java.lang.Object key_; + /** + * <code>optional string key = 2;</code> + */ + public boolean hasKey() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * <code>optional string key = 2;</code> + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + 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()) { + key_ = s; + } + return s; + } + } + /** + * <code>optional string key = 2;</code> + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LONG_NAME_FIELD_NUMBER = 3; + private java.lang.Object longName_; + /** + * <code>optional string long_name = 3;</code> + */ + public boolean hasLongName() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * <code>optional string long_name = 3;</code> + */ + public java.lang.String getLongName() { + java.lang.Object ref = longName_; + 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()) { + longName_ = s; + } + return s; + } + } + /** + * <code>optional string long_name = 3;</code> + */ + public com.google.protobuf.ByteString + getLongNameBytes() { + java.lang.Object ref = longName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + longName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LINES_FIELD_NUMBER = 4; + private java.util.List<java.lang.Integer> lines_; + /** + * <code>repeated int32 lines = 4;</code> + */ + public java.util.List<java.lang.Integer> + getLinesList() { + return lines_; + } + /** + * <code>repeated int32 lines = 4;</code> + */ + public int getLinesCount() { + return lines_.size(); + } + /** + * <code>repeated int32 lines = 4;</code> + */ + public int getLines(int index) { + return lines_.get(index); + } + + public static final int NB_COVERED_LINES_FIELD_NUMBER = 5; + private int nbCoveredLines_; + /** + * <code>optional int32 nb_covered_lines = 5;</code> + */ + public boolean hasNbCoveredLines() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * <code>optional int32 nb_covered_lines = 5;</code> + */ + public int getNbCoveredLines() { + return nbCoveredLines_; + } + + private void initFields() { + uuid_ = ""; + key_ = ""; + longName_ = ""; + lines_ = java.util.Collections.emptyList(); + nbCoveredLines_ = 0; + } + 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, getUuidBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(2, getKeyBytes()); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeBytes(3, getLongNameBytes()); + } + for (int i = 0; i < lines_.size(); i++) { + output.writeInt32(4, lines_.get(i)); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeInt32(5, nbCoveredLines_); + } + 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, getUuidBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, getKeyBytes()); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(3, getLongNameBytes()); + } + { + int dataSize = 0; + for (int i = 0; i < lines_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(lines_.get(i)); + } + size += dataSize; + size += 1 * getLinesList().size(); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(5, nbCoveredLines_); + } + 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.server.source.db.FileSourceTestDb.Test.CoverageBlock parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock 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.server.source.db.FileSourceTestDb.Test.CoverageBlock parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock 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.server.source.db.FileSourceTestDb.Test.CoverageBlock 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 org.sonar.server.source.db.Test.CoverageBlock} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:org.sonar.server.source.db.Test.CoverageBlock) + org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlockOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.sonar.server.source.db.FileSourceTestDb.internal_static_org_sonar_server_source_db_Test_CoverageBlock_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.sonar.server.source.db.FileSourceTestDb.internal_static_org_sonar_server_source_db_Test_CoverageBlock_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock.class, org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock.Builder.class); + } + + // Construct using org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock.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(); + uuid_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + key_ = ""; + bitField0_ = (bitField0_ & ~0x00000002); + longName_ = ""; + bitField0_ = (bitField0_ & ~0x00000004); + lines_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + nbCoveredLines_ = 0; + bitField0_ = (bitField0_ & ~0x00000010); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.sonar.server.source.db.FileSourceTestDb.internal_static_org_sonar_server_source_db_Test_CoverageBlock_descriptor; + } + + public org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock getDefaultInstanceForType() { + return org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock.getDefaultInstance(); + } + + public org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock build() { + org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock buildPartial() { + org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock result = new org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.uuid_ = uuid_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.key_ = key_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.longName_ = longName_; + if (((bitField0_ & 0x00000008) == 0x00000008)) { + lines_ = java.util.Collections.unmodifiableList(lines_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.lines_ = lines_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000008; + } + result.nbCoveredLines_ = nbCoveredLines_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock) { + return mergeFrom((org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock other) { + if (other == org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock.getDefaultInstance()) return this; + if (other.hasUuid()) { + bitField0_ |= 0x00000001; + uuid_ = other.uuid_; + onChanged(); + } + if (other.hasKey()) { + bitField0_ |= 0x00000002; + key_ = other.key_; + onChanged(); + } + if (other.hasLongName()) { + bitField0_ |= 0x00000004; + longName_ = other.longName_; + onChanged(); + } + if (!other.lines_.isEmpty()) { + if (lines_.isEmpty()) { + lines_ = other.lines_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureLinesIsMutable(); + lines_.addAll(other.lines_); + } + onChanged(); + } + if (other.hasNbCoveredLines()) { + setNbCoveredLines(other.getNbCoveredLines()); + } + 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.server.source.db.FileSourceTestDb.Test.CoverageBlock parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object uuid_ = ""; + /** + * <code>optional string uuid = 1;</code> + */ + public boolean hasUuid() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * <code>optional string uuid = 1;</code> + */ + public java.lang.String getUuid() { + java.lang.Object ref = uuid_; + 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()) { + uuid_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * <code>optional string uuid = 1;</code> + */ + public com.google.protobuf.ByteString + getUuidBytes() { + java.lang.Object ref = uuid_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + uuid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * <code>optional string uuid = 1;</code> + */ + public Builder setUuid( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + uuid_ = value; + onChanged(); + return this; + } + /** + * <code>optional string uuid = 1;</code> + */ + public Builder clearUuid() { + bitField0_ = (bitField0_ & ~0x00000001); + uuid_ = getDefaultInstance().getUuid(); + onChanged(); + return this; + } + /** + * <code>optional string uuid = 1;</code> + */ + public Builder setUuidBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + uuid_ = value; + onChanged(); + return this; + } + + private java.lang.Object key_ = ""; + /** + * <code>optional string key = 2;</code> + */ + public boolean hasKey() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * <code>optional string key = 2;</code> + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + 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()) { + key_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * <code>optional string key = 2;</code> + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * <code>optional string key = 2;</code> + */ + public Builder setKey( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + key_ = value; + onChanged(); + return this; + } + /** + * <code>optional string key = 2;</code> + */ + public Builder clearKey() { + bitField0_ = (bitField0_ & ~0x00000002); + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + /** + * <code>optional string key = 2;</code> + */ + public Builder setKeyBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + key_ = value; + onChanged(); + return this; + } + + private java.lang.Object longName_ = ""; + /** + * <code>optional string long_name = 3;</code> + */ + public boolean hasLongName() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * <code>optional string long_name = 3;</code> + */ + public java.lang.String getLongName() { + java.lang.Object ref = longName_; + 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()) { + longName_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * <code>optional string long_name = 3;</code> + */ + public com.google.protobuf.ByteString + getLongNameBytes() { + java.lang.Object ref = longName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + longName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * <code>optional string long_name = 3;</code> + */ + public Builder setLongName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + longName_ = value; + onChanged(); + return this; + } + /** + * <code>optional string long_name = 3;</code> + */ + public Builder clearLongName() { + bitField0_ = (bitField0_ & ~0x00000004); + longName_ = getDefaultInstance().getLongName(); + onChanged(); + return this; + } + /** + * <code>optional string long_name = 3;</code> + */ + public Builder setLongNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + longName_ = value; + onChanged(); + return this; + } + + private java.util.List<java.lang.Integer> lines_ = java.util.Collections.emptyList(); + private void ensureLinesIsMutable() { + if (!((bitField0_ & 0x00000008) == 0x00000008)) { + lines_ = new java.util.ArrayList<java.lang.Integer>(lines_); + bitField0_ |= 0x00000008; + } + } + /** + * <code>repeated int32 lines = 4;</code> + */ + public java.util.List<java.lang.Integer> + getLinesList() { + return java.util.Collections.unmodifiableList(lines_); + } + /** + * <code>repeated int32 lines = 4;</code> + */ + public int getLinesCount() { + return lines_.size(); + } + /** + * <code>repeated int32 lines = 4;</code> + */ + public int getLines(int index) { + return lines_.get(index); + } + /** + * <code>repeated int32 lines = 4;</code> + */ + public Builder setLines( + int index, int value) { + ensureLinesIsMutable(); + lines_.set(index, value); + onChanged(); + return this; + } + /** + * <code>repeated int32 lines = 4;</code> + */ + public Builder addLines(int value) { + ensureLinesIsMutable(); + lines_.add(value); + onChanged(); + return this; + } + /** + * <code>repeated int32 lines = 4;</code> + */ + public Builder addAllLines( + java.lang.Iterable<? extends java.lang.Integer> values) { + ensureLinesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, lines_); + onChanged(); + return this; + } + /** + * <code>repeated int32 lines = 4;</code> + */ + public Builder clearLines() { + lines_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + private int nbCoveredLines_ ; + /** + * <code>optional int32 nb_covered_lines = 5;</code> + */ + public boolean hasNbCoveredLines() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * <code>optional int32 nb_covered_lines = 5;</code> + */ + public int getNbCoveredLines() { + return nbCoveredLines_; + } + /** + * <code>optional int32 nb_covered_lines = 5;</code> + */ + public Builder setNbCoveredLines(int value) { + bitField0_ |= 0x00000010; + nbCoveredLines_ = value; + onChanged(); + return this; + } + /** + * <code>optional int32 nb_covered_lines = 5;</code> + */ + public Builder clearNbCoveredLines() { + bitField0_ = (bitField0_ & ~0x00000010); + nbCoveredLines_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:org.sonar.server.source.db.Test.CoverageBlock) + } + + static { + defaultInstance = new CoverageBlock(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.sonar.server.source.db.Test.CoverageBlock) + } + + private int bitField0_; + public static final int UUID_FIELD_NUMBER = 1; + private java.lang.Object uuid_; + /** + * <code>optional string uuid = 1;</code> + */ + public boolean hasUuid() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * <code>optional string uuid = 1;</code> + */ + public java.lang.String getUuid() { + java.lang.Object ref = uuid_; + 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()) { + uuid_ = s; + } + return s; + } + } + /** + * <code>optional string uuid = 1;</code> + */ + public com.google.protobuf.ByteString + getUuidBytes() { + java.lang.Object ref = uuid_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + uuid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KEY_FIELD_NUMBER = 2; + private java.lang.Object key_; + /** + * <code>optional string key = 2;</code> + */ + public boolean hasKey() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * <code>optional string key = 2;</code> + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + 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()) { + key_ = s; + } + return s; + } + } + /** + * <code>optional string key = 2;</code> + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int METHOD_NAME_FIELD_NUMBER = 3; + private java.lang.Object methodName_; + /** + * <code>optional string method_name = 3;</code> + */ + public boolean hasMethodName() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * <code>optional string method_name = 3;</code> + */ + public java.lang.String getMethodName() { + java.lang.Object ref = methodName_; + 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()) { + methodName_ = s; + } + return s; + } + } + /** + * <code>optional string method_name = 3;</code> + */ + public com.google.protobuf.ByteString + getMethodNameBytes() { + java.lang.Object ref = methodName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + methodName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATUS_FIELD_NUMBER = 4; + private java.lang.Object status_; + /** + * <code>optional string status = 4;</code> + */ + public boolean hasStatus() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * <code>optional string status = 4;</code> + */ + public java.lang.String getStatus() { + java.lang.Object ref = status_; + 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()) { + status_ = s; + } + return s; + } + } + /** + * <code>optional string status = 4;</code> + */ + public com.google.protobuf.ByteString + getStatusBytes() { + java.lang.Object ref = status_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + status_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TEST_MESSAGE_FIELD_NUMBER = 5; + private java.lang.Object testMessage_; + /** + * <code>optional string test_message = 5;</code> + */ + public boolean hasTestMessage() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * <code>optional string test_message = 5;</code> + */ + public java.lang.String getTestMessage() { + java.lang.Object ref = testMessage_; + 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()) { + testMessage_ = s; + } + return s; + } + } + /** + * <code>optional string test_message = 5;</code> + */ + public com.google.protobuf.ByteString + getTestMessageBytes() { + java.lang.Object ref = testMessage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + testMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TYPE_FIELD_NUMBER = 6; + private java.lang.Object type_; + /** + * <code>optional string type = 6;</code> + */ + public boolean hasType() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * <code>optional string type = 6;</code> + */ + public java.lang.String getType() { + java.lang.Object ref = type_; + 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()) { + type_ = s; + } + return s; + } + } + /** + * <code>optional string type = 6;</code> + */ + public com.google.protobuf.ByteString + getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int COVERAGE_BLOCK_FIELD_NUMBER = 7; + private java.util.List<org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock> coverageBlock_; + /** + * <code>repeated .org.sonar.server.source.db.Test.CoverageBlock coverage_block = 7;</code> + */ + public java.util.List<org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock> getCoverageBlockList() { + return coverageBlock_; + } + /** + * <code>repeated .org.sonar.server.source.db.Test.CoverageBlock coverage_block = 7;</code> + */ + public java.util.List<? extends org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlockOrBuilder> + getCoverageBlockOrBuilderList() { + return coverageBlock_; + } + /** + * <code>repeated .org.sonar.server.source.db.Test.CoverageBlock coverage_block = 7;</code> + */ + public int getCoverageBlockCount() { + return coverageBlock_.size(); + } + /** + * <code>repeated .org.sonar.server.source.db.Test.CoverageBlock coverage_block = 7;</code> + */ + public org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock getCoverageBlock(int index) { + return coverageBlock_.get(index); + } + /** + * <code>repeated .org.sonar.server.source.db.Test.CoverageBlock coverage_block = 7;</code> + */ + public org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlockOrBuilder getCoverageBlockOrBuilder( + int index) { + return coverageBlock_.get(index); + } + + private void initFields() { + uuid_ = ""; + key_ = ""; + methodName_ = ""; + status_ = ""; + testMessage_ = ""; + type_ = ""; + coverageBlock_ = java.util.Collections.emptyList(); + } + 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, getUuidBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(2, getKeyBytes()); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeBytes(3, getMethodNameBytes()); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeBytes(4, getStatusBytes()); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeBytes(5, getTestMessageBytes()); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + output.writeBytes(6, getTypeBytes()); + } + for (int i = 0; i < coverageBlock_.size(); i++) { + output.writeMessage(7, coverageBlock_.get(i)); + } + 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, getUuidBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, getKeyBytes()); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(3, getMethodNameBytes()); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(4, getStatusBytes()); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(5, getTestMessageBytes()); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(6, getTypeBytes()); + } + for (int i = 0; i < coverageBlock_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, coverageBlock_.get(i)); + } + 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.server.source.db.FileSourceTestDb.Test parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.sonar.server.source.db.FileSourceTestDb.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.server.source.db.FileSourceTestDb.Test parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.sonar.server.source.db.FileSourceTestDb.Test parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.sonar.server.source.db.FileSourceTestDb.Test parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.sonar.server.source.db.FileSourceTestDb.Test parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.sonar.server.source.db.FileSourceTestDb.Test parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.sonar.server.source.db.FileSourceTestDb.Test parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.sonar.server.source.db.FileSourceTestDb.Test parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.sonar.server.source.db.FileSourceTestDb.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.server.source.db.FileSourceTestDb.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 org.sonar.server.source.db.Test} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:org.sonar.server.source.db.Test) + org.sonar.server.source.db.FileSourceTestDb.TestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.sonar.server.source.db.FileSourceTestDb.internal_static_org_sonar_server_source_db_Test_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.sonar.server.source.db.FileSourceTestDb.internal_static_org_sonar_server_source_db_Test_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.sonar.server.source.db.FileSourceTestDb.Test.class, org.sonar.server.source.db.FileSourceTestDb.Test.Builder.class); + } + + // Construct using org.sonar.server.source.db.FileSourceTestDb.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) { + getCoverageBlockFieldBuilder(); + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + uuid_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + key_ = ""; + bitField0_ = (bitField0_ & ~0x00000002); + methodName_ = ""; + bitField0_ = (bitField0_ & ~0x00000004); + status_ = ""; + bitField0_ = (bitField0_ & ~0x00000008); + testMessage_ = ""; + bitField0_ = (bitField0_ & ~0x00000010); + type_ = ""; + bitField0_ = (bitField0_ & ~0x00000020); + if (coverageBlockBuilder_ == null) { + coverageBlock_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + } else { + coverageBlockBuilder_.clear(); + } + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.sonar.server.source.db.FileSourceTestDb.internal_static_org_sonar_server_source_db_Test_descriptor; + } + + public org.sonar.server.source.db.FileSourceTestDb.Test getDefaultInstanceForType() { + return org.sonar.server.source.db.FileSourceTestDb.Test.getDefaultInstance(); + } + + public org.sonar.server.source.db.FileSourceTestDb.Test build() { + org.sonar.server.source.db.FileSourceTestDb.Test result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.sonar.server.source.db.FileSourceTestDb.Test buildPartial() { + org.sonar.server.source.db.FileSourceTestDb.Test result = new org.sonar.server.source.db.FileSourceTestDb.Test(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.uuid_ = uuid_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.key_ = key_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.methodName_ = methodName_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.status_ = status_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000010; + } + result.testMessage_ = testMessage_; + if (((from_bitField0_ & 0x00000020) == 0x00000020)) { + to_bitField0_ |= 0x00000020; + } + result.type_ = type_; + if (coverageBlockBuilder_ == null) { + if (((bitField0_ & 0x00000040) == 0x00000040)) { + coverageBlock_ = java.util.Collections.unmodifiableList(coverageBlock_); + bitField0_ = (bitField0_ & ~0x00000040); + } + result.coverageBlock_ = coverageBlock_; + } else { + result.coverageBlock_ = coverageBlockBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.sonar.server.source.db.FileSourceTestDb.Test) { + return mergeFrom((org.sonar.server.source.db.FileSourceTestDb.Test)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.sonar.server.source.db.FileSourceTestDb.Test other) { + if (other == org.sonar.server.source.db.FileSourceTestDb.Test.getDefaultInstance()) return this; + if (other.hasUuid()) { + bitField0_ |= 0x00000001; + uuid_ = other.uuid_; + onChanged(); + } + if (other.hasKey()) { + bitField0_ |= 0x00000002; + key_ = other.key_; + onChanged(); + } + if (other.hasMethodName()) { + bitField0_ |= 0x00000004; + methodName_ = other.methodName_; + onChanged(); + } + if (other.hasStatus()) { + bitField0_ |= 0x00000008; + status_ = other.status_; + onChanged(); + } + if (other.hasTestMessage()) { + bitField0_ |= 0x00000010; + testMessage_ = other.testMessage_; + onChanged(); + } + if (other.hasType()) { + bitField0_ |= 0x00000020; + type_ = other.type_; + onChanged(); + } + if (coverageBlockBuilder_ == null) { + if (!other.coverageBlock_.isEmpty()) { + if (coverageBlock_.isEmpty()) { + coverageBlock_ = other.coverageBlock_; + bitField0_ = (bitField0_ & ~0x00000040); + } else { + ensureCoverageBlockIsMutable(); + coverageBlock_.addAll(other.coverageBlock_); + } + onChanged(); + } + } else { + if (!other.coverageBlock_.isEmpty()) { + if (coverageBlockBuilder_.isEmpty()) { + coverageBlockBuilder_.dispose(); + coverageBlockBuilder_ = null; + coverageBlock_ = other.coverageBlock_; + bitField0_ = (bitField0_ & ~0x00000040); + coverageBlockBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getCoverageBlockFieldBuilder() : null; + } else { + coverageBlockBuilder_.addAllMessages(other.coverageBlock_); + } + } + } + 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.server.source.db.FileSourceTestDb.Test parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.sonar.server.source.db.FileSourceTestDb.Test) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object uuid_ = ""; + /** + * <code>optional string uuid = 1;</code> + */ + public boolean hasUuid() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * <code>optional string uuid = 1;</code> + */ + public java.lang.String getUuid() { + java.lang.Object ref = uuid_; + 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()) { + uuid_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * <code>optional string uuid = 1;</code> + */ + public com.google.protobuf.ByteString + getUuidBytes() { + java.lang.Object ref = uuid_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + uuid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * <code>optional string uuid = 1;</code> + */ + public Builder setUuid( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + uuid_ = value; + onChanged(); + return this; + } + /** + * <code>optional string uuid = 1;</code> + */ + public Builder clearUuid() { + bitField0_ = (bitField0_ & ~0x00000001); + uuid_ = getDefaultInstance().getUuid(); + onChanged(); + return this; + } + /** + * <code>optional string uuid = 1;</code> + */ + public Builder setUuidBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + uuid_ = value; + onChanged(); + return this; + } + + private java.lang.Object key_ = ""; + /** + * <code>optional string key = 2;</code> + */ + public boolean hasKey() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * <code>optional string key = 2;</code> + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + 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()) { + key_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * <code>optional string key = 2;</code> + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * <code>optional string key = 2;</code> + */ + public Builder setKey( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + key_ = value; + onChanged(); + return this; + } + /** + * <code>optional string key = 2;</code> + */ + public Builder clearKey() { + bitField0_ = (bitField0_ & ~0x00000002); + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + /** + * <code>optional string key = 2;</code> + */ + public Builder setKeyBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + key_ = value; + onChanged(); + return this; + } + + private java.lang.Object methodName_ = ""; + /** + * <code>optional string method_name = 3;</code> + */ + public boolean hasMethodName() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * <code>optional string method_name = 3;</code> + */ + public java.lang.String getMethodName() { + java.lang.Object ref = methodName_; + 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()) { + methodName_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * <code>optional string method_name = 3;</code> + */ + public com.google.protobuf.ByteString + getMethodNameBytes() { + java.lang.Object ref = methodName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + methodName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * <code>optional string method_name = 3;</code> + */ + public Builder setMethodName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + methodName_ = value; + onChanged(); + return this; + } + /** + * <code>optional string method_name = 3;</code> + */ + public Builder clearMethodName() { + bitField0_ = (bitField0_ & ~0x00000004); + methodName_ = getDefaultInstance().getMethodName(); + onChanged(); + return this; + } + /** + * <code>optional string method_name = 3;</code> + */ + public Builder setMethodNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + methodName_ = value; + onChanged(); + return this; + } + + private java.lang.Object status_ = ""; + /** + * <code>optional string status = 4;</code> + */ + public boolean hasStatus() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * <code>optional string status = 4;</code> + */ + public java.lang.String getStatus() { + java.lang.Object ref = status_; + 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()) { + status_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * <code>optional string status = 4;</code> + */ + public com.google.protobuf.ByteString + getStatusBytes() { + java.lang.Object ref = status_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + status_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * <code>optional string status = 4;</code> + */ + public Builder setStatus( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + status_ = value; + onChanged(); + return this; + } + /** + * <code>optional string status = 4;</code> + */ + public Builder clearStatus() { + bitField0_ = (bitField0_ & ~0x00000008); + status_ = getDefaultInstance().getStatus(); + onChanged(); + return this; + } + /** + * <code>optional string status = 4;</code> + */ + public Builder setStatusBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + status_ = value; + onChanged(); + return this; + } + + private java.lang.Object testMessage_ = ""; + /** + * <code>optional string test_message = 5;</code> + */ + public boolean hasTestMessage() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * <code>optional string test_message = 5;</code> + */ + public java.lang.String getTestMessage() { + java.lang.Object ref = testMessage_; + 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()) { + testMessage_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * <code>optional string test_message = 5;</code> + */ + public com.google.protobuf.ByteString + getTestMessageBytes() { + java.lang.Object ref = testMessage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + testMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * <code>optional string test_message = 5;</code> + */ + public Builder setTestMessage( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + testMessage_ = value; + onChanged(); + return this; + } + /** + * <code>optional string test_message = 5;</code> + */ + public Builder clearTestMessage() { + bitField0_ = (bitField0_ & ~0x00000010); + testMessage_ = getDefaultInstance().getTestMessage(); + onChanged(); + return this; + } + /** + * <code>optional string test_message = 5;</code> + */ + public Builder setTestMessageBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + testMessage_ = value; + onChanged(); + return this; + } + + private java.lang.Object type_ = ""; + /** + * <code>optional string type = 6;</code> + */ + public boolean hasType() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * <code>optional string type = 6;</code> + */ + public java.lang.String getType() { + java.lang.Object ref = type_; + 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()) { + type_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * <code>optional string type = 6;</code> + */ + public com.google.protobuf.ByteString + getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * <code>optional string type = 6;</code> + */ + public Builder setType( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + type_ = value; + onChanged(); + return this; + } + /** + * <code>optional string type = 6;</code> + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000020); + type_ = getDefaultInstance().getType(); + onChanged(); + return this; + } + /** + * <code>optional string type = 6;</code> + */ + public Builder setTypeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + type_ = value; + onChanged(); + return this; + } + + private java.util.List<org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock> coverageBlock_ = + java.util.Collections.emptyList(); + private void ensureCoverageBlockIsMutable() { + if (!((bitField0_ & 0x00000040) == 0x00000040)) { + coverageBlock_ = new java.util.ArrayList<org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock>(coverageBlock_); + bitField0_ |= 0x00000040; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock, org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock.Builder, org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlockOrBuilder> coverageBlockBuilder_; + + /** + * <code>repeated .org.sonar.server.source.db.Test.CoverageBlock coverage_block = 7;</code> + */ + public java.util.List<org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock> getCoverageBlockList() { + if (coverageBlockBuilder_ == null) { + return java.util.Collections.unmodifiableList(coverageBlock_); + } else { + return coverageBlockBuilder_.getMessageList(); + } + } + /** + * <code>repeated .org.sonar.server.source.db.Test.CoverageBlock coverage_block = 7;</code> + */ + public int getCoverageBlockCount() { + if (coverageBlockBuilder_ == null) { + return coverageBlock_.size(); + } else { + return coverageBlockBuilder_.getCount(); + } + } + /** + * <code>repeated .org.sonar.server.source.db.Test.CoverageBlock coverage_block = 7;</code> + */ + public org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock getCoverageBlock(int index) { + if (coverageBlockBuilder_ == null) { + return coverageBlock_.get(index); + } else { + return coverageBlockBuilder_.getMessage(index); + } + } + /** + * <code>repeated .org.sonar.server.source.db.Test.CoverageBlock coverage_block = 7;</code> + */ + public Builder setCoverageBlock( + int index, org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock value) { + if (coverageBlockBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCoverageBlockIsMutable(); + coverageBlock_.set(index, value); + onChanged(); + } else { + coverageBlockBuilder_.setMessage(index, value); + } + return this; + } + /** + * <code>repeated .org.sonar.server.source.db.Test.CoverageBlock coverage_block = 7;</code> + */ + public Builder setCoverageBlock( + int index, org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock.Builder builderForValue) { + if (coverageBlockBuilder_ == null) { + ensureCoverageBlockIsMutable(); + coverageBlock_.set(index, builderForValue.build()); + onChanged(); + } else { + coverageBlockBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * <code>repeated .org.sonar.server.source.db.Test.CoverageBlock coverage_block = 7;</code> + */ + public Builder addCoverageBlock(org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock value) { + if (coverageBlockBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCoverageBlockIsMutable(); + coverageBlock_.add(value); + onChanged(); + } else { + coverageBlockBuilder_.addMessage(value); + } + return this; + } + /** + * <code>repeated .org.sonar.server.source.db.Test.CoverageBlock coverage_block = 7;</code> + */ + public Builder addCoverageBlock( + int index, org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock value) { + if (coverageBlockBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCoverageBlockIsMutable(); + coverageBlock_.add(index, value); + onChanged(); + } else { + coverageBlockBuilder_.addMessage(index, value); + } + return this; + } + /** + * <code>repeated .org.sonar.server.source.db.Test.CoverageBlock coverage_block = 7;</code> + */ + public Builder addCoverageBlock( + org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock.Builder builderForValue) { + if (coverageBlockBuilder_ == null) { + ensureCoverageBlockIsMutable(); + coverageBlock_.add(builderForValue.build()); + onChanged(); + } else { + coverageBlockBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * <code>repeated .org.sonar.server.source.db.Test.CoverageBlock coverage_block = 7;</code> + */ + public Builder addCoverageBlock( + int index, org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock.Builder builderForValue) { + if (coverageBlockBuilder_ == null) { + ensureCoverageBlockIsMutable(); + coverageBlock_.add(index, builderForValue.build()); + onChanged(); + } else { + coverageBlockBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * <code>repeated .org.sonar.server.source.db.Test.CoverageBlock coverage_block = 7;</code> + */ + public Builder addAllCoverageBlock( + java.lang.Iterable<? extends org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock> values) { + if (coverageBlockBuilder_ == null) { + ensureCoverageBlockIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, coverageBlock_); + onChanged(); + } else { + coverageBlockBuilder_.addAllMessages(values); + } + return this; + } + /** + * <code>repeated .org.sonar.server.source.db.Test.CoverageBlock coverage_block = 7;</code> + */ + public Builder clearCoverageBlock() { + if (coverageBlockBuilder_ == null) { + coverageBlock_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + } else { + coverageBlockBuilder_.clear(); + } + return this; + } + /** + * <code>repeated .org.sonar.server.source.db.Test.CoverageBlock coverage_block = 7;</code> + */ + public Builder removeCoverageBlock(int index) { + if (coverageBlockBuilder_ == null) { + ensureCoverageBlockIsMutable(); + coverageBlock_.remove(index); + onChanged(); + } else { + coverageBlockBuilder_.remove(index); + } + return this; + } + /** + * <code>repeated .org.sonar.server.source.db.Test.CoverageBlock coverage_block = 7;</code> + */ + public org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock.Builder getCoverageBlockBuilder( + int index) { + return getCoverageBlockFieldBuilder().getBuilder(index); + } + /** + * <code>repeated .org.sonar.server.source.db.Test.CoverageBlock coverage_block = 7;</code> + */ + public org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlockOrBuilder getCoverageBlockOrBuilder( + int index) { + if (coverageBlockBuilder_ == null) { + return coverageBlock_.get(index); } else { + return coverageBlockBuilder_.getMessageOrBuilder(index); + } + } + /** + * <code>repeated .org.sonar.server.source.db.Test.CoverageBlock coverage_block = 7;</code> + */ + public java.util.List<? extends org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlockOrBuilder> + getCoverageBlockOrBuilderList() { + if (coverageBlockBuilder_ != null) { + return coverageBlockBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(coverageBlock_); + } + } + /** + * <code>repeated .org.sonar.server.source.db.Test.CoverageBlock coverage_block = 7;</code> + */ + public org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock.Builder addCoverageBlockBuilder() { + return getCoverageBlockFieldBuilder().addBuilder( + org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock.getDefaultInstance()); + } + /** + * <code>repeated .org.sonar.server.source.db.Test.CoverageBlock coverage_block = 7;</code> + */ + public org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock.Builder addCoverageBlockBuilder( + int index) { + return getCoverageBlockFieldBuilder().addBuilder( + index, org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock.getDefaultInstance()); + } + /** + * <code>repeated .org.sonar.server.source.db.Test.CoverageBlock coverage_block = 7;</code> + */ + public java.util.List<org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock.Builder> + getCoverageBlockBuilderList() { + return getCoverageBlockFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock, org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock.Builder, org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlockOrBuilder> + getCoverageBlockFieldBuilder() { + if (coverageBlockBuilder_ == null) { + coverageBlockBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock, org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock.Builder, org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlockOrBuilder>( + coverageBlock_, + ((bitField0_ & 0x00000040) == 0x00000040), + getParentForChildren(), + isClean()); + coverageBlock_ = null; + } + return coverageBlockBuilder_; + } + + // @@protoc_insertion_point(builder_scope:org.sonar.server.source.db.Test) + } + + static { + defaultInstance = new Test(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.sonar.server.source.db.Test) + } + + public interface TestsOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.sonar.server.source.db.Tests) + com.google.protobuf.MessageOrBuilder { + + /** + * <code>repeated .org.sonar.server.source.db.Test test = 1;</code> + */ + java.util.List<org.sonar.server.source.db.FileSourceTestDb.Test> + getTestList(); + /** + * <code>repeated .org.sonar.server.source.db.Test test = 1;</code> + */ + org.sonar.server.source.db.FileSourceTestDb.Test getTest(int index); + /** + * <code>repeated .org.sonar.server.source.db.Test test = 1;</code> + */ + int getTestCount(); + /** + * <code>repeated .org.sonar.server.source.db.Test test = 1;</code> + */ + java.util.List<? extends org.sonar.server.source.db.FileSourceTestDb.TestOrBuilder> + getTestOrBuilderList(); + /** + * <code>repeated .org.sonar.server.source.db.Test test = 1;</code> + */ + org.sonar.server.source.db.FileSourceTestDb.TestOrBuilder getTestOrBuilder( + int index); + } + /** + * Protobuf type {@code org.sonar.server.source.db.Tests} + */ + public static final class Tests extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:org.sonar.server.source.db.Tests) + TestsOrBuilder { + // Use Tests.newBuilder() to construct. + private Tests(com.google.protobuf.GeneratedMessage.Builder<?> builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private Tests(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final Tests defaultInstance; + public static Tests getDefaultInstance() { + return defaultInstance; + } + + public Tests getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Tests( + 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: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + test_ = new java.util.ArrayList<org.sonar.server.source.db.FileSourceTestDb.Test>(); + mutable_bitField0_ |= 0x00000001; + } + test_.add(input.readMessage(org.sonar.server.source.db.FileSourceTestDb.Test.PARSER, extensionRegistry)); + 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 { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + test_ = java.util.Collections.unmodifiableList(test_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.sonar.server.source.db.FileSourceTestDb.internal_static_org_sonar_server_source_db_Tests_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.sonar.server.source.db.FileSourceTestDb.internal_static_org_sonar_server_source_db_Tests_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.sonar.server.source.db.FileSourceTestDb.Tests.class, org.sonar.server.source.db.FileSourceTestDb.Tests.Builder.class); + } + + public static com.google.protobuf.Parser<Tests> PARSER = + new com.google.protobuf.AbstractParser<Tests>() { + public Tests parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Tests(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser<Tests> getParserForType() { + return PARSER; + } + + public static final int TEST_FIELD_NUMBER = 1; + private java.util.List<org.sonar.server.source.db.FileSourceTestDb.Test> test_; + /** + * <code>repeated .org.sonar.server.source.db.Test test = 1;</code> + */ + public java.util.List<org.sonar.server.source.db.FileSourceTestDb.Test> getTestList() { + return test_; + } + /** + * <code>repeated .org.sonar.server.source.db.Test test = 1;</code> + */ + public java.util.List<? extends org.sonar.server.source.db.FileSourceTestDb.TestOrBuilder> + getTestOrBuilderList() { + return test_; + } + /** + * <code>repeated .org.sonar.server.source.db.Test test = 1;</code> + */ + public int getTestCount() { + return test_.size(); + } + /** + * <code>repeated .org.sonar.server.source.db.Test test = 1;</code> + */ + public org.sonar.server.source.db.FileSourceTestDb.Test getTest(int index) { + return test_.get(index); + } + /** + * <code>repeated .org.sonar.server.source.db.Test test = 1;</code> + */ + public org.sonar.server.source.db.FileSourceTestDb.TestOrBuilder getTestOrBuilder( + int index) { + return test_.get(index); + } + + private void initFields() { + test_ = java.util.Collections.emptyList(); + } + 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(); + for (int i = 0; i < test_.size(); i++) { + output.writeMessage(1, test_.get(i)); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < test_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, test_.get(i)); + } + 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.server.source.db.FileSourceTestDb.Tests parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.sonar.server.source.db.FileSourceTestDb.Tests 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.server.source.db.FileSourceTestDb.Tests parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.sonar.server.source.db.FileSourceTestDb.Tests parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.sonar.server.source.db.FileSourceTestDb.Tests parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.sonar.server.source.db.FileSourceTestDb.Tests parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.sonar.server.source.db.FileSourceTestDb.Tests parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.sonar.server.source.db.FileSourceTestDb.Tests parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.sonar.server.source.db.FileSourceTestDb.Tests parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.sonar.server.source.db.FileSourceTestDb.Tests 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.server.source.db.FileSourceTestDb.Tests 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 org.sonar.server.source.db.Tests} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:org.sonar.server.source.db.Tests) + org.sonar.server.source.db.FileSourceTestDb.TestsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.sonar.server.source.db.FileSourceTestDb.internal_static_org_sonar_server_source_db_Tests_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.sonar.server.source.db.FileSourceTestDb.internal_static_org_sonar_server_source_db_Tests_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.sonar.server.source.db.FileSourceTestDb.Tests.class, org.sonar.server.source.db.FileSourceTestDb.Tests.Builder.class); + } + + // Construct using org.sonar.server.source.db.FileSourceTestDb.Tests.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + getTestFieldBuilder(); + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + if (testBuilder_ == null) { + test_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + testBuilder_.clear(); + } + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.sonar.server.source.db.FileSourceTestDb.internal_static_org_sonar_server_source_db_Tests_descriptor; + } + + public org.sonar.server.source.db.FileSourceTestDb.Tests getDefaultInstanceForType() { + return org.sonar.server.source.db.FileSourceTestDb.Tests.getDefaultInstance(); + } + + public org.sonar.server.source.db.FileSourceTestDb.Tests build() { + org.sonar.server.source.db.FileSourceTestDb.Tests result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.sonar.server.source.db.FileSourceTestDb.Tests buildPartial() { + org.sonar.server.source.db.FileSourceTestDb.Tests result = new org.sonar.server.source.db.FileSourceTestDb.Tests(this); + int from_bitField0_ = bitField0_; + if (testBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + test_ = java.util.Collections.unmodifiableList(test_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.test_ = test_; + } else { + result.test_ = testBuilder_.build(); + } + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.sonar.server.source.db.FileSourceTestDb.Tests) { + return mergeFrom((org.sonar.server.source.db.FileSourceTestDb.Tests)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.sonar.server.source.db.FileSourceTestDb.Tests other) { + if (other == org.sonar.server.source.db.FileSourceTestDb.Tests.getDefaultInstance()) return this; + if (testBuilder_ == null) { + if (!other.test_.isEmpty()) { + if (test_.isEmpty()) { + test_ = other.test_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureTestIsMutable(); + test_.addAll(other.test_); + } + onChanged(); + } + } else { + if (!other.test_.isEmpty()) { + if (testBuilder_.isEmpty()) { + testBuilder_.dispose(); + testBuilder_ = null; + test_ = other.test_; + bitField0_ = (bitField0_ & ~0x00000001); + testBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getTestFieldBuilder() : null; + } else { + testBuilder_.addAllMessages(other.test_); + } + } + } + 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.server.source.db.FileSourceTestDb.Tests parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.sonar.server.source.db.FileSourceTestDb.Tests) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List<org.sonar.server.source.db.FileSourceTestDb.Test> test_ = + java.util.Collections.emptyList(); + private void ensureTestIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + test_ = new java.util.ArrayList<org.sonar.server.source.db.FileSourceTestDb.Test>(test_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.sonar.server.source.db.FileSourceTestDb.Test, org.sonar.server.source.db.FileSourceTestDb.Test.Builder, org.sonar.server.source.db.FileSourceTestDb.TestOrBuilder> testBuilder_; + + /** + * <code>repeated .org.sonar.server.source.db.Test test = 1;</code> + */ + public java.util.List<org.sonar.server.source.db.FileSourceTestDb.Test> getTestList() { + if (testBuilder_ == null) { + return java.util.Collections.unmodifiableList(test_); + } else { + return testBuilder_.getMessageList(); + } + } + /** + * <code>repeated .org.sonar.server.source.db.Test test = 1;</code> + */ + public int getTestCount() { + if (testBuilder_ == null) { + return test_.size(); + } else { + return testBuilder_.getCount(); + } + } + /** + * <code>repeated .org.sonar.server.source.db.Test test = 1;</code> + */ + public org.sonar.server.source.db.FileSourceTestDb.Test getTest(int index) { + if (testBuilder_ == null) { + return test_.get(index); + } else { + return testBuilder_.getMessage(index); + } + } + /** + * <code>repeated .org.sonar.server.source.db.Test test = 1;</code> + */ + public Builder setTest( + int index, org.sonar.server.source.db.FileSourceTestDb.Test value) { + if (testBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTestIsMutable(); + test_.set(index, value); + onChanged(); + } else { + testBuilder_.setMessage(index, value); + } + return this; + } + /** + * <code>repeated .org.sonar.server.source.db.Test test = 1;</code> + */ + public Builder setTest( + int index, org.sonar.server.source.db.FileSourceTestDb.Test.Builder builderForValue) { + if (testBuilder_ == null) { + ensureTestIsMutable(); + test_.set(index, builderForValue.build()); + onChanged(); + } else { + testBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * <code>repeated .org.sonar.server.source.db.Test test = 1;</code> + */ + public Builder addTest(org.sonar.server.source.db.FileSourceTestDb.Test value) { + if (testBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTestIsMutable(); + test_.add(value); + onChanged(); + } else { + testBuilder_.addMessage(value); + } + return this; + } + /** + * <code>repeated .org.sonar.server.source.db.Test test = 1;</code> + */ + public Builder addTest( + int index, org.sonar.server.source.db.FileSourceTestDb.Test value) { + if (testBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTestIsMutable(); + test_.add(index, value); + onChanged(); + } else { + testBuilder_.addMessage(index, value); + } + return this; + } + /** + * <code>repeated .org.sonar.server.source.db.Test test = 1;</code> + */ + public Builder addTest( + org.sonar.server.source.db.FileSourceTestDb.Test.Builder builderForValue) { + if (testBuilder_ == null) { + ensureTestIsMutable(); + test_.add(builderForValue.build()); + onChanged(); + } else { + testBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * <code>repeated .org.sonar.server.source.db.Test test = 1;</code> + */ + public Builder addTest( + int index, org.sonar.server.source.db.FileSourceTestDb.Test.Builder builderForValue) { + if (testBuilder_ == null) { + ensureTestIsMutable(); + test_.add(index, builderForValue.build()); + onChanged(); + } else { + testBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * <code>repeated .org.sonar.server.source.db.Test test = 1;</code> + */ + public Builder addAllTest( + java.lang.Iterable<? extends org.sonar.server.source.db.FileSourceTestDb.Test> values) { + if (testBuilder_ == null) { + ensureTestIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, test_); + onChanged(); + } else { + testBuilder_.addAllMessages(values); + } + return this; + } + /** + * <code>repeated .org.sonar.server.source.db.Test test = 1;</code> + */ + public Builder clearTest() { + if (testBuilder_ == null) { + test_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + testBuilder_.clear(); + } + return this; + } + /** + * <code>repeated .org.sonar.server.source.db.Test test = 1;</code> + */ + public Builder removeTest(int index) { + if (testBuilder_ == null) { + ensureTestIsMutable(); + test_.remove(index); + onChanged(); + } else { + testBuilder_.remove(index); + } + return this; + } + /** + * <code>repeated .org.sonar.server.source.db.Test test = 1;</code> + */ + public org.sonar.server.source.db.FileSourceTestDb.Test.Builder getTestBuilder( + int index) { + return getTestFieldBuilder().getBuilder(index); + } + /** + * <code>repeated .org.sonar.server.source.db.Test test = 1;</code> + */ + public org.sonar.server.source.db.FileSourceTestDb.TestOrBuilder getTestOrBuilder( + int index) { + if (testBuilder_ == null) { + return test_.get(index); } else { + return testBuilder_.getMessageOrBuilder(index); + } + } + /** + * <code>repeated .org.sonar.server.source.db.Test test = 1;</code> + */ + public java.util.List<? extends org.sonar.server.source.db.FileSourceTestDb.TestOrBuilder> + getTestOrBuilderList() { + if (testBuilder_ != null) { + return testBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(test_); + } + } + /** + * <code>repeated .org.sonar.server.source.db.Test test = 1;</code> + */ + public org.sonar.server.source.db.FileSourceTestDb.Test.Builder addTestBuilder() { + return getTestFieldBuilder().addBuilder( + org.sonar.server.source.db.FileSourceTestDb.Test.getDefaultInstance()); + } + /** + * <code>repeated .org.sonar.server.source.db.Test test = 1;</code> + */ + public org.sonar.server.source.db.FileSourceTestDb.Test.Builder addTestBuilder( + int index) { + return getTestFieldBuilder().addBuilder( + index, org.sonar.server.source.db.FileSourceTestDb.Test.getDefaultInstance()); + } + /** + * <code>repeated .org.sonar.server.source.db.Test test = 1;</code> + */ + public java.util.List<org.sonar.server.source.db.FileSourceTestDb.Test.Builder> + getTestBuilderList() { + return getTestFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.sonar.server.source.db.FileSourceTestDb.Test, org.sonar.server.source.db.FileSourceTestDb.Test.Builder, org.sonar.server.source.db.FileSourceTestDb.TestOrBuilder> + getTestFieldBuilder() { + if (testBuilder_ == null) { + testBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.sonar.server.source.db.FileSourceTestDb.Test, org.sonar.server.source.db.FileSourceTestDb.Test.Builder, org.sonar.server.source.db.FileSourceTestDb.TestOrBuilder>( + test_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + test_ = null; + } + return testBuilder_; + } + + // @@protoc_insertion_point(builder_scope:org.sonar.server.source.db.Tests) + } + + static { + defaultInstance = new Tests(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.sonar.server.source.db.Tests) + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_org_sonar_server_source_db_Test_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_org_sonar_server_source_db_Test_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_org_sonar_server_source_db_Test_CoverageBlock_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_org_sonar_server_source_db_Test_CoverageBlock_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_org_sonar_server_source_db_Tests_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_org_sonar_server_source_db_Tests_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\031file_source_test_db.proto\022\032org.sonar.s" + + "erver.source.db\"\232\002\n\004Test\022\014\n\004uuid\030\001 \001(\t\022\013" + + "\n\003key\030\002 \001(\t\022\023\n\013method_name\030\003 \001(\t\022\016\n\006stat" + + "us\030\004 \001(\t\022\024\n\014test_message\030\005 \001(\t\022\014\n\004type\030\006" + + " \001(\t\022F\n\016coverage_block\030\007 \003(\0132..org.sonar" + + ".server.source.db.Test.CoverageBlock\032f\n\r" + + "CoverageBlock\022\014\n\004uuid\030\001 \001(\t\022\013\n\003key\030\002 \001(\t" + + "\022\021\n\tlong_name\030\003 \001(\t\022\r\n\005lines\030\004 \003(\005\022\030\n\020nb" + + "_covered_lines\030\005 \001(\005\"7\n\005Tests\022.\n\004test\030\001 " + + "\003(\0132 .org.sonar.server.source.db.TestB\002H", + "\001" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_org_sonar_server_source_db_Test_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_org_sonar_server_source_db_Test_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_org_sonar_server_source_db_Test_descriptor, + new java.lang.String[] { "Uuid", "Key", "MethodName", "Status", "TestMessage", "Type", "CoverageBlock", }); + internal_static_org_sonar_server_source_db_Test_CoverageBlock_descriptor = + internal_static_org_sonar_server_source_db_Test_descriptor.getNestedTypes().get(0); + internal_static_org_sonar_server_source_db_Test_CoverageBlock_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_org_sonar_server_source_db_Test_CoverageBlock_descriptor, + new java.lang.String[] { "Uuid", "Key", "LongName", "Lines", "NbCoveredLines", }); + internal_static_org_sonar_server_source_db_Tests_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_org_sonar_server_source_db_Tests_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_org_sonar_server_source_db_Tests_descriptor, + new java.lang.String[] { "Test", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} 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 fa11aa19b1b..e7524bec5aa 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,7 +23,6 @@ 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,6 +140,16 @@ public class BatchReportReader { return file; } + @CheckForNull + public File readTestResults(int fileRef) { + File file = fileStructure.fileFor(FileStructure.Domain.TEST_RESULT, fileRef); + if (doesFileExists(file)) { + return file; + } + + return null; + } + private boolean doesFileExists(File file) { return file.exists() && file.isFile(); } 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 8011382f086..6e717fbee42 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,6 +115,11 @@ public class BatchReportWriter { ProtobufUtil.writeMessagesToFile(coverageList, file); } + public void writeTestResults(int componentRef, Iterable<BatchReport.TestResult> testResults) { + File file = fileStructure.fileFor(FileStructure.Domain.TEST_RESULT, componentRef); + ProtobufUtil.writeMessagesToFile(testResults, file); + } + public File getSourceFile(int componentRef) { return fileStructure.fileFor(FileStructure.Domain.SOURCE, 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 e0add6865a0..d6d52ac0471 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,6 +36,7 @@ public class FileStructure { SCM("scm-", Domain.PB), SYMBOLS("symbol-", Domain.PB), COVERAGE("coverage-", Domain.PB), + TEST_RESULT("test-", 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 3ab4bfc463f..cc0de55f061 100644 --- a/sonar-batch-protocol/src/main/protobuf/batch_report.proto +++ b/sonar-batch-protocol/src/main/protobuf/batch_report.proto @@ -161,7 +161,7 @@ message Scm { optional int32 component_ref = 1; repeated Changeset changeset = 2; // if changesetIndexByLine[3] = 2 then it means that changeset[2] is the last one on line 4 - repeated int32 changesetIndexByLine = 3 [packed=true]; + repeated int32 changesetIndexByLine = 3 [packed = true]; message Changeset { optional string revision = 1; @@ -233,3 +233,17 @@ message SyntaxHighlighting { optional HighlightingType type = 2; } +message TestResult { + optional int32 test_file_ref = 1; + optional TestType type = 2; + optional TestResultStatus status = 3; + optional int64 duration_in_ms = 4; + optional string stacktrace = 5; + optional string msg = 6; + repeated CoverageBlock coverage_block = 7; + + message CoverageBlock { + optional int32 file_ref = 1; + repeated int32 line = 2; + } +}
\ 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 d41548178e5..3e906814029 100644 --- a/sonar-batch-protocol/src/main/protobuf/constants.proto +++ b/sonar-batch-protocol/src/main/protobuf/constants.proto @@ -19,6 +19,7 @@ */ option java_package = "org.sonar.batch.protocol"; + option optimize_for = SPEED; enum Severity { @@ -71,3 +72,15 @@ enum HighlightingType { KEYWORD_LIGHT = 7; PREPROCESS_DIRECTIVE = 8; } + +enum TestType { + UT = 1; + IT = 2; +} + +enum TestResultStatus { + OK = 1; + FAILURE = 2; + ERROR = 3; + SKIPPED = 4; +} diff --git a/sonar-batch-protocol/src/main/protobuf/file_source_test_db.proto b/sonar-batch-protocol/src/main/protobuf/file_source_test_db.proto new file mode 100644 index 00000000000..4f3678bdb06 --- /dev/null +++ b/sonar-batch-protocol/src/main/protobuf/file_source_test_db.proto @@ -0,0 +1,61 @@ +/* + SonarQube, open source software quality management tool. + Copyright (C) 2008-2015 SonarSource + mailto:contact AT sonarsource DOT com + + SonarQube is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + SonarQube is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + +/* +Notes + + - "required" fields are not used as recommended by Google to keep forward-compatibility: + https://developers.google.com/protocol-buffers/docs/proto#simple + + - the related Java files are not generated during build. Indeed the existing protoc maven + plugins require protobuf to be installed on boxes. That means that generated Java files + are updated and committed for each change (see src/main/gen-java). +*/ + +// structure of db column FILE_SOURCES.TEST_DATA + +// Temporarily in sonar-batch-protocol + +package org.sonar.server.source.db; + +option optimize_for = SPEED; + +message Test { + optional string uuid = 1; + optional string key = 2; + optional string method_name = 3; + optional string status = 4; + optional string test_message = 5; + optional string type = 6; + repeated CoverageBlock coverage_block = 7; + + message CoverageBlock { + optional string uuid = 1; + //TODO TBE - should the key and long_name specified directly ? + optional string key = 2; + optional string long_name = 3; + repeated int32 lines = 4; + optional int32 nb_covered_lines = 5; + } +} + +message Tests { + repeated Test test = 1; +}
\ No newline at end of file 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 4d785ba153f..0e942e14ab3 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 @@ -50,11 +50,8 @@ public class BatchReportReaderTest { @Test public void create_dir_if_does_not_exist() throws Exception { - File dir = temp.newFolder(); - initFiles(dir); - sut = new BatchReportReader(dir); BatchReport.Metadata readMetadata = sut.readMetadata(); assertThat(readMetadata.getAnalysisDate()).isEqualTo(15000000L); assertThat(readMetadata.getDeletedComponentsCount()).isEqualTo(1); @@ -105,7 +102,6 @@ public class BatchReportReaderTest { @Test public void read_syntax_highlighting() throws Exception { - File dir = temp.newFolder(); BatchReportWriter writer = new BatchReportWriter(dir); writer.writeMetadata(BatchReport.Metadata.newBuilder() @@ -123,11 +119,9 @@ public class BatchReportReaderTest { .build()) .setType(Constants.HighlightingType.ANNOTATION) .build() - )); + )); - sut = new BatchReportReader(dir); - - try (InputStream inputStream = FileUtils.openInputStream(new BatchReportReader(dir).readComponentSyntaxHighlighting(1))) { + try (InputStream inputStream = FileUtils.openInputStream(sut.readComponentSyntaxHighlighting(1))) { BatchReport.SyntaxHighlighting syntaxHighlighting = BatchReport.SyntaxHighlighting.PARSER.parseDelimitedFrom(inputStream); assertThat(syntaxHighlighting.getRange()).isNotNull(); assertThat(syntaxHighlighting.getRange().getStartLine()).isEqualTo(1); @@ -171,7 +165,6 @@ public class BatchReportReaderTest { @Test public void read_coverage() throws Exception { - File dir = temp.newFolder(); BatchReportWriter writer = new BatchReportWriter(dir); writer.writeMetadata(BatchReport.Metadata.newBuilder() @@ -235,6 +228,36 @@ public class BatchReportReaderTest { assertThat(sourceFile).isEqualTo(file); } + @Test + public void read_tests() throws Exception { + initFiles(dir); + BatchReportWriter writer = new BatchReportWriter(dir); + writer.writeTestResults(1, Arrays.asList( + BatchReport.TestResult.newBuilder() + .setTestFileRef(1) + .setDurationInMs(60_000) + .setStacktrace("stacktrace") + .setMsg("message") + .setStatus(Constants.TestResultStatus.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); + 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); + } + } + @Test(expected = IllegalStateException.class) public void fail_if_missing_metadata_file() throws Exception { sut.readMetadata(); @@ -285,14 +308,16 @@ public class BatchReportReaderTest { assertThat(sut.readComponentCoverage(123)).isNull(); } - /** - * no file if no issues - */ @Test public void empty_list_if_no_issue_found() throws Exception { assertThat(sut.readComponentIssues(666)).isEmpty(); } + @Test + public void null_if_no_test_found() throws Exception { + assertThat(sut.readTestResults(666)).isNull(); + } + private void initFiles(File dir) { BatchReportWriter writer = new BatchReportWriter(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 c58ecbb67df..dd9e7d83b2d 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 @@ -20,6 +20,7 @@ package org.sonar.batch.protocol.output; import org.apache.commons.io.FileUtils; +import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; @@ -36,28 +37,32 @@ public class BatchReportWriterTest { @Rule public TemporaryFolder temp = new TemporaryFolder(); + File dir; + BatchReportWriter sut; + + @Before + public void setUp() throws Exception { + dir = temp.newFolder(); + sut = new BatchReportWriter(dir); + } @Test public void create_dir_if_does_not_exist() throws Exception { - File dir = temp.newFolder(); FileUtils.deleteQuietly(dir); - - new BatchReportWriter(dir); + sut = new BatchReportWriter(dir); assertThat(dir).isDirectory().exists(); } @Test public void write_metadata() throws Exception { - File dir = temp.newFolder(); - BatchReportWriter writer = new BatchReportWriter(dir); BatchReport.Metadata.Builder metadata = BatchReport.Metadata.newBuilder() .setAnalysisDate(15000000L) .setProjectKey("PROJECT_A") .setRootComponentRef(1); - writer.writeMetadata(metadata.build()); + sut.writeMetadata(metadata.build()); - BatchReport.Metadata read = ProtobufUtil.readFile(writer.getFileStructure().metadataFile(), BatchReport.Metadata.PARSER); + BatchReport.Metadata read = ProtobufUtil.readFile(sut.getFileStructure().metadataFile(), BatchReport.Metadata.PARSER); assertThat(read.getAnalysisDate()).isEqualTo(15000000L); assertThat(read.getProjectKey()).isEqualTo("PROJECT_A"); assertThat(read.getRootComponentRef()).isEqualTo(1); @@ -65,11 +70,8 @@ public class BatchReportWriterTest { @Test public void write_component() throws Exception { - File dir = temp.newFolder(); - BatchReportWriter writer = new BatchReportWriter(dir); - // no data yet - assertThat(writer.hasComponentData(FileStructure.Domain.COMPONENT, 1)).isFalse(); + assertThat(sut.hasComponentData(FileStructure.Domain.COMPONENT, 1)).isFalse(); // write data BatchReport.Component.Builder component = BatchReport.Component.newBuilder() @@ -81,10 +83,10 @@ public class BatchReportWriterTest { .setIsTest(false) .addChildRef(5) .addChildRef(42); - writer.writeComponent(component.build()); + sut.writeComponent(component.build()); - assertThat(writer.hasComponentData(FileStructure.Domain.COMPONENT, 1)).isTrue(); - File file = writer.getFileStructure().fileFor(FileStructure.Domain.COMPONENT, 1); + assertThat(sut.hasComponentData(FileStructure.Domain.COMPONENT, 1)).isTrue(); + File file = sut.getFileStructure().fileFor(FileStructure.Domain.COMPONENT, 1); assertThat(file).exists().isFile(); BatchReport.Component read = ProtobufUtil.readFile(file, BatchReport.Component.PARSER); assertThat(read.getRef()).isEqualTo(1); @@ -96,11 +98,8 @@ public class BatchReportWriterTest { @Test public void write_issues() throws Exception { - File dir = temp.newFolder(); - BatchReportWriter writer = new BatchReportWriter(dir); - // no data yet - assertThat(writer.hasComponentData(FileStructure.Domain.ISSUES, 1)).isFalse(); + assertThat(sut.hasComponentData(FileStructure.Domain.ISSUES, 1)).isFalse(); // write data BatchReport.Issue issue = BatchReport.Issue.newBuilder() @@ -109,10 +108,10 @@ public class BatchReportWriterTest { .setMsg("the message") .build(); - writer.writeComponentIssues(1, Arrays.asList(issue)); + sut.writeComponentIssues(1, Arrays.asList(issue)); - assertThat(writer.hasComponentData(FileStructure.Domain.ISSUES, 1)).isTrue(); - File file = writer.getFileStructure().fileFor(FileStructure.Domain.ISSUES, 1); + assertThat(sut.hasComponentData(FileStructure.Domain.ISSUES, 1)).isTrue(); + File file = sut.getFileStructure().fileFor(FileStructure.Domain.ISSUES, 1); assertThat(file).exists().isFile(); BatchReport.Issues read = ProtobufUtil.readFile(file, BatchReport.Issues.PARSER); assertThat(read.getComponentRef()).isEqualTo(1); @@ -122,11 +121,8 @@ public class BatchReportWriterTest { @Test public void write_issues_of_deleted_component() throws Exception { - File dir = temp.newFolder(); - BatchReportWriter writer = new BatchReportWriter(dir); - // no data yet - assertThat(writer.hasComponentData(FileStructure.Domain.ISSUES_ON_DELETED, 1)).isFalse(); + assertThat(sut.hasComponentData(FileStructure.Domain.ISSUES_ON_DELETED, 1)).isFalse(); // write data BatchReport.Issue issue = BatchReport.Issue.newBuilder() @@ -135,10 +131,10 @@ public class BatchReportWriterTest { .setMsg("the message") .build(); - writer.writeDeletedComponentIssues(1, "componentUuid", Arrays.asList(issue)); + sut.writeDeletedComponentIssues(1, "componentUuid", Arrays.asList(issue)); - assertThat(writer.hasComponentData(FileStructure.Domain.ISSUES_ON_DELETED, 1)).isTrue(); - File file = writer.getFileStructure().fileFor(FileStructure.Domain.ISSUES_ON_DELETED, 1); + assertThat(sut.hasComponentData(FileStructure.Domain.ISSUES_ON_DELETED, 1)).isTrue(); + File file = sut.getFileStructure().fileFor(FileStructure.Domain.ISSUES_ON_DELETED, 1); assertThat(file).exists().isFile(); BatchReport.Issues read = ProtobufUtil.readFile(file, BatchReport.Issues.PARSER); assertThat(read.getComponentRef()).isEqualTo(1); @@ -148,10 +144,7 @@ public class BatchReportWriterTest { @Test public void write_measures() throws Exception { - File dir = temp.newFolder(); - BatchReportWriter writer = new BatchReportWriter(dir); - - assertThat(writer.hasComponentData(FileStructure.Domain.MEASURES, 1)).isFalse(); + assertThat(sut.hasComponentData(FileStructure.Domain.MEASURES, 1)).isFalse(); BatchReport.Measure measure = BatchReport.Measure.newBuilder() .setStringValue("text-value") @@ -160,10 +153,10 @@ public class BatchReportWriterTest { .setDescription("description") .build(); - writer.writeComponentMeasures(1, Arrays.asList(measure)); + sut.writeComponentMeasures(1, Arrays.asList(measure)); - assertThat(writer.hasComponentData(FileStructure.Domain.MEASURES, 1)).isTrue(); - File file = writer.getFileStructure().fileFor(FileStructure.Domain.MEASURES, 1); + assertThat(sut.hasComponentData(FileStructure.Domain.MEASURES, 1)).isTrue(); + File file = sut.getFileStructure().fileFor(FileStructure.Domain.MEASURES, 1); assertThat(file).exists().isFile(); BatchReport.Measures measures = ProtobufUtil.readFile(file, BatchReport.Measures.PARSER); assertThat(measures.getComponentRef()).isEqualTo(1); @@ -176,10 +169,7 @@ public class BatchReportWriterTest { @Test public void write_scm() throws Exception { - File dir = temp.newFolder(); - BatchReportWriter writer = new BatchReportWriter(dir); - - assertThat(writer.hasComponentData(FileStructure.Domain.SCM, 1)).isFalse(); + assertThat(sut.hasComponentData(FileStructure.Domain.SCM, 1)).isFalse(); BatchReport.Scm scm = BatchReport.Scm.newBuilder() .setComponentRef(1) @@ -190,10 +180,10 @@ public class BatchReportWriterTest { .setDate(123_456_789L)) .build(); - writer.writeComponentScm(scm); + sut.writeComponentScm(scm); - assertThat(writer.hasComponentData(FileStructure.Domain.SCM, 1)).isTrue(); - File file = writer.getFileStructure().fileFor(FileStructure.Domain.SCM, 1); + assertThat(sut.hasComponentData(FileStructure.Domain.SCM, 1)).isTrue(); + File file = sut.getFileStructure().fileFor(FileStructure.Domain.SCM, 1); assertThat(file).exists().isFile(); BatchReport.Scm read = ProtobufUtil.readFile(file, BatchReport.Scm.PARSER); assertThat(read.getComponentRef()).isEqualTo(1); @@ -204,10 +194,7 @@ public class BatchReportWriterTest { @Test public void write_duplications() throws Exception { - File dir = temp.newFolder(); - BatchReportWriter writer = new BatchReportWriter(dir); - - assertThat(writer.hasComponentData(FileStructure.Domain.DUPLICATIONS, 1)).isFalse(); + assertThat(sut.hasComponentData(FileStructure.Domain.DUPLICATIONS, 1)).isFalse(); BatchReport.Duplication duplication = BatchReport.Duplication.newBuilder() .setOriginPosition(Range.newBuilder() @@ -223,10 +210,10 @@ public class BatchReportWriterTest { .build()) .build()) .build(); - writer.writeComponentDuplications(1, Arrays.asList(duplication)); + sut.writeComponentDuplications(1, Arrays.asList(duplication)); - assertThat(writer.hasComponentData(FileStructure.Domain.DUPLICATIONS, 1)).isTrue(); - File file = writer.getFileStructure().fileFor(FileStructure.Domain.DUPLICATIONS, 1); + assertThat(sut.hasComponentData(FileStructure.Domain.DUPLICATIONS, 1)).isTrue(); + File file = sut.getFileStructure().fileFor(FileStructure.Domain.DUPLICATIONS, 1); assertThat(file).exists().isFile(); BatchReport.Duplications duplications = ProtobufUtil.readFile(file, BatchReport.Duplications.PARSER); assertThat(duplications.getComponentRef()).isEqualTo(1); @@ -237,11 +224,8 @@ public class BatchReportWriterTest { @Test public void write_symbols() throws Exception { - File dir = temp.newFolder(); - BatchReportWriter writer = new BatchReportWriter(dir); - // no data yet - assertThat(writer.hasComponentData(FileStructure.Domain.SYMBOLS, 1)).isFalse(); + assertThat(sut.hasComponentData(FileStructure.Domain.SYMBOLS, 1)).isFalse(); // write data BatchReport.Symbols.Symbol symbol = BatchReport.Symbols.Symbol.newBuilder() @@ -259,11 +243,11 @@ public class BatchReportWriterTest { .build()) .build(); - writer.writeComponentSymbols(1, Arrays.asList(symbol)); + sut.writeComponentSymbols(1, Arrays.asList(symbol)); - assertThat(writer.hasComponentData(FileStructure.Domain.SYMBOLS, 1)).isTrue(); + assertThat(sut.hasComponentData(FileStructure.Domain.SYMBOLS, 1)).isTrue(); - File file = writer.getFileStructure().fileFor(FileStructure.Domain.SYMBOLS, 1); + File file = sut.getFileStructure().fileFor(FileStructure.Domain.SYMBOLS, 1); assertThat(file).exists().isFile(); BatchReport.Symbols read = ProtobufUtil.readFile(file, BatchReport.Symbols.PARSER); assertThat(read.getFileRef()).isEqualTo(1); @@ -274,13 +258,10 @@ public class BatchReportWriterTest { @Test public void write_syntax_highlighting() throws Exception { - File dir = temp.newFolder(); - BatchReportWriter writer = new BatchReportWriter(dir); - // no data yet - assertThat(writer.hasComponentData(FileStructure.Domain.SYNTAX_HIGHLIGHTING, 1)).isFalse(); + assertThat(sut.hasComponentData(FileStructure.Domain.SYNTAX_HIGHLIGHTING, 1)).isFalse(); - writer.writeComponentSyntaxHighlighting(1, Arrays.asList( + sut.writeComponentSyntaxHighlighting(1, Arrays.asList( BatchReport.SyntaxHighlighting.newBuilder() .setRange(BatchReport.Range.newBuilder() .setStartLine(1) @@ -288,20 +269,17 @@ public class BatchReportWriterTest { .build()) .setType(Constants.HighlightingType.ANNOTATION) .build() - )); + )); - assertThat(writer.hasComponentData(FileStructure.Domain.SYNTAX_HIGHLIGHTING, 1)).isTrue(); + assertThat(sut.hasComponentData(FileStructure.Domain.SYNTAX_HIGHLIGHTING, 1)).isTrue(); } @Test public void write_coverage() throws Exception { - File dir = temp.newFolder(); - BatchReportWriter writer = new BatchReportWriter(dir); - // no data yet - assertThat(writer.hasComponentData(FileStructure.Domain.COVERAGE, 1)).isFalse(); + assertThat(sut.hasComponentData(FileStructure.Domain.COVERAGE, 1)).isFalse(); - writer.writeComponentCoverage(1, Arrays.asList( + sut.writeComponentCoverage(1, Arrays.asList( BatchReport.Coverage.newBuilder() .setLine(1) .setConditions(1) @@ -311,9 +289,22 @@ public class BatchReportWriterTest { .setItCoveredConditions(1) .setOverallCoveredConditions(1) .build() - )); + )); - assertThat(writer.hasComponentData(FileStructure.Domain.COVERAGE, 1)).isTrue(); + assertThat(sut.hasComponentData(FileStructure.Domain.COVERAGE, 1)).isTrue(); } + @Test + public void write_test() throws Exception { + assertThat(sut.hasComponentData(FileStructure.Domain.TEST_RESULT, 1)).isFalse(); + + sut.writeTestResults(1, Arrays.asList( + BatchReport.TestResult.newBuilder() + .setTestFileRef(1) + .build() + )); + + assertThat(sut.hasComponentData(FileStructure.Domain.TEST_RESULT, 1)).isTrue(); + + } } |