タグ

Javaとeasymockに関するoinumeのブックマーク (3)

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

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

    EasyMockを使ってみた - DENの思うこと
    oinume
    oinume 2010/06/17
    jMockとの比較。わかりやすい
  • 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

  • IBM Developer

    IBM Developer is your one-stop location for getting hands-on training and learning in-demand skills on relevant technologies such as generative AI, data science, AI, and open source.

    IBM Developer
  • 1