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

Tests in default package do not get picked up via classpath scanning #465

Closed
otrosien opened this issue Aug 15, 2016 · 4 comments
Closed

Comments

@otrosien
Copy link

I know it's bad practice, and I don't know (docs don't seem to mention) if it is intended.. but I just tried junit5 for the first time in a little demo project using the java default package. It took some time to realize, but tests only seem to be picked up by the gradle test plugin, if I move them out of the default package namespace.

I could create a sample github project from it, or you tell me this is known and intended as such. :)

Regards,
Oliver

@marcphilipp
Copy link
Member

Not picking up classes in the default package is not intended. Please provide a sample project so we can investigate. Thanks!

@sbrannen
Copy link
Member

A sample project shouldn't actually be necessary.

I just confirmed that it is a bug by moving the AssertionsDemo class in the documentation project to the root of the classpath and then running gradle -a :documentation:clean :documentation:test. Before moving the test class, there were 79 tests found; afterwards there were only 73 tests found.

@sbrannen sbrannen changed the title Tests in default package do not get picked up Tests in default package do not get picked up via classpath scanning Aug 15, 2016
@sbrannen sbrannen self-assigned this Aug 17, 2016
@sbrannen
Copy link
Member

in progress

@sbrannen
Copy link
Member

Fixed in master in commit 63c9ff4.

sbrannen added a commit that referenced this issue Aug 18, 2016
This commit picks up where 63c9ff4 left
off by supporting "" as the default package in ReflectionUtils.isPackage().

Furthermore, classpath scanning is now supported when "" is selected as
the base package for scanning.

Issue: #465
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants