Search in sources :

Example 51 with FieldDescriptor

use of org.infinispan.protostream.descriptors.FieldDescriptor in project protostream by infinispan.

the class DescriptorsTest method assertSearchResponse.

private void assertSearchResponse(Descriptor descriptor) {
    assertThat(descriptor.getName()).isEqualTo("SearchResponse");
    assertThat(descriptor.getFullName()).isEqualTo("org.infinispan.protostream.test.SearchResponse");
    assertThat(descriptor.getFields()).hasSize(3);
    assertThat(descriptor.getEnumTypes()).isEmpty();
    FieldDescriptor resultField = descriptor.getFields().get(0);
    assertThat(resultField.getName()).isEqualTo("result");
    assertThat(resultField.getType()).isEqualTo(Type.MESSAGE);
    FieldDescriptor baseField = descriptor.getFields().get(1);
    assertThat(baseField.getName()).isEqualTo("base");
    assertThat(baseField.getType()).isEqualTo(Type.MESSAGE);
}
Also used : FieldDescriptor(org.infinispan.protostream.descriptors.FieldDescriptor)

Aggregations

FieldDescriptor (org.infinispan.protostream.descriptors.FieldDescriptor)51 Descriptor (org.infinispan.protostream.descriptors.Descriptor)16 EnumDescriptor (org.infinispan.protostream.descriptors.EnumDescriptor)12 TagWriter (org.infinispan.protostream.TagWriter)9 IOException (java.io.IOException)7 GenericDescriptor (org.infinispan.protostream.descriptors.GenericDescriptor)7 EnumValueDescriptor (org.infinispan.protostream.descriptors.EnumValueDescriptor)6 FileDescriptor (org.infinispan.protostream.descriptors.FileDescriptor)6 Map (java.util.Map)5 ArrayList (java.util.ArrayList)4 List (java.util.List)4 FileDescriptorSource (org.infinispan.protostream.FileDescriptorSource)4 Configuration (org.infinispan.protostream.config.Configuration)4 ExtendDescriptor (org.infinispan.protostream.descriptors.ExtendDescriptor)4 Test (org.junit.Test)4 HashMap (java.util.HashMap)3 Objects (java.util.Objects)3 AnnotationElement (org.infinispan.protostream.descriptors.AnnotationElement)3 Set (java.util.Set)2 Function (java.util.function.Function)2