matsukaz's blog

Agile, node.js, ruby, AWS, cocos2d-xなどなどいろいろやってます

2010-05-18から1日間の記事一覧

SimpleInternalTestContextを使ってもServletに依存?

せっかくSimpleInternalTestContextを使ったのに、S2Assert.assertEquals(DataSet,DataSet)を使った途端にServletContextがなくてエラーに。。。 java.lang.NoClassDefFoundError: javax/servlet/ServletContext at java.lang.ClassLoader.defineClass1(Nati…

S2JUnit4でデータの初期化を行うEXCELファイルの配置場所を変える

すぐ忘れるのでメモ書きで残しとく。その2。addTestDataXlsPathで文字列結合とかすればディレクトリ配下に置けたりする。ここでは "data_クラス名/メソッド名.xls" ファイルを読み込むように設定。 <component class="org.seasar.framework.unit.impl.TestDataPreparerImpl"> <initMethod name="addTestDataXlsPath"> <arg> "data_" + context.testClassSho…</arg></initmethod></component>

S2JUnit4でSimpleInternalTestContext利用時の設定

すぐ忘れるのでメモ書きで残しとく。EXCELファイルでデータの初期化をさせたいときは、jtaEnabledを指定する必要がある。 <component name="context" class="org.seasar.framework.unit.impl.SimpleInternalTestContext"> <property name="jtaEnabled">true</property> <property name="preparationType">@org.seasar.framework.unit.PreparationType@ALL_REPLACE</property> …</component>