在我的JUnit插件测试完成后,导致此Eclipse异常的原因是什么?

时间:2016-03-02 13:20:16

标签: java eclipse junit eclipse-rcp

我有一个简单的测试,我作为JUnit插件测试运行:

import org.junit.Test;

public class SimpleTest {

  @Test
  public void doNothingTest(){
    System.out.println("Nothing to see here...");
  }

}

测试完成,然后打印到控制台:

  

!ENTRY org.eclipse.epp.logging.aeri.core 2 1 2016-03-02 07:04:33.285       !MESSAGE AERI因错误而失败。请报告此错误:null;版本:1.100.0.v20160211-1103       !堆栈0       显示java.lang.NullPointerException         在org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:217)         at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:90)         在org.eclipse.epp.logging.aeri.core.SystemControl.executeHandler(SystemControl.java:103)         在org.eclipse.epp.logging.aeri.core.SystemControl.isActive(SystemControl.java:65)         在org.eclipse.epp.logging.aeri.core.util.LogListener.logging(LogListener.java:45)         在org.eclipse.core.internal.runtime.RuntimeLog.logToListeners(RuntimeLog.java:161)         在org.eclipse.core.internal.runtime.PlatformLogWriter.logged(PlatformLogWriter.java:103)         at org.eclipse.osgi.internal.log.ExtendedLogReaderServiceFactory.safeLogged(ExtendedLogReaderServiceFactory.java:88)         在org.eclipse.osgi.internal.log.ExtendedLogReaderServiceFactory.logPrivileged(ExtendedLogReaderServiceFactory.java:217)         在org.eclipse.osgi.internal.log.ExtendedLogReaderServiceFactory.log(ExtendedLogReaderServiceFactory.java:189)         在......

许多很多行都在继续。

这是抛出异常的源代码片段。 Object result = ...行抛出NPE。

@Override
public Object invoke(Object object, Class<? extends Annotation> qualifier, PrimaryObjectSupplier objectSupplier) {
    Object result = invokeUsingClass(object, object.getClass(), qualifier, IInjector.NOT_A_VALUE, objectSupplier, null, true);
    if (result == IInjector.NOT_A_VALUE) {
        if (object != null && qualifier != null) {
            throw new InjectionException("Unable to find matching method to invoke. Searching for the annotation \"" + qualifier.toString() + "\" on an instance of \"" + object.getClass().getSimpleName() + "\""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
        }
        throw new InjectionException("Unable to find matching method to invoke. One of the arguments was null."); //$NON-NLS-1$
    }
    return result; 

此来源来自org.eclipse.e4.core.di.source_1.5.0.v20150421-2214.jar

  • 我正在运行Eclipse Mars。
  • JUnit声称测试通过。
  • 我正在运行Java 1.8。
  • 我的运行配置设置为清除工作区。一世 上周更新了Eclipse。
  • 上面的测试是一个简单的简单插件(New - &gt; Plugin Project)的一部分。此插件是在测试配置中部署的唯一工作区插件。

0 个答案:

没有答案