public void testRemoveImage() throws Throwable {
SurveyAction action = null;
String result = null;
Survey survey = this.prepareSurveyForTest(true, true);
Survey verify = null;
ApsProperties prop = null;
try {
this.setUserOnSession("admin");
this.getSurveyManager().saveSurvey(survey);
survey.setImageId("29975");
this.getSurveyManager().updateSurvey(survey);
this.initAction("/do/jpsurvey/Survey", "removeSurveyImage");
this.addParameter("surveyId", survey.getId());
this.addParameter("questionnaire", survey.isQuestionnaire());
this.addParameter("checkCookie", survey.isCheckCookie());
this.addParameter("imageId", survey.getImageId());
this.addParameter("title-it", "Questa");
this.addParameter("description-it", "è");
this.addParameter("imageDescription-it", "Spartaaaa");
this.addParameter("resourceTypeCode", "Image");
this.addParameter("groupName", survey.getGroupName());
this.addParameter("startDate", "10/06/2009");
this.addParameter("strutsAction", ApsAdminSystemConstants.EDIT);
this.addParameter("gatherUserInfo", survey.isGatherUserInfo());
result = this.executeAction();
assertNotNull(result);
action = (SurveyAction) this.getAction();
assertEquals(action.SUCCESS, result);
verify = this.getSurveyManager().loadSurvey(survey.getId());
assertNull(verify.getImageId());
assertTrue(verify.getImageDescriptions().isEmpty());
prop = verify.getTitles();
assertEquals("Questa", prop.getProperty("it"));
prop = verify.getDescriptions();
assertEquals("è", prop.getProperty("it"));
prop = verify.getImageDescriptions();
assertNull(prop.getProperty("it"));
} catch (Throwable t) {
throw t;
} finally {
this.getSurveyManager().deleteSurvey(survey.getId());
}