Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Wrong message when runner on a non existing tag on feature #245

Closed
jeremyGoupil opened this Issue Mar 8, 2012 · 4 comments

Comments

Projects
None yet
4 participants

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.<init>(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?

Contributor

gphilipp commented Mar 8, 2012

Yeah that would be helpful indeed. Can you fork the repo, add the code and submit a pull request Jeremy ?

TiTi commented Mar 8, 2012

I have absolutely no idea why I'm receiving a notification for this thread because I'm not watching this repository.
Well the only thing is my pseudo, using the exact same case...
But this is weird.
It seems I've been added to the cucumber mailing-list in some way....
Sorry guys, I don't know anything about this (yet) !

Contributor

gphilipp commented Mar 8, 2012

That's a coincidence the original poster was talking about a custom
java annotation @TiTi which also happen to be a twitter-like shortcut
to your account :-)

Ok it's done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment