Community
Participate
Working Groups
Steps (I know it sounds convoluted) 1. Create a plugin project, choose eclipse version 3.0 2. Open plugin.xml, add the org.junit (3.8) as a dependency 3. Create a test case java class extending the junit base TestCase class, 4. Export the plugin project with source using (File-Export-Plugin development-Deployable plugin ....), export as a directory 5. Delete the original plugin project from the workspace. 6. Now Import the (exported) plugin project as a binary project (File-Import-Plugin development-Plugins and fragments) 7. Now select the project in the workspace and Right click and Run as->Junit plugin test 8. Get error in launching, there is an error in log eclipse.buildId=I20060519-1206 java.version=1.5.0_06 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US Framework arguments: -showlocation Command-line arguments: -data D:\eclipse\...\workspace1 -showlocation Error Tue Jul 11 13:52:47 EDT 2006 An internal error occurred during: "Launching". java.lang.NullPointerException at org.eclipse.jdt.internal.core.hierarchy.HierarchyBuilder.<init>(HierarchyBuilder.java:80) at org.eclipse.jdt.internal.core.hierarchy.RegionBasedHierarchyBuilder.<init>(RegionBasedHierarchyBuilder.java:37) at org.eclipse.jdt.internal.core.hierarchy.RegionBasedTypeHierarchy.compute(RegionBasedTypeHierarchy.java:73) at org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy.refresh(TypeHierarchy.java:1235) at org.eclipse.jdt.internal.core.CreateTypeHierarchyOperation.executeOperation(CreateTypeHierarchyOperation.java:90) at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:720) at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:779) at org.eclipse.jdt.internal.core.JavaProject.newTypeHierarchy(JavaProject.java:2641) at org.eclipse.jdt.internal.core.JavaProject.newTypeHierarchy(JavaProject.java:2619) at org.eclipse.jdt.internal.junit.util.TestSearchEngine.findTestCases(TestSearchEngine.java:227) at org.eclipse.jdt.internal.junit.util.TestSearchEngine.collectTypes(TestSearchEngine.java:204) at org.eclipse.jdt.internal.junit.util.TestSearchEngine.doFindJUnit3Tests(TestSearchEngine.java:167) at org.eclipse.jdt.internal.junit.launcher.JUnit3TestFinder.findTestsInContainer(JUnit3TestFinder.java:32) at org.eclipse.jdt.internal.junit.launcher.ContainerTestSearchExtent.find(ContainerTestSearchExtent.java:42) at org.eclipse.jdt.internal.junit.launcher.TestKind.search(TestKind.java:107) at org.eclipse.jdt.internal.junit.launcher.TestKindRegistry.getTestTypes(TestKindRegistry.java:181) at org.eclipse.jdt.internal.junit.launcher.JUnitBaseLaunchConfiguration.findTestTypes(JUnitBaseLaunchConfiguration.java:126) at org.eclipse.pde.internal.ui.launcher.JUnitLaunchConfiguration.launch(JUnitLaunchConfiguration.java:83) at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:639) at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:565) at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:754) at org.eclipse.debug.internal.ui.DebugUIPlugin$6.run(DebugUIPlugin.java:944) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58) Please note the steps I mentioned are a simplificaiton of our scenario where we had a plugin with junit test cases that we wanted to debug, so we imported it into our eclipse environment as a binary project (we did not have source at that time) and were trying to run it as a junit plugin.
Reproduced in 3.2. Two problems here: - IJavaProject.newTypeHierarchy(IType, IRegion, IProgressMonitor) throws a NPE if the passed IRegion is empty - The Junit launcher should not only look for tests in sources but also in direct archives (not from referenced projects). Using this bug for the NPE. Filed bug 151246 for the JUnit issue.
Created attachment 47161 [details] Proposed patch Null check on project in HierarchyBuilder constructor is enough to get dialog saying that no tests were found... As bug 151246 won't be fixed, this workaround is perhaps enough to solve this problem...
Wait for Jerome's review before applying fix...
Any updates on fixing this defect for 3.2.1
(In reply to comment #4) > Any updates on fixing this defect for 3.2.1 > Sorry, I forgot to finalize this bug after vacations... However, if you wanted this bug fixed for 3.2.1, you should have let us know sooner... Unfortunately, 3.2.1 is now definitely frozen now and this bug will be addressed only in 3.2.2 Philippe, agree to target it for 3.2.2?
+1 for 3.2.2
Patch looks good.
*** Bug 157769 has been marked as a duplicate of this bug. ***
Released for 3.3 M3 in HEAD stream. Test case added in TypeHierarchyTests#testRegion5_Bug150289().
Released for 3.2.2 in R3_2_maintenance stream.
Verified for 3.2.2 using build M20070112-1200