Bug 293346 annotation refactoring causes test NPEs
I have 2 test failures in my command test suite: CommandTestSuite org.eclipse.e4.core.commands.tests.CommandTestSuite org.eclipse.e4.core.commands.tests.HandlerTest testMethodInfo(org.eclipse.e4.core.commands.tests.HandlerTest) java.lang.NullPointerException testMethodWithAnnocation(org.eclipse.e4.core.commands.tests.HandlerTest) java.lang.NullPointerException The NPEs look like: java.lang.NullPointerException at org.osgi.util.tracker.ServiceTracker.<init>(ServiceTracker.java:198) at org.eclipse.e4.internal.core.services.osgi.OSGiContextStrategy.lookup(OSGiContextStrategy.java:120) at org.eclipse.e4.core.services.internal.context.EclipseContext.internalGet(EclipseContext.java:356) at org.eclipse.e4.core.services.internal.context.EclipseContext.internalGet(EclipseContext.java:380) at org.eclipse.e4.core.services.internal.context.EclipseContext.internalGet(EclipseContext.java:380) at org.eclipse.e4.core.services.internal.context.EclipseContext.get(EclipseContext.java:325) at org.eclipse.e4.core.services.internal.context.ContextToObjectLink.processInvoke(ContextToObjectLink.java:610) at org.eclipse.e4.core.services.internal.context.ContextInjectionImpl.invoke(ContextInjectionImpl.java:60) at org.eclipse.e4.core.services.context.spi.ContextInjectionFactory.invoke(ContextInjectionFactory.java:143) at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:113) at org.eclipse.e4.core.commands.tests.HandlerTest.testMethodInfo(HandlerTest.java:231) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:618) at junit.framework.TestCase.runTest(TestCase.java:164) at junit.framework.TestCase.runBare(TestCase.java:130) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:120) at junit.framework.TestSuite.runTest(TestSuite.java:230) at junit.framework.TestSuite.run(TestSuite.java:225) at junit.framework.TestSuite.runTest(TestSuite.java:230) at junit.framework.TestSuite.run(TestSuite.java:225) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:62) at org.eclipse.pde.internal.junit.runtime.CoreTestApplication.run(CoreTestApplication.java:23) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:618) at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:574) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:367) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:618) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:611) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:566) at org.eclipse.equinox.launcher.Main.run(Main.java:1363) at org.eclipse.equinox.launcher.Main.main(Main.java:1339)
tests/org.eclipse.e4.core.commands.tests/src/org/eclipse/e4/core/commands/tests/HandlerTest.java
}
	public void testDeactivateHandler() throws Exception {
		EHandlerService hs = (EHandlerService) workbenchContext
				.get(EHandlerService.class.getName());
		CallHandler handler = new CallHandler();
		hs.activateHandler(TEST_ID1, handler);
		assertFalse(handler.q1);
		assertFalse(handler.q2);
		ECommandService cs = (ECommandService) workbenchContext
				.get(ECommandService.class.getName());
		ParameterizedCommand cmd = cs.createCommand(TEST_ID1, null);
		assertTrue(hs.canExecute(cmd));
		assertFalse(handler.q2);
		hs.deactivateHandler(TEST_ID1, handler);
		assertNull(hs.executeHandler(cmd));
		assertTrue(handler.q1);
		assertFalse(handler.q2);
	}
	public void testActiveHandlerExecuteWorkbench() throws Exception {
		IEclipseContext c1 = TestUtil.createContext(workbenchContext, "c1");
		workbenchContext.set(IContextConstants.ACTIVE_CHILD, c1);
		EHandlerService h1 = (EHandlerService) c1.get(EHandlerService.class
				.getName());
		CallHandler handler1 = new CallHandler();
		h1.activateHandler(TEST_ID1, handler1);
		ECommandService cs = (ECommandService) c1.get(ECommandService.class
				.getName());
		ParameterizedCommand cmd = cs.createCommand(TEST_ID1, null);
		assertTrue(h1.canExecute(cmd));
		EHandlerService wHS = (EHandlerService) workbenchContext