Advertisement
Guest User

Testing Closures transactional behaviour in service

a guest
Dec 26th, 2011
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Groovy 0.34 KB | None | 0 0
  1. class TestDataService {
  2.  
  3.    public void test(){
  4.         new Customer(name:'Amit').save()
  5.         addCustomerClosure()
  6.         throw new RuntimeException("")
  7.     }
  8.  
  9.     def addCustomerClosure = {
  10.         new Customer(name:'Amit Jain').save()
  11.     }
  12.  
  13. }
  14.  
  15.  
  16. class TestDataController {
  17.    def test={
  18.         testDataService.test()
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement