On Wed, May 16, 2012 at 2:50 AM, Alex <
azagn...@gmail.com> wrote:
> I am having trouble to run cucumber-jvm from a command line. The
> command is executed from a directory containing cucumber JAR files.
> Having said that, I have no problem running Cucumber-JVM from IntelliJ
> by running the test class (RunCukesTest) annotated with
> @RunWith(Cucumber.class).
>
> The command is as follows:
> java -classpath gherkin-2.9.3.jar:cucumber-junit-1.0.6.jar:cucumber-
> java-1.0.6.jar:cucumber-core-1.0.6.jar: cucumber.cli.Main --glue ~/
> application/out/test/Acceptance/com/gap/scms/mp/acceptance ~/
> application/out/test/Acceptance/com/gap/scms/mp/acceptance/
> invoiceresource.feature
>
> The directory "~/application/out/test/Acceptance/com/gap/scms/mp/
> acceptance/" contains the following files (everything in one
> directory):
> InvoiceResourceStepdefs.class
> RunCukesTest.class
> invoiceresource.feature
>
> The following is the contents of invoiceresource.feature:
>
https://gist.github.com/2706621
>
> The following is the contents of RunCukesTest class:
>
https://gist.github.com/2706631
>
> The following is the contents of InvoiceResourceStepdefs class:
>
https://gist.github.com/2706638
>
This class needs to be in a package. You placed it in the top-level
package (no package).
It also shouldn't extend from ResourceTest. In fact it shouldn't
extend anything. See recent discussions about inheritance.
> The response that I get is as follows (I see the auto-generated
> stepdefs message):
>
https://gist.github.com/2706587
>
> From what I see, the cucumber-jvm cannot locate the
> InvoiceResourceStepdefs class. Can you please advise where I am going
> wrong?
The java backend expects the --glue argument to be either a package
name or a classpath path (not a file system path). So after you have
moved your InvoiceResourceStepdefs class to a package, for example
com.yammer.dropwizard.testing, cucumber will pick it up with:
--glue com.yammer.dropwizard.testing
Or alternatively
--glue classpath:com/yammer/dropwizard/testing
Other backends, such as the jruby backend would be happy to use a file
system path. Different backends want different ways to specify a glue
location.
If you look at the history
(
https://github.com/cucumber/cucumber-jvm/blob/master/History.md)
you'll see that 1.0.2 introduced "Don't convert paths to package names
- instead throw an exception. This helps people avoid mistakes." If
you had been on 1.0.2 you would have received an exception!
However, this introduced another problem:
https://github.com/cucumber/cucumber-jvm/issues/299 so you'll no
longer get this warning if you pass a file system path.
I'll try to come up with a way for cucumber to detect bad glue while
avoiding #299 to break again.
HTH,
Aslak
> Thank you
>
> Alex
>
> -- There are two rules:
>
> 1) Please prefix the subject with [Ruby], [JVM] or [JS]. This allows people to filter messages.
> 2) Please use interleaved answers
http://en.wikipedia.org/wiki/Posting_style#Interleaved_style
>
> You received this message because you are subscribed to the Google Groups Cukes group. To post to this group, send email to
cu...@googlegroups.com. To unsubscribe from this group, send email to
cukes+un...@googlegroups.com. For more options, visit this group at
https://groups.google.com/d/forum/cukes?hl=en