DeveloperNotes - innoventsolutions/birt-functions-lib GitHub Wiki
10/26/2022
Unit tests for birt-functions-lib, when run in eclipse (right-click on test-src -> Run As -> JUnit Test), all fail. Most fail because:
java.lang.AssertionError: org.eclipse.birt.report.engine.api.UnsupportedFormatException: The output format HTML is not supported.
When examining the unit test in Run Configurations it can be seen that org.eclipse.birt.report.engine.emitter.html is not included in the Plug-in Dependencies and this is probably causing the error. However that plugin is not required by birt-functions-lib and should not be included. Also the tests require Mockito that that should not be included in the plugin. Therefore the unit tests should be in a separate project and not included in birt-functions-lib.
10/28/2022
I created a separate plugin for the unit tests and added as many dependencies as I could to MANIFEST.MF. I also added the latest mockito-core, byte-buddy, and objenesis to the runtime classpath. This still failed when the unit tests were run as plain JUnit Tests from the run menu, but then I got the idea from this stack-overflow question to use the JUnit Plug-in Test run configuration. With experimentation I found that I could get all the unit tests but one to run successfully by manually selecting the plugins, selecting everything, and checking "Include required Plug-ins automatically while launching". The only test that failed was AppendLibraryContentTest because Mockito wasn't doing what was expected.
11/1/2022
Turns out AppendLibraryContentTest could be fixed by stubbing reportDE.getRoot(). All the unit tests now work when run as JUnit Plug-In Tests in eclipse.
11/13/2022
Successfully building birt.functions.lib with maven. All test except SetChartPaletteTest.testExecute1 successfully work with maven. That test fails because of a null pointer exception deep inside HTML rendering. Debugging as described in this maven surefire page does not work. Method one, for forked tests, does not pause. Method two, for non-forked tests, pauses but no breakpoints work. Still trying to solve this.
11/25/2022
Made compatible with BIRT 4.11. Rebuilt with maven and all tests run with maven. SetChartPaletteTest.testExecute1 still failing.