タグ

2009年12月18日のブックマーク (2件)

  • EasyMock

    Why Great testing includes isolation Most parts of a software system do not work in isolation, but collaborate with other parts to get their job done. In a lot of cases, we do not care about using real collaborators implementation in unit testing, as we trust these collaborators. Mock Objects replace collaborators of the unit under test. How Isolation involves Mock Objects To test a unit in isolat

  • EasyMockを使ってみた - DENの思うこと

    ユニットテストを行うときに困るのが HttpServletRequest等のサーバなどで生成されるインスタンスを 引数としているメソッドのテストです。 そんなときはモックという擬似オブジェクトを 利用したテストを行うのが一般的です。 私もJUnitでテストを行う為にモックを 利用しようと思ったのですが、 昔利用していたmockobjectというライブラリが無くなっていました。(年を感じます;_;) 今はEasyMockやjMockといったライブラリが利用されているようです。 ということで今回、EasyMockを初めて使ってみました。以下、使い方です。 http://www.easymock.org/index.html (バージョンは2.4を使用) まず最初にダウンロードしたら easymock.jarをクラスパスに通します。 次に、 import static org.easymock.

    EasyMockを使ってみた - DENの思うこと