use of com.agiletec.aps.system.common.entity.model.EntitySearchFilter in project entando-core by entando.
the class TestDataObjectEntityManager method testLoadFutureEvents1.
public void testLoadFutureEvents1() throws ApsSystemException {
Date today = DateConverter.parseDate("2005-01-01", "yyyy-MM-dd");
EntitySearchFilter filter = new EntitySearchFilter("DataInizio", true, today, null);
filter.setOrder(EntitySearchFilter.ASC_ORDER);
EntitySearchFilter[] filters = { filter };
List<String> dataObjects = this._dataObjectManager.searchId("EVN", filters);
String[] expectedOrderedEntitiesId = { "EVN21", "EVN20", "EVN25", "EVN41", "EVN23", "EVN24", "EVN193", "EVN194" };
assertEquals(expectedOrderedEntitiesId.length, dataObjects.size());
for (int i = 0; i < expectedOrderedEntitiesId.length; i++) {
assertEquals(expectedOrderedEntitiesId[i], dataObjects.get(i));
}
}
use of com.agiletec.aps.system.common.entity.model.EntitySearchFilter in project entando-core by entando.
the class TestDataObjectEntityManager method testLoadFutureEvents3.
public void testLoadFutureEvents3() throws ApsSystemException {
Date today = DateConverter.parseDate("2005-01-01", "yyyy-MM-dd");
EntitySearchFilter filter = new EntitySearchFilter("DataInizio", true, today, null);
filter.setOrder(EntitySearchFilter.DESC_ORDER);
EntitySearchFilter[] filters = { filter };
List<String> dataObjects = this._dataObjectManager.searchId("EVN", filters);
String[] expectedOrderedEntitiesId = { "EVN194", "EVN193", "EVN24", "EVN23", "EVN41", "EVN25", "EVN20", "EVN21" };
assertEquals(expectedOrderedEntitiesId.length, dataObjects.size());
for (int i = 0; i < expectedOrderedEntitiesId.length; i++) {
assertEquals(expectedOrderedEntitiesId[i], dataObjects.get(i));
}
}
use of com.agiletec.aps.system.common.entity.model.EntitySearchFilter in project entando-core by entando.
the class TestDataObjectEntityManager method testLoadPastEvents2.
public void testLoadPastEvents2() throws ApsSystemException {
Date today = DateConverter.parseDate("2008-10-01", "yyyy-MM-dd");
EntitySearchFilter filter = new EntitySearchFilter("DataInizio", true, null, today);
filter.setOrder(EntitySearchFilter.DESC_ORDER);
EntitySearchFilter[] filters = { filter };
List<String> dataObjects2 = this._dataObjectManager.searchId("EVN", filters);
String[] expectedOrderedEntitiesId = { "EVN23", "EVN41", "EVN25", "EVN20", "EVN21", "EVN103", "EVN192", "EVN191" };
assertEquals(expectedOrderedEntitiesId.length, dataObjects2.size());
for (int i = 0; i < expectedOrderedEntitiesId.length; i++) {
assertEquals(expectedOrderedEntitiesId[i], dataObjects2.get(i));
}
}
use of com.agiletec.aps.system.common.entity.model.EntitySearchFilter in project entando-core by entando.
the class TestDataObjectEntityManager method testSearchRecords.
public void testSearchRecords() throws Throwable {
List<ApsEntityRecord> dataObjects = this._dataObjectManager.searchRecords(null);
assertNotNull(dataObjects);
assertEquals(25, dataObjects.size());
EntitySearchFilter typeFilter = new EntitySearchFilter(IDataObjectManager.ENTITY_TYPE_CODE_FILTER_KEY, false, "ART", false);
EntitySearchFilter[] filters1 = { typeFilter };
dataObjects = this._dataObjectManager.searchRecords(filters1);
assertEquals(11, dataObjects.size());
EntitySearchFilter creationOrderFilter = new EntitySearchFilter(IDataObjectManager.DATA_OBJECT_CREATION_DATE_FILTER_KEY, false);
creationOrderFilter.setOrder(EntitySearchFilter.DESC_ORDER);
EntitySearchFilter[] filters2 = { typeFilter, creationOrderFilter };
String[] order2 = { "ART122", "ART121", "ART120", "ART112", "ART111", "ART104", "ART102", "ART187", "ART180", "ART179", "ART1" };
dataObjects = this._dataObjectManager.searchRecords(filters2);
assertEquals(order2.length, dataObjects.size());
this.verifyOrder(dataObjects, order2);
EntitySearchFilter descrFilter = new EntitySearchFilter(IDataObjectManager.DATA_OBJECT_DESCR_FILTER_KEY, false, "descriz", true);
EntitySearchFilter[] filters3 = { typeFilter, creationOrderFilter, descrFilter };
String[] order3 = { "ART187", "ART180", "ART179" };
dataObjects = this._dataObjectManager.searchRecords(filters3);
assertEquals(order3.length, dataObjects.size());
this.verifyOrder(dataObjects, order3);
EntitySearchFilter statusFilter = new EntitySearchFilter(IDataObjectManager.DATA_OBJECT_STATUS_FILTER_KEY, false, "AF", true);
EntitySearchFilter[] filters4 = { typeFilter, creationOrderFilter, descrFilter, statusFilter };
String[] order4 = { "ART187", "ART179" };
dataObjects = this._dataObjectManager.searchRecords(filters4);
assertEquals(order4.length, dataObjects.size());
this.verifyOrder(dataObjects, order4);
EntitySearchFilter onLineFilter = new EntitySearchFilter(IDataObjectManager.DATA_OBJECT_ONLINE_FILTER_KEY, false);
EntitySearchFilter[] filters5 = { typeFilter, creationOrderFilter, descrFilter, statusFilter, onLineFilter };
String[] order5 = { "ART187" };
dataObjects = this._dataObjectManager.searchRecords(filters5);
assertEquals(order5.length, dataObjects.size());
this.verifyOrder(dataObjects, order5);
onLineFilter.setNullOption(true);
EntitySearchFilter[] filters6 = { typeFilter, creationOrderFilter, descrFilter, statusFilter, onLineFilter };
String[] order6 = { "ART179" };
dataObjects = this._dataObjectManager.searchRecords(filters6);
assertEquals(order6.length, dataObjects.size());
this.verifyOrder(dataObjects, order6);
}
use of com.agiletec.aps.system.common.entity.model.EntitySearchFilter in project entando-core by entando.
the class TestDataObjectEntityManager method testLoadPastEvents1.
public void testLoadPastEvents1() throws ApsSystemException {
Date today = DateConverter.parseDate("2008-10-01", "yyyy-MM-dd");
EntitySearchFilter filter = new EntitySearchFilter("DataInizio", true, null, today);
filter.setOrder(EntitySearchFilter.ASC_ORDER);
EntitySearchFilter[] filters = { filter };
List<String> dataObjects2 = this._dataObjectManager.searchId("EVN", filters);
String[] expectedOrderedEntitiesId = { "EVN191", "EVN192", "EVN103", "EVN21", "EVN20", "EVN25", "EVN41", "EVN23" };
assertEquals(expectedOrderedEntitiesId.length, dataObjects2.size());
for (int i = 0; i < expectedOrderedEntitiesId.length; i++) {
assertEquals(expectedOrderedEntitiesId[i], dataObjects2.get(i));
}
}
Aggregations