use of org.apache.wicket.model.util.ListModel in project wicket-orientdb by OrienteerBAP.
the class TestFilters method testRangeFilterCriteriaSecondNull.
@Test
public void testRangeFilterCriteriaSecondNull() {
List<Integer> models = Lists.newArrayList();
models.add(NUM_VALUE_3);
models.add(null);
IModel<List<Integer>> listModel = new ListModel<>(models);
IFilterCriteriaManager manager = new FilterCriteriaManager(wicket.getProperty(NUMBER_FIELD));
manager.addFilterCriteria(manager.createRangeFilterCriteria(listModel, Model.of(true)));
String field = wicket.getProperty(NUMBER_FIELD).getObject().getName();
queryModel.addFilterCriteriaManager(field, manager);
queryModel.setSort(NUMBER_FIELD, SortOrder.ASCENDING);
assertTrue("size must be 2, but it is - " + queryModel.size(), queryModel.size() == 2);
}
use of org.apache.wicket.model.util.ListModel in project wicket-orientdb by OrienteerBAP.
the class TestFilters method testRangeFilterCriteriaFirstNull.
@Test
public void testRangeFilterCriteriaFirstNull() {
List<Integer> models = Lists.newArrayList();
models.add(null);
models.add(NUM_VALUE_2);
IModel<List<Integer>> listModel = new ListModel<>(models);
IFilterCriteriaManager manager = new FilterCriteriaManager(wicket.getProperty(NUMBER_FIELD));
manager.addFilterCriteria(manager.createRangeFilterCriteria(listModel, Model.of(true)));
String field = wicket.getProperty(NUMBER_FIELD).getObject().getName();
queryModel.addFilterCriteriaManager(field, manager);
queryModel.setSort(NUMBER_FIELD, SortOrder.ASCENDING);
assertTrue("size must be 2, but it is - " + queryModel.size(), queryModel.size() == 2);
}
use of org.apache.wicket.model.util.ListModel in project wicket-orientdb by OrienteerBAP.
the class TestFilters method testRangeFilterCriteria.
@Test
public void testRangeFilterCriteria() {
List<Integer> models = Lists.newArrayList();
models.add(NUM_VALUE_1);
models.add(NUM_VALUE_3);
IModel<List<Integer>> listModel = new ListModel<>(models);
IFilterCriteriaManager manager = new FilterCriteriaManager(wicket.getProperty(NUMBER_FIELD));
manager.addFilterCriteria(manager.createRangeFilterCriteria(listModel, Model.of(true)));
String field = wicket.getProperty(NUMBER_FIELD).getObject().getName();
queryModel.addFilterCriteriaManager(field, manager);
queryModel.setSort(NUMBER_FIELD, SortOrder.ASCENDING);
assertTrue("size must be 3, but it is - " + queryModel.size(), queryModel.size() == 3);
assertTrue(queryModel.getObject().get(0).field(NUMBER_FIELD).equals(NUM_VALUE_1));
assertTrue(queryModel.getObject().get(1).field(NUMBER_FIELD).equals(NUM_VALUE_2));
assertTrue(queryModel.getObject().get(2).field(NUMBER_FIELD).equals(NUM_VALUE_3));
}
Aggregations