Jinzhengxu commented on code in PR #2012:
URL: https://github.com/apache/avro/pull/2012#discussion_r1050094164
##########
lang/java/avro/src/test/java/org/apache/avro/reflect/TestReflect.java:
##########
@@ -632,10 +632,15 @@ public static class RAvroMultiMeta {
@Test
public void testAnnotationMultiAvroMeta() {
- check(RAvroMultiMeta.class,
- "{\"type\":\"record\",\"name\":\"RAvroMultiMeta\",\"namespace\":"
- + "\"org.apache.avro.reflect.TestReflect\",\"fields\":["
- + "{\"name\":\"a\",\"type\":\"int\",\"K\":\"V\",\"L\":\"W\"}]" +
",\"X\":\"Y\",\"A\":\"B\"}");
+ String schm = ReflectData.get().getSchema(RAvroMultiMeta.class).toString();
+ String expectedString =
"{\"type\":\"record\",\"name\":\"RAvroMultiMeta\",\"namespace\":"
+ + "\"org.apache.avro.reflect.TestReflect\",\"fields\":["
+ + "{\"name\":\"a\",\"type\":\"int\",\"K\":\"V\",\"L\":\"W\"}]" +
",\"X\":\"Y\",\"A\":\"B\"}";
+ char[] schmArrays = schm.toCharArray();
+ char[] expectedArrays = expectedString.toCharArray();
+ Arrays.sort(schmArrays);
+ Arrays.sort(expectedArrays);
+ assertEquals(new String(schmArrays), new String(expectedArrays));
Review Comment:
Thank you for the feedback on my pull request. In terms of the fix, I think
using a standard schema comparison tool like the one you suggested would be a
good idea. I will make the necessary changes and update the pull request
accordingly. Thanks again for your suggestion!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]