Search in sources :

Example 1 with ActionSupport

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

the class TestDateAttributeFilterAction method testFailureAddDateValueFilter_2.

public void testFailureAddDateValueFilter_2() throws Throwable {
    // Opzione Data inserita
    String result = this.executeSaveValueDateFilter(IContentListFilterAction.INSERTED_DATE_FILTER, "");
    assertEquals(Action.INPUT, result);
    ActionSupport action = this.getAction();
    Map<String, List<String>> fieldsErrors = action.getFieldErrors();
    assertEquals(1, fieldsErrors.size());
    List<String> dateValueErrors = fieldsErrors.get("dateValue");
    assertEquals(1, dateValueErrors.size());
}
Also used : ActionSupport(com.opensymphony.xwork2.ActionSupport) List(java.util.List)

Example 2 with ActionSupport

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

the class TestDateAttributeFilterAction method testFailureAddDateValueFilter_3.

public void testFailureAddDateValueFilter_3() throws Throwable {
    // Opzione Data inserita
    String result = this.executeSaveValueDateFilter(IContentListFilterAction.INSERTED_DATE_FILTER, "wrongFormat");
    assertEquals(Action.INPUT, result);
    ActionSupport action = this.getAction();
    Map<String, List<String>> fieldsErrors = action.getFieldErrors();
    assertEquals(1, fieldsErrors.size());
    List<String> dateValueErrors = fieldsErrors.get("dateValue");
    // Errore in conversione e messaggio campo obbligatorio
    assertEquals(2, dateValueErrors.size());
}
Also used : ActionSupport(com.opensymphony.xwork2.ActionSupport) List(java.util.List)

Example 3 with ActionSupport

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

the class TestNumberAttributeFilterAction method testFailureAddRangeNumberFilter_2.

public void testFailureAddRangeNumberFilter_2() throws Throwable {
    String result = this.executeSaveRangeNumberFilter("56", "6");
    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");
    // numberStart > numberEnd
    assertEquals(1, numberValueErrors.size());
}
Also used : ActionSupport(com.opensymphony.xwork2.ActionSupport) List(java.util.List)

Example 4 with ActionSupport

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

the class TestNumberAttributeFilterAction method testFailureAddNumberValueFilter_2.

public void testFailureAddNumberValueFilter_2() throws Throwable {
    String result = this.executeSaveNumberValueFilter("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("numberValue");
    // Errore in conversione e messaggio campo obbligatorio
    assertEquals(2, numberValueErrors.size());
}
Also used : ActionSupport(com.opensymphony.xwork2.ActionSupport) List(java.util.List)

Example 5 with ActionSupport

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

the class TestTextAttributeFilterAction method testFailureAddTextFilter.

public void testFailureAddTextFilter() throws Throwable {
    Map<String, String> params = this.getBaseParams("NEW");
    params.put("filterKey", "Title");
    params.put("attributeFilter", "true");
    // Tipo Stringa
    params.put("filterTypeId", String.valueOf(IContentListFilterAction.TEXT_ATTRIBUTE_FILTER_TYPE));
    // Opzione "Value"
    params.put("filterOptionId", String.valueOf(IContentListFilterAction.VALUE_FILTER_OPTION));
    params.put("stringValue", "");
    String result = this.executeAddFilter("admin", params, "saveTextFilter");
    assertEquals(Action.INPUT, result);
    ActionSupport action = this.getAction();
    Map<String, List<String>> fieldsErrors = action.getFieldErrors();
    assertEquals(1, fieldsErrors.size());
    List<String> stringValueErrors = fieldsErrors.get("stringValue");
    assertEquals(1, stringValueErrors.size());
}
Also used : ActionSupport(com.opensymphony.xwork2.ActionSupport) 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