[Cucumber-JVM] Complete example to use @txn to rollback DB transactions

1,346 views
Skip to first unread message

Saif

unread,
Sep 3, 2013, 12:51:31 PM9/3/13
to cu...@googlegroups.com
Hi,
  Can someone give a complete example on how cucumber can rollback DB changes?

I came across following class SpringTransactionHooks which can be used to rollback DB transactions. But this is not documented well to know what steps I need to get it working. I am using cucumber version 1.1.2. In my cucumber options I did set the glue "cucumber.api.spring". Also, added @txn in my feature file. Any other setup?

aslak hellesoy

unread,
Sep 3, 2013, 1:25:31 PM9/3/13
to Cucumber Users
On Tue, Sep 3, 2013 at 5:51 PM, Saif <msaif...@gmail.com> wrote:
Hi,
  Can someone give a complete example on how cucumber can rollback DB changes?



Now, the search.feature [1] has a comment where it suggests removing the @txn tag will change the behaviour.
I believe removing it at some point in the past made the feature fail. However, removing it doesn't make anything fail :-(

I'm not sure at what point this changed....

 
I came across following class SpringTransactionHooks which can be used to rollback DB transactions. But this is not documented well to know what steps I need to get it working. I am using cucumber version 1.1.2. In my cucumber options I did set the glue "cucumber.api.spring". Also, added @txn in my feature file. Any other setup?

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

Seb Rose

unread,
Jan 8, 2014, 11:10:11 AM1/8/14
to cu...@googlegroups.com


On Tuesday, 3 September 2013 18:25:31 UTC+1, Aslak Hellesøy wrote:



On Tue, Sep 3, 2013 at 5:51 PM, Saif <msaif...@gmail.com> wrote:
Hi,
  Can someone give a complete example on how cucumber can rollback DB changes?



Now, the search.feature [1] has a comment where it suggests removing the @txn tag will change the behaviour.
I believe removing it at some point in the past made the feature fail. However, removing it doesn't make anything fail :-(

I'm not sure at what point this changed....

I've been looking at this, and can't work out *what* might have failed at any time:
- the two Scenarios are identical 
- neither have anything to do with 'Search' (so presence or absence of a message is irrelevant)
- I can't see anything to indicate that the schema would ever have objected to duplicate message texts

Has anyone tried beefing up the scenarios in search.feature to actually exercise the functionality that their titles describe?
Reply all
Reply to author
Forward
0 new messages