[EMAIL PROTECTED] writes: >+ try >+ { >+ it.next(); >+ fail("Could iterate over the iteration's end!"); >+ } >+ catch(NoSuchElementException nex) >+ { >+ //ok >+ }
This allows it.next() to throw another exception which leads to an unchecked test failure. I found that using try { it.next(); fail("Could iterate over the iteration's end!"); } catch(Exception e) { assertEquals("it.next() over end threw wrong exception", NoSuchElementException.class, e.getClass()) } is more stable in the long run, because it makes sure that every exception thrown by it.next() is caught. Regards Henning -- Dipl.-Inf. (Univ.) Henning P. Schmiedehausen INTERMETA GmbH [EMAIL PROTECTED] +49 9131 50 654 0 http://www.intermeta.de/ RedHat Certified Engineer -- Jakarta Turbine Development -- hero for hire Linux, Java, perl, Solaris -- Consulting, Training, Development 4 - 8 - 15 - 16 - 23 - 42 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]