lastnpe / eclipse-null-eea-augments

Eclipse External null Annotations (EEA) repository
http://lastnpe.org
Eclipse Public License 2.0
41 stars 22 forks source link

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

Closed digulla closed 1 month ago

digulla commented 4 years ago

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.

jason-faust commented 4 years ago

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

jason-faust commented 4 years ago

@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?

J-N-K commented 4 years ago

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?

jason-faust commented 4 years ago

@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?

J-N-K commented 4 years ago

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.

sebthom commented 1 month ago

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