You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by li...@apache.org on 2019/11/26 12:02:19 UTC

[dubbo] branch master updated: Fix protobuf serialization UT

This is an automated email from the ASF dual-hosted git repository.

liujun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo.git


The following commit(s) were added to refs/heads/master by this push:
     new e5bc3c6  Fix protobuf serialization UT
e5bc3c6 is described below

commit e5bc3c642fa060268f3e7e5aa7fcc9270318b0f6
Author: ken.lj <ke...@gmail.com>
AuthorDate: Tue Nov 26 20:01:31 2019 +0800

    Fix protobuf serialization UT
---
 .../protobuf/support/GenericProtobufJsonObjectOutputTest.java     | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dubbo-serialization/dubbo-serialization-test/src/test/java/org/apache/dubbo/common/serialize/protobuf/support/GenericProtobufJsonObjectOutputTest.java b/dubbo-serialization/dubbo-serialization-test/src/test/java/org/apache/dubbo/common/serialize/protobuf/support/GenericProtobufJsonObjectOutputTest.java
index 253d0fd..85581d2 100644
--- a/dubbo-serialization/dubbo-serialization-test/src/test/java/org/apache/dubbo/common/serialize/protobuf/support/GenericProtobufJsonObjectOutputTest.java
+++ b/dubbo-serialization/dubbo-serialization-test/src/test/java/org/apache/dubbo/common/serialize/protobuf/support/GenericProtobufJsonObjectOutputTest.java
@@ -166,18 +166,18 @@ public class GenericProtobufJsonObjectOutputTest {
 
 
     @Test
-    public void testWriteMap() throws IOException {
+    public void testWriteMap() throws IOException, ClassNotFoundException {
         Map<String, Object> map = new HashMap<>();
         map.put("key", "hello");
         map.put("value", "dubbo");
         this.genericProtobufObjectOutput.writeAttachments(map);
         this.flushToInput();
-        assertThat(genericProtobufObjectInput.readObject(Map.class), is(map));
+        assertThat(genericProtobufObjectInput.readAttachments(), is(map));
     }
 
 
     @Test
-    void testWriteMultiType() throws IOException {
+    void testWriteMultiType() throws IOException, ClassNotFoundException {
         long random = new Random().nextLong();
         this.genericProtobufObjectOutput.writeLong(random);
         Map<String, Object> map = new HashMap<>();
@@ -192,7 +192,7 @@ public class GenericProtobufJsonObjectOutputTest {
         this.genericProtobufObjectOutput.writeShort((short) randomShort);
         this.flushToInput();
         assertThat(genericProtobufObjectInput.readLong(), is(random));
-        assertThat(genericProtobufObjectInput.readObject(Map.class), is(map));
+        assertThat(genericProtobufObjectInput.readAttachments(), is(map));
         assertThat(genericProtobufObjectInput.readBytes(), is(bytes));
         assertThat(genericProtobufObjectInput.readShort(), is((short) randomShort));
     }