You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a very simple Gradle (5.1.1) project with JUnit 4 tests configured in my build.gradle. The resulting .classpath file used by Eclipse JDT contains the following entries:
(I added the "test" attribute to the test entry manually, as per #470.)
Everything is compiled correctly and the VS Code Problems view is empty. However, when I try to load my tests (just one class, src/test/java/Tests.java) into the test explorer, I reach a NullPointerException from this line:
NPE Stacktrace
java.lang.NullPointerException
at com.microsoft.java.test.plugin.util.TestSearchUtils.searchInPackage(TestSearchUtils.java:294)
at com.microsoft.java.test.plugin.util.TestSearchUtils.searchTestItems(TestSearchUtils.java:133)
at com.microsoft.java.test.plugin.handler.TestDelegateCommandHandler.executeCommand(TestDelegateCommandHandler.java:45)
at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler$1.run(WorkspaceExecuteCommandHandler.java:152)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler.executeCommand(WorkspaceExecuteCommandHandler.java:142)
at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$4(JDTLanguageServer.java:451)
at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$26(JDTLanguageServer.java:793)
at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:602)
at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:577)
at java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:443)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
It seems like resolvePackage can and does return null, but this plugin does not check for null.
Just create a Gradle 5.1.1 (should still happen on other versions) project with the above code and populate the test explorer, then try to expand the empty entry under the root project. Mine looks like this:
The text was updated successfully, but these errors were encountered:
I have a very simple Gradle (5.1.1) project with JUnit 4 tests configured in my
build.gradle
. The resulting.classpath
file used by Eclipse JDT contains the following entries:Eclipse
.classpath
entries(I added the
"test"
attribute to the test entry manually, as per #470.)Everything is compiled correctly and the VS Code Problems view is empty. However, when I try to load my tests (just one class,
src/test/java/Tests.java
) into the test explorer, I reach aNullPointerException
from this line:NPE Stacktrace
It seems like
resolvePackage
can and does returnnull
, but this plugin does not check fornull
.Code
src/test/java/Tests.java
build.gradle
Reproduction
Just create a Gradle 5.1.1 (should still happen on other versions) project with the above code and populate the test explorer, then try to expand the empty entry under the root project. Mine looks like this:
The text was updated successfully, but these errors were encountered: