use of com.opensymphony.xwork2.ActionSupport in project entando-core by entando.
the class TestContentViewerWidgetAction method testSave_2.
private void testSave_2(String contentId, String pageCode, int frame, String expectedResult) throws Throwable {
try {
this.intSaveViewerConfig(contentId, pageCode, frame);
String result = this.executeAction();
assertEquals(expectedResult, result);
if (expectedResult.equals(Action.INPUT)) {
ActionSupport action = this.getAction();
assertEquals(1, action.getFieldErrors().size());
assertEquals(1, action.getFieldErrors().get("contentId").size());
}
} catch (Throwable t) {
throw t;
} finally {
IPage page = this._pageManager.getDraftPage(pageCode);
page.getWidgets()[frame] = null;
this._pageManager.updatePage(page);
}
}
use of com.opensymphony.xwork2.ActionSupport in project entando-core by entando.
the class TestContentViewerWidgetAction method testFailureJoinContent_2.
public void testFailureJoinContent_2() throws Throwable {
// ID di contenuto non pubblico
String result = this.executeJoinContent("admin", "pagina_11", "1", "ART179");
assertEquals(Action.INPUT, result);
ActionSupport action = this.getAction();
Map<String, List<String>> fieldErrors = action.getFieldErrors();
assertEquals(1, fieldErrors.size());
List<String> contentIdFieldErrors = (List<String>) fieldErrors.get("contentId");
assertEquals(1, contentIdFieldErrors.size());
}
use of com.opensymphony.xwork2.ActionSupport in project entando-core by entando.
the class TestResourceAction method testSaveNewResource_2.
public void testSaveNewResource_2() throws Throwable {
String insertedDescr = "Description ";
while (insertedDescr.length() < 300) insertedDescr += insertedDescr;
this.setUserOnSession("admin");
this.initAction("/do/jacms/Resource", "save");
this.addParameter("strutsAction", String.valueOf(ApsAdminSystemConstants.ADD));
this.addParameter("descr", insertedDescr);
this.addParameter("mainGroup", Group.FREE_GROUP_NAME);
String result = this.executeAction();
assertEquals(Action.INPUT, result);
ActionSupport action = this.getAction();
Map<String, List<String>> actionFieldErrors = action.getFieldErrors();
assertEquals(3, actionFieldErrors.size());
assertEquals(1, actionFieldErrors.get("resourceTypeCode").size());
assertEquals(1, actionFieldErrors.get("descr").size());
}
use of com.opensymphony.xwork2.ActionSupport in project entando-core by entando.
the class TestJacmsEntityAttributeConfigAction method testValidateAttribute_5.
public void testValidateAttribute_5() throws Throwable {
this.executeEditEntityAttributePrototype("ART", JacmsSystemConstants.CONTENT_MANAGER, "Data");
this.initAction("/do/Entity/Attribute", "saveAttribute");
this.addParameter("attributeTypeCode", "Date");
this.addParameter("strutsAction", ApsAdminSystemConstants.EDIT);
this.addParameter("attributeName", "Data");
this.addParameter("rangeStartDate", "12/0777/2010");
this.addParameter("rangeEndDate", "gggggggg");
String result = this.executeAction();
assertEquals(Action.INPUT, result);
ActionSupport action = this.getAction();
assertEquals(2, action.getFieldErrors().size());
assertEquals(1, action.getFieldErrors().get("rangeStartDate").size());
assertEquals(1, action.getFieldErrors().get("rangeEndDate").size());
}
use of com.opensymphony.xwork2.ActionSupport in project entando-core by entando.
the class TestJacmsEntityAttributeConfigAction method testValidateAttribute_8.
public void testValidateAttribute_8() throws Throwable {
this.executeEditEntityAttributePrototype("EVN", JacmsSystemConstants.CONTENT_MANAGER, "DataInizio");
this.initAction("/do/Entity/Attribute", "saveAttribute");
this.addParameter("attributeTypeCode", "Date");
this.addParameter("strutsAction", ApsAdminSystemConstants.EDIT);
this.addParameter("attributeName", "DataInizio");
this.addParameter("rangeStartDate", "12/07/2004");
this.addParameter("rangeEndDate", "12/04/2010");
this.addParameter("rangeEndDateAttribute", "DataFine");
String result = this.executeAction();
assertEquals(Action.INPUT, result);
ActionSupport action = this.getAction();
assertEquals(1, action.getFieldErrors().size());
assertEquals(1, action.getFieldErrors().get("rangeEndDate").size());
}
Aggregations