Hive-JSON-Serde icon indicating copy to clipboard operation
Hive-JSON-Serde copied to clipboard

Update 2 tests in 'json-serde' to handle String comparison ignoring the order

Open Sujishark opened this issue 1 year ago • 0 comments

Describe the bug:

Creating this issue to address 2 tests:

org.openx.data.jsonserde.JsonSerDeTest.testNestedExplicitNullValue
org.openx.data.jsonserde.JsonSerDeTest.testExplicitNullValue

Expected behavior:

The assertion at the above mentioned tests are expected to succeed irrespective of the arrangement of the Strings.

Actual behavior:

Encountered the following errors:

Failed tests: testNestedExplicitNullValue(org.openx.data.jsonserde.JsonSerDeTest): expected:<{"[structCol":{"name":"myName"},"missingStructCol":null],"structNullCol":{"n...> but was:<{"[missingStructCol":null,"structCol":{"name":"myName"}],"structNullCol":{"n...>

Failed tests: testExplicitNullValue(org.openx.data.jsonserde.JsonSerDeTest): expected:<{"[stringCol":"str","nullCol":null],"missingCol":null}> but was:<{"[nullCol":null,"stringCol":"str"],"missingCol":null}>

This was found by using the NonDex tool.

I've a fix ready for this. Can I proceed and create PR ?

How to Reproduce

The following code is for the test - org.openx.data.jsonserde.JsonSerDeTest.testNestedExplicitNullValue:

cd Hive-JSON-Serde
mvn install -pl json-serde -am -DskipTests
mvn -pl json-serde edu.illinois:nondex-maven-plugin:2.1.1:nondex -Dtest=org.openx.data.jsonserde.JsonSerDeTest#testNestedExplicitNullValue

Desktop (please complete the following information):

  • OS: Mac
  • Version: Sonoma 14.0
  • Maven Version: 3.6.3
  • Module: api
  • SDK: Original

Sujishark avatar Nov 23 '23 00:11 Sujishark