Jinzhengxu commented on code in PR #2012:
URL: https://github.com/apache/avro/pull/2012#discussion_r1050111126
##########
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:
And I agree that adding a nondex plugin to the build would be a good idea.
Using nondex can improve the reliability and stability of the code, which can
help developers ensure that code changes don't result in unexpected outcomes. I
will submit a new pull request about adding nondex to Avro for review.
Here is the link to Nondex:
https://github.com/TestingResearchIllinois/NonDex. The lastest version can
support Java 9+ project.
--
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]