Posted By

thebugslayer on 06/03/07


Tagged

junit


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

bootz15


Quick Unit Testing


 / Published in: Groovy
 

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

  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  

You need to login to post a comment.