Permalink
Browse files

Changed transactions for cleaning session

  • Loading branch information...
Matias waisgold
Matias waisgold committed Sep 16, 2010
1 parent 77c4707 commit d627362f0ee306c15b03b9d0a64c4c0a41a31bb7
Showing with 10 additions and 2 deletions.
  1. +9 −2 src/groovy/stories/junit/ScenarioTest.groovy
  2. +1 −0 test/stories/SomeStory.groovy
@@ -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()
}
@@ -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()
}
+
}
@@ -14,6 +14,7 @@ story "This is a story", {
after {
ranAfter = true;
+ Book.executeUpdate("delete Book")
}
scenario "It is possible to test RESTful services", {

0 comments on commit d627362

Please sign in to comment.