Open full view…

NPE when running TestMe plugin on a not fully rcognized projec

Thu, 14 May 2020 10:54:57 GMT

Hi Yaron. I tried to run the TestMe plugin on the Tomcat 9.x project which is not recognized fully in intellij Idea (I didn't built it using ant as proposed in the tomcat doc). (This behaviour is the same for any project, that is not fully built in idea.) When you try to generate the Tests on any class (e.g. it crashes with the following stack trace: java.lang.NullPointerException at com.weirddev.testme.intellij.action.helpers.TargetDirectoryLocator.get OrCreateDirectory( at com.weirddev.testme.intellij.action.CreateTestMeAction.invoke(CreateTe at com.weirddev.testme.intellij.action.TestMeCreator.invoke(TestMeCreator .java:35) at com.weirddev.testme.intellij.action.TestMeCreator.createTest(TestMeCre at com.weirddev.testme.intellij.action.TestMeAdditionalAction.execute(Tes at com.weirddev.testme.intellij.ui.popup.TestMePopUpHandler$ ... The problem is in: CreateTestMeAction:87 final PsiPackage srcPackage = JavaDirecto ryService.getInstance().getPackage(srcDir); as it is for some reason not possible to get an instance of PsiPackage. Best regards, Lubos.

Thu, 14 May 2020 17:12:24 GMT

Thanks Lubos, when IDEA can't build the logical program structure - the PSI tree - then TestMe can't understand the structure as well and generate code. Error handling needs to improve with a proper user notification. I understand this can be an annoying behavor. Thanks a lot for the detailed error report.