opwvhk commented on code in PR #2581:
URL: https://github.com/apache/avro/pull/2581#discussion_r1391267880
##########
lang/java/avro/src/test/java/org/apache/avro/reflect/TestReflectData.java:
##########
@@ -76,6 +78,25 @@ void genericProtocol() {
assertThat(existsArgument.schema(),
equalTo(Schema.create(Schema.Type.STRING)));
}
+ @Test
+ void fieldsOrder() {
+ Schema schema = ReflectData.get().getSchema(Meta.class);
+ List<Schema.Field> fields = schema.getFields();
+ assertEquals(fields.size(), 4);
+ assertEquals(fields.get(0).name(), "f1");
+ assertEquals(fields.get(1).name(), "f2");
+ assertEquals(fields.get(2).name(), "f3");
+ assertEquals(fields.get(3).name(), "f4");
+
+ schema = new ReflectData(false).getSchema(Meta.class);
+ fields = schema.getFields();
+ assertEquals(fields.size(), 4);
+ assertEquals(fields.get(0).name(), "f1");
+ assertEquals(fields.get(1).name(), "f4");
+ assertEquals(fields.get(2).name(), "f2");
+ assertEquals(fields.get(3).name(), "f3");
Review Comment:
This order depends on the JVM in use. Can we please ensure this test is only
enabled for JVMs where the test is known to succeed?
--
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]