Skip to content

Commit

Permalink
Changed transactions for cleaning session
Browse files Browse the repository at this point in the history
  • Loading branch information
Matias waisgold committed Sep 16, 2010
1 parent 77c4707 commit d627362
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/groovy/stories/junit/ScenarioTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,12 @@ class ScenarioTest extends TestCase {
code()
}


protected void setUp() {
sessionFactory.currentSession.beginTransaction()
// transaction = sessionFactory.currentSession.beginTransaction()

// if (!transaction.isActive())
// transaction.begin()
if(before) {
before()
}
Expand All @@ -38,7 +42,10 @@ class ScenarioTest extends TestCase {
if(after) {
after()
}
sessionFactory.currentSession.transaction.rollback()
// println transaction.properties
// transaction.rollback() Transactions not working :S
sessionFactory.currentSession.clear()
}

}

1 change: 1 addition & 0 deletions test/stories/SomeStory.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ story "This is a story", {

after {
ranAfter = true;
Book.executeUpdate("delete Book")
}

scenario "It is possible to test RESTful services", {
Expand Down

0 comments on commit d627362

Please sign in to comment.