eclipse-null-eea-augments icon indicating copy to clipboard operation
eclipse-null-eea-augments copied to clipboard

Add unit test which parses the files to make sure they are valid

Open digulla opened this issue 4 years ago • 5 comments

Please add a unit test that tries to read all *.eea files and makes sure the syntax is valid.

Background: In my Eclipse (since 2020-06 or 4.16), the annotate menu is broken and doesn't allow me to create annotations anymore (nothing happens when I select the item and the child menus which were there before are missing).

So I need a way to validate the hand-crafted annotations.

digulla avatar Oct 21 '20 13:10 digulla

Do you happen to know which annotation is causing the failure?

jason-faust avatar Oct 31 '20 13:10 jason-faust

@J-N-K I started writing a new validator to address this. Can you take a look at branch eea-validate and give some feedback / opinion on where it stands?

jason-faust avatar Nov 08 '20 16:11 jason-faust

There is a validation, it checks the signatures of the annotations against the signature of the method and the file format:

https://github.com/lastnpe/eclipse-null-eea-augments/tree/master/libraries/eea-all/src/test/java/org/lastnpe/eea/test

Accidentally I created a wrong annotation (while trying to solve #116) and the build failed. Can you show which malformed annotation is not detected?

@jason-faust Isn't improving the test-code easier than creating a custom maven plugin?

J-N-K avatar Nov 08 '20 16:11 J-N-K

@J-N-K The test code felt too hacky for me, the way it was wired. It deferred testing of the annotations till the full build, instead of a project by project basis.

Also, I'm not sure how to resolve the 'verify signature' part of the old validator. We've said we don't care if the annotation match the library version any longer, so there's no logical way to say if a signature is good or not, beyond syntax. Do you think Syntax will be sufficient?

jason-faust avatar Nov 08 '20 17:11 jason-faust

I don't know much about the development of maven plugins, if you can't get the declared dependencies, I would guess that having a syntax check for the single project build and having the signature check in the full build is fine.

J-N-K avatar Nov 08 '20 18:11 J-N-K

This has been implemented as part of https://github.com/lastnpe/eclipse-null-eea-augments/pull/168

sebthom avatar Sep 27 '24 14:09 sebthom