use of com.google.protobuf.Descriptors.EnumValueDescriptor in project j2objc by google.
the class CompatibilityTest method testGetUnsetField.
public void testGetUnsetField() throws Exception {
TypicalData data = TypicalData.newBuilder().build();
Descriptor descriptor = TypicalData.getDescriptor();
assertEquals(0, data.getField(descriptor.findFieldByNumber(1)));
Object result = data.getField(descriptor.findFieldByNumber(3));
assertTrue(result instanceof EnumValueDescriptor);
assertEquals(TypicalData.EnumType.VALUE1.getValueDescriptor().getNumber(), ((EnumValueDescriptor) result).getNumber());
assertTrue(data.getField(descriptor.findFieldByNumber(11)) instanceof TypicalDataMessage);
}
Aggregations