2009-09-03から1日間の記事一覧

Java,JUnit,assertThrows

書いた。 説明 JUnit用のアサーションメソッド。例外表明を1行で書ける。 try { buckets.get(1000); fail(); } catch (IndexOutOfBoundsException e) { } これが assertThrows(IndexOutOfBoundsException.class, buckets, "get", 1000); こうなる。スタティ…