In a certain project, the unit test class kept throwing errors, so I investigated the cause. It is a memo of the investigation process at that time.
SLF4J: Failed toString() invocation on an object of type [org.apache.poi.hssf.usermodel.HSSFRow]
java.lang.AssertionError: hashCode not designed
at org.apache.poi.hssf.usermodel.HSSFRow.hashCode(HSSFRow.java:704)
at java.lang.Object.toString(Object.java:236)
:
:
Due to the above error, the output of the debug log failed. (I was still able to run the test class)
Take a look at HSSFRow.java where the error is occurring
702: @Override
703: public int hashCode() {
704: assert false : "hashCode not designed";
705: return 42; // any arbitrary constant will do
706: }
Apparently, it seems that the implementation is such that an AssertionError occurs when the hashCode method is called.
I was a little worried and decided to check the version of each library for the time being.
Ask Google teacher to see if the version of ↑ is correct. (I referred to the article Loading integration test data using DBUnit.)
According to the article I referred to, the POI version uses 3.2-FINAL. When I tried switching the version, the error disappeared.
Recommended Posts