Search in sources :

Example 51 with ActionSupport

use of com.opensymphony.xwork2.ActionSupport in project entando-core by entando.

the class TestNumberAttributeFilterAction method testFailureAddRangeNumberFilter_3.

public void testFailureAddRangeNumberFilter_3() throws Throwable {
    String result = this.executeSaveRangeNumberFilter("6", "wrongFormat");
    assertEquals(Action.INPUT, result);
    ActionSupport action = this.getAction();
    Map<String, List<String>> fieldsErrors = action.getFieldErrors();
    assertEquals(1, fieldsErrors.size());
    List<String> numberValueErrors = fieldsErrors.get("numberEnd");
    // numberEnd wrong Format
    assertEquals(1, numberValueErrors.size());
}
Also used : ActionSupport(com.opensymphony.xwork2.ActionSupport) List(java.util.List)

Example 52 with ActionSupport

use of com.opensymphony.xwork2.ActionSupport in project entando-core by entando.

the class TestContentFinderViewerAction method testFailureJoinContent_1.

public void testFailureJoinContent_1() throws Throwable {
    // ID Nullo
    String result = this.executeJoinContent("admin", "pagina_11", "1", null);
    assertEquals(Action.INPUT, result);
    ActionSupport action = this.getAction();
    Map<String, List<String>> fieldErrors = action.getFieldErrors();
    assertEquals(1, fieldErrors.size());
    List<String> contentIdFieldErrors = fieldErrors.get("contentId");
    assertEquals(1, contentIdFieldErrors.size());
}
Also used : ActionSupport(com.opensymphony.xwork2.ActionSupport) List(java.util.List)

Example 53 with ActionSupport

use of com.opensymphony.xwork2.ActionSupport in project entando-core by entando.

the class TestContentViewerWidgetAction method testFailureJoinContent_1.

public void testFailureJoinContent_1() throws Throwable {
    // ID Nullo
    String result = this.executeJoinContent("admin", "pagina_11", "1", null);
    assertEquals(Action.INPUT, result);
    ActionSupport action = this.getAction();
    Map<String, List<String>> fieldErrors = action.getFieldErrors();
    assertEquals(1, fieldErrors.size());
    List<String> contentIdFieldErrors = fieldErrors.get("contentId");
    assertEquals(1, contentIdFieldErrors.size());
}
Also used : ActionSupport(com.opensymphony.xwork2.ActionSupport) List(java.util.List)

Example 54 with ActionSupport

use of com.opensymphony.xwork2.ActionSupport in project entando-core by entando.

the class TestContentViewerWidgetAction method testFailureJoinContent_3.

public void testFailureJoinContent_3() throws Throwable {
    // ID di contenuto non autorizzato
    String result = this.executeJoinContent("admin", "pagina_11", "1", "ART122");
    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());
}
Also used : ActionSupport(com.opensymphony.xwork2.ActionSupport) List(java.util.List)

Example 55 with ActionSupport

use of com.opensymphony.xwork2.ActionSupport in project entando-core by entando.

the class TestResourceAction method testSaveNewResource_1.

public void testSaveNewResource_1() throws Throwable {
    this.setUserOnSession("admin");
    this.initAction("/do/jacms/Resource", "save");
    this.addParameter("strutsAction", String.valueOf(ApsAdminSystemConstants.ADD));
    String result = this.executeAction();
    assertEquals(Action.INPUT, result);
    ActionSupport action = this.getAction();
    Map<String, List<String>> actionFieldErrors = action.getFieldErrors();
    assertEquals(4, actionFieldErrors.size());
    assertEquals(1, actionFieldErrors.get("resourceTypeCode").size());
    assertEquals(1, actionFieldErrors.get("descr").size());
    assertEquals(1, actionFieldErrors.get("mainGroup").size());
    assertEquals(1, actionFieldErrors.get("upload").size());
}
Also used : ActionSupport(com.opensymphony.xwork2.ActionSupport) ArrayList(java.util.ArrayList) List(java.util.List)

Aggregations

ActionSupport (com.opensymphony.xwork2.ActionSupport)56 List (java.util.List)28 Content (com.agiletec.plugins.jacms.aps.system.services.content.model.Content)14 Widget (com.agiletec.aps.system.services.page.Widget)4 ApsProperties (com.agiletec.aps.util.ApsProperties)4 HashMap (java.util.HashMap)4 WidgetType (org.entando.entando.aps.system.services.widgettype.WidgetType)4 IPage (com.agiletec.aps.system.services.page.IPage)3 ArrayList (java.util.ArrayList)3 IManager (com.agiletec.aps.system.common.IManager)2 IUserProfile (org.entando.entando.aps.system.services.userprofile.model.IUserProfile)2 BooleanAttribute (com.agiletec.aps.system.common.entity.model.attribute.BooleanAttribute)1 MonoListAttribute (com.agiletec.aps.system.common.entity.model.attribute.MonoListAttribute)1 Lang (com.agiletec.aps.system.services.lang.Lang)1 PageMetadata (com.agiletec.aps.system.services.page.PageMetadata)1 PageModel (com.agiletec.aps.system.services.pagemodel.PageModel)1 SymbolicLink (com.agiletec.plugins.jacms.aps.system.services.content.model.SymbolicLink)1 LinkAttribute (com.agiletec.plugins.jacms.aps.system.services.content.model.extraAttribute.LinkAttribute)1 ActionProxyFactory (com.opensymphony.xwork2.ActionProxyFactory)1