use of io.vertigo.dynamo.collections.data.domain.SmartCar in project vertigo by KleeGroup.
the class FacetManagerTest method testFacetListByTerm.
/**
* Test le facettage par term d'une liste.
*/
@Test
public void testFacetListByTerm() {
final DtList<SmartCar> cars = smartCarDataBase.getAllCars();
final FacetedQuery facetedQuery = new FacetedQuery(carFacetQueryDefinition, SelectedFacetValues.empty().build());
final FacetedQueryResult<SmartCar, DtList<SmartCar>> result = collectionsManager.facetList(cars, facetedQuery);
testFacetResultByTerm(result);
}
use of io.vertigo.dynamo.collections.data.domain.SmartCar in project vertigo by KleeGroup.
the class FacetManagerTest method testFilterFacetListByRange.
/**
* Test le facettage par range d'une liste.
* Et le filtrage par une facette.
*/
@Test
public void testFilterFacetListByRange() {
final DtList<SmartCar> cars = smartCarDataBase.getAllCars();
final FacetedQuery facetedQuery = new FacetedQuery(carFacetQueryDefinition, SelectedFacetValues.empty().build());
final FacetedQueryResult<SmartCar, DtList<SmartCar>> result = collectionsManager.facetList(cars, facetedQuery);
// on applique une facette
final FacetedQuery query = addFacetQuery("FCT_YEAR_CAR", "avant", result);
final FacetedQueryResult<SmartCar, DtList<SmartCar>> resultFiltered = collectionsManager.facetList(result.getSource(), query);
Assert.assertEquals(smartCarDataBase.getCarsBefore(2000), resultFiltered.getCount());
}
use of io.vertigo.dynamo.collections.data.domain.SmartCar in project vertigo by KleeGroup.
the class FacetManagerTest method testFilterFacetListByTerm.
/**
* Test le facettage par term d'une liste.
* Et le filtrage par une facette.
*/
@Test
public void testFilterFacetListByTerm() {
final DtList<SmartCar> cars = smartCarDataBase.getAllCars();
final FacetedQuery facetedQuery = new FacetedQuery(carFacetQueryDefinition, SelectedFacetValues.empty().build());
final FacetedQueryResult<SmartCar, DtList<SmartCar>> result = collectionsManager.facetList(cars, facetedQuery);
// on applique une facette
final FacetedQuery query = addFacetQuery("FCT_MANUFACTURER_CAR", "peugeot", result);
final FacetedQueryResult<SmartCar, DtList<SmartCar>> resultFiltered = collectionsManager.facetList(result.getSource(), query);
Assert.assertEquals(smartCarDataBase.getCarsByManufacturer("peugeot").size(), (int) resultFiltered.getCount());
}
use of io.vertigo.dynamo.collections.data.domain.SmartCar in project vertigo by KleeGroup.
the class FacetManagerTest method testFacetListByRange.
/**
* Test le facettage par range d'une liste.
*/
@Test
public void testFacetListByRange() {
final DtList<SmartCar> cars = smartCarDataBase.getAllCars();
final FacetedQuery facetedQuery = new FacetedQuery(carFacetQueryDefinition, SelectedFacetValues.empty().build());
final FacetedQueryResult<SmartCar, DtList<SmartCar>> result = collectionsManager.facetList(cars, facetedQuery);
testFacetResultByRange(result);
}
Aggregations