|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
org.seasar.framework.unit.S2FrameworkTestCase
org.seasar.extension.unit.S2TestCase
org.seasar.framework.unit.S2TigerTestCase
org.seasar.cubby.unit.CubbyTestCase
public class CubbyTestCase
CubbyのActionクラスの単体テスト用のクラスです。
このクラスを継承して、それぞれのActionクラス用の単体テストを作成します。 親クラスに
public class HelloActionTest extends CubbyTestCase<HelloAction> { private HelloAction action; protected void setUp() throws Exception { include("app.dicon"); } public void testIndex() throws Exception { ActionResult result = processAction("/hello/"); assertPathEquals(Forward.class, "input.jsp", result); } public void testMessage() throws Exception { getRequest().addParameter("name", "name1"); ActionResult result = processAction("/hello/message"); assertPathEquals(Forward.class, "result.jsp", result); assertEquals("name1", action.name); } }
入れ子のクラスの概要 |
---|
クラス org.seasar.framework.unit.S2TigerTestCase から継承された入れ子のクラス/インタフェース |
---|
S2TigerTestCase.Subsequence |
フィールドの概要 |
---|
クラス org.seasar.framework.unit.S2TigerTestCase から継承されたフィールド |
---|
easyMockSupport |
クラス org.seasar.framework.unit.S2FrameworkTestCase から継承されたフィールド |
---|
ENV_PATH, ENV_VALUE |
コンストラクタの概要 | |
---|---|
CubbyTestCase()
|
メソッドの概要 | |
---|---|
static void |
assertPathEquals(Class<? extends ActionResult> resultClass,
String expectedPath,
ActionResult actualResult)
ActionResultの型とパスをチェックします。 |
protected ActionResult |
processAction(String orginalPath)
アクションメソッドを実行します。 |
protected String |
routing(String orginalPath)
CubbyFilterで行っているルーティングをエミュレートして、内部フォワードパスをリクエストにセットします。 |
クラス org.seasar.framework.unit.S2TigerTestCase から継承されたメソッド |
---|
addAspecDef, applyMockInterceptor, applyMockInterceptor, createExpression, createMock, createNiceMock, createStrictMock, doRecord, doRunTest, runBare, setUpForEachTestMethod, tearDownForEachTestMethod |
クラス junit.framework.TestCase から継承されたメソッド |
---|
countTestCases, createResult, getName, run, run, runTest, setName, setUp, tearDown, toString |
クラス junit.framework.Assert から継承されたメソッド |
---|
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format |
クラス java.lang.Object から継承されたメソッド |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
コンストラクタの詳細 |
---|
public CubbyTestCase()
メソッドの詳細 |
---|
public static void assertPathEquals(Class<? extends ActionResult> resultClass, String expectedPath, ActionResult actualResult)
resultClass
- ActionResultの型expectedPath
- 期待されるパスactualResult
- チェックするActionResultprotected ActionResult processAction(String orginalPath) throws Exception
orginalPath
- パス
Exception
protected String routing(String orginalPath) throws NoSuchFieldException
orginalPath
- オリジナルパス
NoSuchFieldException
|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |