Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow creating sub-annotation from @Property #207

Closed
walkowl opened this issue Sep 3, 2018 · 5 comments
Closed

Allow creating sub-annotation from @Property #207

walkowl opened this issue Sep 3, 2018 · 5 comments

Comments

@walkowl
Copy link

walkowl commented Sep 3, 2018

We have a case in which we would like to be able to do:
@Property(trials = 1) public @interface GeneratedData { }
but we can't since @Property doesn't allow Target.ANNOTATION_TYPE

@walkowl
Copy link
Author

walkowl commented Sep 3, 2018

@pholser I have a quick fix for it if you would add me to the contributors.

@pholser
Copy link
Owner

pholser commented Sep 4, 2018

@walkowl Thanks for your interest in junit-quickcheck!

Is your fix in any way related to #173 or #170? In those, I'm proposing to allow meta-annotation search for @Property and other annotations. It sounds like you may be asking only for marking @Property with Target.ANNOTATION_TYPE. That would be only a prerequisite for what I'm proposing to do with the other GH issues.

Let me know how you'd like to proceed. Thanks!

@walkowl
Copy link
Author

walkowl commented Sep 4, 2018

Thanks for a quick reply.

Marking @Property with Target.ANNOTATION_TYPE is exactly what I was planning to do but after looking at the #173 I think it is not currently supported anyway (only one level of annotations)? We can close this issue as a duplicate of #173 and I'm happy to work on it (add the ANNOTATION_TYPE and support the annotation tree). Does it make sense?

@pholser
Copy link
Owner

pholser commented Sep 5, 2018

@walkowl If you're interested in putting together a pull request for these changes, I'm all for it!

My initial thought was that when looking for annotations on property parameters, property methods, etc., junit-quickcheck should find meta-present annotations if no annotations are directly present or present on the element. I considered bringing in junit-platform-commons 1.3 (or whatever is most recent release) as a dependency, to leverage its AnnotationUtils. That also would allow junit-quickcheck's annotation searching to mirror more closely how JUnit 5 will find annotations.

@pholser
Copy link
Owner

pholser commented Sep 6, 2018

Closing -- will address under #173.

@pholser pholser closed this as completed Sep 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants