Quick Unit Testing


/ Published in: Groovy
Save to your folder(s)

Groovy save you from using try/catch that expect exception in junit.


Copy this code and paste it in your HTML
  1. class ConcurrentErrorTest extends GroovyTestCase {
  2. void testError(){
  3. def list = [1,2,3]
  4. list.eachWithIndex{e, i->
  5. list.remove(i)
  6. }
  7. }
  8. }
  9. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.