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());
}
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());
}
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());
}
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());
}
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());
}
Aggregations