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

ClassSelectors for interfaces should be ignored #1

Closed
marcphilipp opened this issue Jul 9, 2021 · 0 comments · Fixed by #2
Closed

ClassSelectors for interfaces should be ignored #1

marcphilipp opened this issue Jul 9, 2021 · 0 comments · Fixed by #2
Assignees
Labels
bug Something isn't working
Milestone

Comments

@marcphilipp
Copy link
Member

When a ClassSelector for an interface type is passed as part of a discovery request, discovery currently fails with an exception:

Caused by: org.junit.platform.commons.JUnitException: TestEngine with ID 'testng' failed to discover tests
	at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discoverEngineRoot(EngineDiscoveryOrchestrator.java:111)
	at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discover(EngineDiscoveryOrchestrator.java:85)
	at org.junit.platform.launcher.core.DefaultLauncher.discover(DefaultLauncher.java:92)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:75)
	at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.processAllTestClasses(JUnitPlatformTestClassProcessor.java:99)
	at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.access$000(JUnitPlatformTestClassProcessor.java:79)
	at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.stop(JUnitPlatformTestClassProcessor.java:75)
	at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.stop(SuiteTestClassProcessor.java:61)
	... 25 more
Caused by: org.junit.platform.commons.JUnitException: ClassSelector [className = 'com.netflix.nebula.helloworld.HelloReplyOrBuilder'] resolution failed
	at org.junit.platform.launcher.listeners.discovery.AbortOnFailureLauncherDiscoveryListener.selectorProcessed(AbortOnFailureLauncherDiscoveryListener.java:39)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolveCompletely(EngineDiscoveryRequestResolution.java:102)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.run(EngineDiscoveryRequestResolution.java:82)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolver.resolve(EngineDiscoveryRequestResolver.java:113)
	at org.junit.support.testng.engine.TestNGTestEngine.discover(TestNGTestEngine.java:78)
	at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discoverEngineRoot(EngineDiscoveryOrchestrator.java:103)
	... 32 more
Caused by: java.lang.NullPointerException
	at org.junit.support.testng.engine.TestAnnotationUtils.getClassHierarchy(TestAnnotationUtils.java:84)
	at org.junit.support.testng.engine.TestAnnotationUtils.collectTestAnnotations(TestAnnotationUtils.java:77)
	at org.junit.support.testng.engine.TestAnnotationUtils.collectGroups(TestAnnotationUtils.java:72)
	at org.junit.support.testng.engine.TestDescriptorFactory.createClassDescriptor(TestDescriptorFactory.java:38)
	at org.junit.support.testng.engine.TestNGSelectorResolver.lambda$resolve$0(TestNGSelectorResolver.java:45)

Instead, interfaces and abstract classes should be ignored.

@marcphilipp marcphilipp added the bug Something isn't working label Jul 9, 2021
@marcphilipp marcphilipp added this to the 1.0.0-M2 milestone Jul 9, 2021
marcphilipp added a commit that referenced this issue Jul 9, 2021
+ Avoid computing the entire class hierarchy unnecessarily

Fixes #1.
@marcphilipp marcphilipp self-assigned this Jul 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant