[JVM] "Then" step is ignored (not captured) in a simple HelloWorld Maven project

68 views
Skip to first unread message

Javix

unread,
May 21, 2013, 5:00:34 AM5/21/13
to cu...@googlegroups.com
I met a strange behaviour when created a standard Maven project in Eclipse and jdk1.7. The strange is that whet running a simpoe feature from the cukes  examples:

Feature: Hello World

  Scenario: Say hello
    Given I have a hello app with "Howdy"
    When I ask it to say hi
    Then it should answer with "Howdy World"


and running 'mvn clean test' in the terminal, I got:

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running RunCukesTest


You can implement missing steps with the snippets below:

@Given("^I have a hello app with \"([^\"]*)\"$")
public void I_have_a_hello_app_with(String arg1) throws Throwable {
    // Express the Regexp above with the code you wish you had
    throw new PendingException();
}

@When("^I ask it to say hi$")
public void I_ask_it_to_say_hi() throws Throwable {
    // Express the Regexp above with the code you wish you had
    throw new PendingException();
}

Feature: Hello World

  Scenario: Say hello                     # com/hello/hello.feature:3
    Given I have a hello app with "Howdy"
    When I ask it to say hi    When I ask it to say hi@SLTests run: 3, Failures: 0, Errors: 2, Skipped: 1, Time elapsed: 0.701 sec <<< FAILURE!

Results :

Tests in error:
  Feature: Hello World: Index: 0, Size: 0
  RunCukesTest: Index: 0, Size: 0

Tests run: 3, Failures: 0, Errors: 2, Skipped: 1

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.555s
[INFO] Finished at: Tue May 21 10:52:00 CEST 2013
[INFO] Final Memory: 12M/146M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.7.2:test (default-test) on project jemmyfx: There are test failures.
[ERROR]
[ERROR] Please refer to /Users/serge-mac/Development/eclipse_workspace/jemmyfx/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

As you see, Then step has not been parsed, is it normal ?

Here is my configuration details:

OS X 10.8.3
java version "1.7.0_21"
Java(TM) SE Runtime Environment (build 1.7.0_21-b12)
Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode)

Apache Maven 3.0.3 (r1075438; 2011-02-28 18:31:09+0100)
Maven home: /usr/share/maven
Java version: 1.7.0_21, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.8.3", arch: "x86_64", family: "mac"

Any idea ? Thank you.

aslak hellesoy

unread,
May 21, 2013, 7:49:34 AM5/21/13
to Cucumber Users
Very strange. Can you put this in a git repo so we can reproduce it?

Thanks!

Aslak
 
Here is my configuration details:

OS X 10.8.3
java version "1.7.0_21"
Java(TM) SE Runtime Environment (build 1.7.0_21-b12)
Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode)

Apache Maven 3.0.3 (r1075438; 2011-02-28 18:31:09+0100)
Maven home: /usr/share/maven
Java version: 1.7.0_21, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.8.3", arch: "x86_64", family: "mac"

Any idea ? Thank you.


--
-- Rules --
 
1) Please prefix the subject with [Ruby], [JVM] or [JS].
2) Please use interleaved answers http://en.wikipedia.org/wiki/Posting_style#Interleaved_style
3) If you have a question, don't reply to an existing message. Start a new topic instead.
 
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
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Serguei Cambour

unread,
May 21, 2013, 3:45:21 PM5/21/13
to cu...@googlegroups.com
Hello Aslak,

I've just created a repo for the project at https://github.com/Javix/jemmyfx-test. What is strange, I have another Maven project (https://github.com/Javix/java_cukes) from which I just copy-pasted POM file content. The only difference is target compiler version and some jemmyFX dependencies.


Thanks,

Serguei
You received this message because you are subscribed to a topic in the Google Groups "Cukes" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cukes/AR_yN_N1SN4/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to cukes+un...@googlegroups.com.

aslak hellesoy

unread,
May 21, 2013, 5:29:55 PM5/21/13
to Cucumber Users
Thanks Serguei.

Add this to your pom:

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.14.1</version>
                <configuration>
                    <useFile>false</useFile>
                </configuration>
            </plugin>

When you run again you'll see that you've hit this very annoying bug:

It's the highest priority bug to fix in cucumber-jvm/gherkin right now

Aslak

Javix

unread,
May 22, 2013, 4:02:15 AM5/22/13
to cu...@googlegroups.com
Thanks a lot, Aslak. That's true, event after adding the above plugin to the POM file, I got the described error. For the moment I just changed cucumber version to 1.1.1 and it works as needed (no need to add the indicated plugin).

Cheers
Reply all
Reply to author
Forward
0 new messages