Skip to content

Instantly share code, notes, and snippets.

@mapiondev
Created August 4, 2010 05:27
Show Gist options
  • Save mapiondev/507693 to your computer and use it in GitHub Desktop.
Save mapiondev/507693 to your computer and use it in GitHub Desktop.
[java] seasarでActionをテストする
import org.junit.Test;
import org.seasar.extension.jdbc.JdbcManager;
import org.seasar.extension.unit.S2TestCase;
public class IndexActionTest extends S2TestCase {
// DIされる
public JdbcManager jdbcManager;
protected void setUp() throws Exception {
include("app.dicon");
super.setUp();
}
@Test
public void testone() {
IndexAction action = new IndexAction() {
// protectedなメソッドをオーバーライドしたければここで
};
// serviceとかformとかjdbcManagerとか手動で入れる
action.jdbcManager = jdbcManager;
// 以下テスト省略
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment