[jvm] difference between cucumber.api.java.After and cucumber.annotation.After

1,033 views
Skip to first unread message

Integrity

unread,
Nov 14, 2013, 12:34:07 PM11/14/13
to cu...@googlegroups.com
Hi, 

I am new to cucumber-jvm, i used maven with following dependencies. for the @After, and other annotations, when I hover over the @After keyword, I am suggested only import cucumber.api.java.After; However I was told that i should not be importing that package where as I should use import cucumber.annotation.After; 
The explanation given was that the cucumber.api is not intended for annotations rather I should be using cucumber.annotation. However when I googled for cucumber.annotation package, I could not find any javadoc. Why are there 2 packages if they fulfil the same purpose, which package is the official cucumber one. is the cucumber.annotations not the official package.(is it third party one)

 <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-picocontainer</artifactId>
        <version>1.1.5</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-junit</artifactId>
        <version>1.1.5</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.11</version>
        <scope>test</scope>
    </dependency>

cheers,
Shahnaaz

Seb Rose

unread,
Nov 14, 2013, 1:18:42 PM11/14/13
to cu...@googlegroups.com
On 14 November 2013 12:34, Integrity <raha...@gmail.com> wrote:
Hi, 

I am new to cucumber-jvm, i used maven with following dependencies. for the @After, and other annotations, when I hover over the @After keyword, I am suggested only import cucumber.api.java.After; However I was told that i should not be importing that package where as I should use import cucumber.annotation.After; 
The explanation given was that the cucumber.api is not intended for annotations rather I should be using cucumber.annotation. However when I googled for cucumber.annotation package, I could not find any javadoc. Why are there 2 packages if they fulfil the same purpose, which package is the official cucumber one. is the cucumber.annotations not the official package.(is it third party one)


After Cucumber-JVM 1.1.3 there was a re-organisation of packages. cucumber.annotation.en.* was the old package

With 1.1.5 you should be using cucumber.api.en.*

In fact, all public classes are now found under cucumber.api 

 <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-picocontainer</artifactId>
        <version>1.1.5</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-junit</artifactId>
        <version>1.1.5</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.11</version>
        <scope>test</scope>
    </dependency>

cheers,
Shahnaaz

--
-- 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.



--
ACCU - Professionalism in Programming - http://accu.org

http://www.claysnow.co.uk
http://twitter.com/#!/sebrose
http://uk.linkedin.com/in/sebrose

Integrity

unread,
Nov 14, 2013, 2:10:49 PM11/14/13
to cu...@googlegroups.com
Thanks for your quick reply SebRose. 
Reply all
Reply to author
Forward
0 new messages