Fixed
Details
Details
Assignee
Tomasz Lelek
Tomasz Lelek(Deactivated)Reporter
Olivier Michallat
Olivier MichallatFix versions
Reviewer
Olivier Michallat
Olivier MichallatPriority
Created January 30, 2019 at 11:23 PM
Updated June 3, 2019 at 7:19 AM
Resolved April 24, 2019 at 8:54 PM
Annotation processing is tricky to test: if the annotated types are part of our regular test sources, we can't test processor errors because they make the build fail. Also, we'll need a lot of different entities/DAOs to cover all the possible combinations of annotations, parameters, etc.
On the other hand, we could have the annotated types as non-source files, and fork an independent execution of
javac
. This will require a lot of boilerplate to set up the environment (classpath, etc.), and check the results (parse generated files, or try to run them?)One third approach is to mock the
Element / TypeMirror
hierarchy and unit-test our generators.This requires a bit of thought. We should also take a look at how other annotation-processing projects do it (Dagger, Android Room...)
We might end up with a combination of multiple approaches.