This is the modified version of the patch by Konstantin. This fixes the problem reported by him. The trouble was testng can distinguish between arrays and scalars in assertEquals() and do the right thing. JUnit requires you to call assertArrayEquals() explicitly for arrays.
Now those tests pass. Still I see three errors in TestInvocationReporter, TestOutputInterceptor and TestSuiteInterceptor.
I've noticed the following (all of them subtle, not serious):
- The classes from from both Junit4 and Junit3 are used. Junit3 package names start with "junit" and Junit4 package names with "org.junit". Though they seem to work together, it's better to stick to one version.
- The order of arguments for assertEquals() is different from Testng and Junit. In junit, the first argument is the expected value and for testng it is the actual. Again, there is no harm if we use the wrong order because, after all, it checks for equality. But the error messages will be confusing.
- The fields of parametrized test classes, it is possible to make the input fields final.
I've fixed these for tests in avro.io package. Other packages may have these.
I saw some opportunities, in Junit context, to refactor and reduce test code for avro.io package. I'll take that up once conversion to Junit is over.