serenity-bdd / serenity-demos

64 stars 170 forks source link

Got java.lang.NullPointerException: No BaseStepListener has been registered when running this demo 'junit-webtests' #33

Open bai-yingzhao opened 8 years ago

bai-yingzhao commented 8 years ago

@wakaleo When I tried to run this demo 'junit-webtests', I got the following exceptions:

Test mechanism  Time elapsed: 0.01 sec  <<< ERROR!
java.lang.NullPointerException: No BaseStepListener has been registered
        at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:228)
        at net.thucydides.core.steps.StepEventBus.getBaseStepListener(StepEventBus.java:109)
        at net.thucydides.core.steps.StepEventBus.ensureThatTheTestSuiteStartedWith(StepEventBus.java:141)
        at net.thucydides.core.steps.StepEventBus.testStarted(StepEventBus.java:134)
        at net.thucydides.junit.listeners.JUnitStepListener.testStarted(JUnitStepListener.java:75)
        at org.junit.runner.notification.SynchronizedRunListener.testStarted(SynchronizedRunListener.java:49)
        at org.junit.runner.notification.RunNotifier$3.notifyListener(RunNotifier.java:121)
        at org.junit.runner.notification.RunNotifier$SafeNotifier.run(RunNotifier.java:72)
        at org.junit.runner.notification.RunNotifier.fireTestStarted(RunNotifier.java:118)
        at org.junit.internal.runners.model.EachTestNotifier.fireTestStarted(EachTestNotifier.java:42)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:323)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
        at net.serenitybdd.junit.runners.SerenityRunner.runChild(SerenityRunner.java:427)
        at net.serenitybdd.junit.runners.SerenityRunner.runChild(SerenityRunner.java:52)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
        at org.apache.maven.surefire.junitcore.pc.Scheduler$1.run(Scheduler.java:387)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)

Test mechanism  Time elapsed: 0.005 sec  <<< ERROR!
java.lang.NullPointerException: No BaseStepListener has been registered
        at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:228)
        at net.thucydides.core.steps.StepEventBus.getBaseStepListener(StepEventBus.java:109)
        at net.thucydides.core.steps.StepEventBus.ensureThatTheTestSuiteStartedWith(StepEventBus.java:141)
        at net.thucydides.core.steps.StepEventBus.testStarted(StepEventBus.java:134)
        at net.thucydides.junit.listeners.JUnitStepListener.testStarted(JUnitStepListener.java:75)
        at org.junit.runner.notification.SynchronizedRunListener.testStarted(SynchronizedRunListener.java:49)
        at org.junit.runner.notification.RunNotifier$3.notifyListener(RunNotifier.java:121)
        at org.junit.runner.notification.RunNotifier$SafeNotifier.run(RunNotifier.java:72)
        at org.junit.runner.notification.RunNotifier.fireTestStarted(RunNotifier.java:118)
        at org.junit.internal.runners.model.EachTestNotifier.fireTestStarted(EachTestNotifier.java:42)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:323)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
        at net.serenitybdd.junit.runners.SerenityRunner.runChild(SerenityRunner.java:427)
        at net.serenitybdd.junit.runners.SerenityRunner.runChild(SerenityRunner.java:52)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
        at org.apache.maven.surefire.junitcore.pc.Scheduler$1.run(Scheduler.java:387)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)

Test mechanism  Time elapsed: 0 sec  <<< ERROR!
java.lang.NullPointerException: No BaseStepListener has been registered
        at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:228)
        at net.thucydides.core.steps.StepEventBus.getBaseStepListener(StepEventBus.java:109)
        at net.thucydides.core.steps.StepEventBus.ensureThatTheTestSuiteStartedWith(StepEventBus.java:141)
        at net.thucydides.core.steps.StepEventBus.testStarted(StepEventBus.java:134)
        at net.thucydides.junit.listeners.JUnitStepListener.testStarted(JUnitStepListener.java:75)
        at org.junit.runner.notification.SynchronizedRunListener.testStarted(SynchronizedRunListener.java:49)
        at org.junit.runner.notification.RunNotifier$3.notifyListener(RunNotifier.java:121)
        at org.junit.runner.notification.RunNotifier$SafeNotifier.run(RunNotifier.java:72)
        at org.junit.runner.notification.RunNotifier.fireTestStarted(RunNotifier.java:118)
        at org.junit.internal.runners.model.EachTestNotifier.fireTestStarted(EachTestNotifier.java:42)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:323)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
        at net.serenitybdd.junit.runners.SerenityRunner.runChild(SerenityRunner.java:427)
        at net.serenitybdd.junit.runners.SerenityRunner.runChild(SerenityRunner.java:52)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
        at org.apache.maven.surefire.junitcore.pc.Scheduler$1.run(Scheduler.java:387)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)