Conversation
|
@prathyushreddylpr I don't see any comparison logic in |
In the 'testDeserialization' there is a call to 'rhinoCallInContext' which internally calls deserializeTestBean3_1(serialized string) here: ' ' and the actual comparison is happening here. |
But it compares deserialized form of each attribute, the order does not matter here |
Yes but when the class is serialized to a string, the attributes does not follow any particular and when the string is compared with certain value it is causing the issue. For example, below are two serialized strings for two different runs: |
Could you please point out where this serialized string is compared to another serialized strings? I have found none such places, and the order does not matter here as far as all attributes have the same values. |
I don't see two items, I see (from your examples): and The other two string items belong to |
Thanks @prathyushreddylpr , I am very surprised by your findings but if that is indeed the case, this definitely not a CXF but JAXB implementation issue (we use Glassfish one), could you please report it there? |
@reta , can you please let me know how I can report this to JAXB? Is this:https://github.com/eclipse-ee4j/glassfish the glassfish repo that you mentioned? |
@prathyushreddylpr I suppose you could open an issue there with the test case that demonstrates the problem with JAXB implementation (you may need to craft the reproducer without Apache CXF context since as per your explanation, it is purely dictated by JAXB with propOrder setting). |








Description
Fixed the flaky tests named
testDeserializationinsideSerializationTest.javaandAttributeTest.javaclasses.cxf/rt/javascript/javascript-tests/src/test/java/org/apache/cxf/javascript/types/SerializationTest.java
Line 91 in 3048785
cxf/rt/javascript/javascript-tests/src/test/java/org/apache/cxf/javascript/types/AttributeTest.java
Line 73 in 3048785
Root Cause
The test
testDeserializationhas been reported as flaky when run with the NonDex tool. The tests failed because of the serialization of Testbean and AttributeTestBean classes, where the order of elements in the serialized XML changes between runs. The contents of the serialized strings do not remain constant and hence the tests are failing.Fix
To define a specific order for the XML elements when the classes TestBean1 and AttributeTestBean are serialized, we need to add the propOrder attribute to the @XmlType annotation. This attribute explicitly specifies the order in which fields should be serialized.
How this has been tested?
Java: openjdk version "11.0.20.1"
Maven: Apache Maven 3.6.3
Command used -
Command used -
Command used -
NonDex test passed after the fix.