search

Home  >  Q&A  >  body text

java - junit null pointer exception

java.lang.NullPointerException

at org.eclipse.jdt.internal.junit4.runner.SubForestFilter.shouldRun(SubForestFilter.java:81)
at org.junit.internal.runners.JUnit4ClassRunner.filter(JUnit4ClassRunner.java:110)
at org.junit.runner.manipulation.Filter.apply(Filter.java:47)
at org.junit.internal.requests.FilterRequest.getRunner(FilterRequest.java:34)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createFilteredTest(JUnit4TestLoader.java:77)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:68)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:43)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:444)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
ringa_leeringa_lee2752 days ago772

reply all(3)I'll reply

  • typecho

    typecho2017-06-12 09:26:06

    I generally don’t use junit that comes with eclipse, I use the official jar

    reply
    0
  • 迷茫

    迷茫2017-06-12 09:26:06

    It is recommended to paste your code.

    reply
    0
  • 世界只因有你

    世界只因有你2017-06-12 09:26:06

    There are several situations of null pointer
    1 Calling a member attribute or method of a null object
    2 When using enhanced for loop
    3 Automatic unboxing of packaging type

    reply
    0
  • Cancelreply