, , , .
setDao((MyDAO) ApplicationInitializer.getApplicationContext().getBean("MyDAO"));
, . , ApplicationInitializer. getApplicationContext() ApplicationContext. MyDAO, getBean("MyDAO"). mockito , .
setUserPrincipal(); //fetches attribute from request and stores it in a var
? ? , , . MockHttpServletRequest.
setGroupValue();
, ? , , ?
setResults(getMyDao().getReportResults(getActionValue(), getTabName());
-, getReportResults() .
setFirstResultSet((List) getResults()[0]);
setSecondResultSet((List) getResults()[1]);
, - . , getReportResults(), .
return SUCCESS;
, SUCCESS .
/ ,
. , Spring.
unit test DAO , ?
unit test DAO, unit test. .
, DAO unit test, DAO , jndi .
, . , h2, ci . - DataSource .
, Struts. , mocks . , execute(), , , . .
- Struts 2 Spring. , Spring
MyDAO . .