cucumber/cucumber-jvm — Issue #245: Wrong message when runner on a non existing tag on feature
Author: jeremyArolla
Created: 2012-03-08 10:05:58+00:00
State: open

Hello,

When we want to run this:

@RunWith(Cucumber.class)
@Feature(value = "features/", tags = "@titi")
public class CucumberWIPRunner {
}

And the Tag "@titi" is not defined in any feature.

We have this misleading exception :

cucumber.runtime.CucumberException: No features found at [features/]
at cucumber.runtime.model.CucumberFeature.load(CucumberFeature.java:39)
at cucumber.junit.Cucumber.addChildren(Cucumber.java:142)
at cucumber.junit.Cucumber.(Cucumber.java:60)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:31)
at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:24)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:29)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:24)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:38)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:199)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:62)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)

It would have been more clear to display a message like this : "Tag'@titi' not found in any Feature !"

What do you reckon?