File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
hbase-client/src/test/java/org/apache/hadoop/hbase/shaded/protobuf Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 2222import static org .junit .Assert .assertTrue ;
2323
2424import java .io .IOException ;
25+ import java .lang .reflect .Method ;
2526import java .nio .ByteBuffer ;
2627import java .util .Collections ;
2728import java .util .List ;
5354import org .apache .hbase .thirdparty .com .google .protobuf .Any ;
5455import org .apache .hbase .thirdparty .com .google .protobuf .ByteString ;
5556import org .apache .hbase .thirdparty .com .google .protobuf .BytesValue ;
57+ import org .apache .hbase .thirdparty .com .google .protobuf .InvalidProtocolBufferException ;
5658
5759import org .apache .hadoop .hbase .shaded .protobuf .generated .CellProtos ;
5860import org .apache .hadoop .hbase .shaded .protobuf .generated .ClientProtos ;
@@ -574,4 +576,21 @@ public void testTagEncodeTrueDecodeFalse() {
574576 List <Tag > decodedTags = PrivateCellUtil .getTags (decodedCell );
575577 assertEquals (0 , decodedTags .size ());
576578 }
579+
580+ /**
581+ * Used to confirm that we only consider truncatedMessage as EOF
582+ */
583+ @ Test
584+ public void testIsEOF () throws Exception {
585+ for (Method method : InvalidProtocolBufferException .class .getDeclaredMethods ()) {
586+ if (
587+ method .getParameterCount () == 0
588+ && method .getReturnType () == InvalidProtocolBufferException .class
589+ ) {
590+ method .setAccessible (true );
591+ InvalidProtocolBufferException e = (InvalidProtocolBufferException ) method .invoke (null );
592+ assertEquals (method .getName ().equals ("truncatedMessage" ), ProtobufUtil .isEOF (e ));
593+ }
594+ }
595+ }
577596}
You can’t perform that action at this time.
0 commit comments