Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 312166 - [JUnit] NPE when launching any test
Summary: [JUnit] NPE when launching any test
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-08 15:19 EDT by Mariana CLA
Modified: 2010-05-13 08:54 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mariana CLA 2010-05-08 15:19:22 EDT
Build Identifier: M20100211-1343

eclipse.buildId=M20100211-1343
java.version=1.6.0_11
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=pt_BR
Command-line arguments:  -os linux -ws gtk -arch x86


Error
Sat May 08 16:16:26 BRT 2010
An internal error occurred during: "Launching MyTest (1)".

java.lang.NullPointerException
	at org.eclipse.osgi.baseadaptor.bundlefile.DirZipBundleEntry.getFileURL(DirZipBundleEntry.java:68)
	at org.eclipse.osgi.framework.internal.core.BundleURLConnection.getFileURL(BundleURLConnection.java:129)
	at org.eclipse.core.runtime.internal.adaptor.URLConverterImpl.toFileURL(URLConverterImpl.java:34)
	at org.eclipse.core.runtime.FileLocator.toFileURL(FileLocator.java:206)
	at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate$ClasspathLocalizer.localURL(JUnitLaunchConfigurationDelegate.java:444)
	at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate$ClasspathLocalizer.entryString(JUnitLaunchConfigurationDelegate.java:428)
	at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate$ClasspathLocalizer.addEntry(JUnitLaunchConfigurationDelegate.java:415)
	at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate$ClasspathLocalizer.localizeClasspath(JUnitLaunchConfigurationDelegate.java:406)
	at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate.getClasspath(JUnitLaunchConfigurationDelegate.java:383)
	at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate.launch(JUnitLaunchConfigurationDelegate.java:151)
	at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:853)
	at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:703)
	at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:866)
	at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1069)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)


(Does not occur in same eclipse with in similar machines of my coworkers).


Reproducible: Always

Steps to Reproduce:
1.Create a test:
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class MyTest {
	
	@Before
	public void setUp() throws Exception {
		
	}

	@After
	public void tearDown() throws Exception {
		
	}
	@Test
	public void test() {
		
	}	
}

2. Try to run as JUnit Test in Eclipse
Comment 1 Paul Slauenwhite CLA 2010-05-10 07:47:56 EDT
Note, this is an issue with the JDT JUnit runner.
Comment 2 Olivier Thomann CLA 2010-05-10 08:33:08 EDT
Moving to JDT/UI
Comment 3 Markus Keller CLA 2010-05-10 09:52:41 EDT
Works for me.

You've probably created a "JUnit Plug-in Test" launch configuration instead of a "JUnit" launch config. But if you launch that, you should get an error message that tells you that your project is not a plug-in project.
Comment 4 Mariana CLA 2010-05-13 08:54:04 EDT
I'm sorry guys, in my normal anxiety I just started with a new workspace (which solved the problem) AND deleted the old one, so I can't test if that was really the problem. Next time wont happen =$