public void testNoError() {
// 入力データの設定
setRequestParams(defaultParams);
// 入力チェックの実行
actionPerform();
// 実行結果の検証
verifyNoActionErrors();
}
public void testUserid01() {
// 入力データの設定
setRequestParams(defaultParams, "userid", "");
// 入力チェックの実行
actionPerform();
// 実行結果の検証
verifyActionErrors(errorsRequired);
}
JUnitを実行すると下記のような例外がでます。
■例外内容
[2009/02/03 10:36:31][ERROR][ContextLoaderPlugIn] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name '/sampleBLogic' defined in ServletContext
resource [/WEB-INF/moduleContext.xml]: Cannot resolve reference to bean 'SampleBLogic'
while setting bean property 'businessLogic'; nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'SampleBLogic' defined in ServletContext resource [/WEB-INF/moduleContext.xml]:
Cannot resolve reference to bean 'queryDAO' while setting bean property 'queryDAO';
nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'queryDAO' is defined