Search in sources :

Example 1 with SmartCar

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);
}
Also used : SmartCar(io.vertigo.dynamo.collections.data.domain.SmartCar) FacetedQuery(io.vertigo.dynamo.collections.model.FacetedQuery) DtList(io.vertigo.dynamo.domain.model.DtList) Test(org.junit.Test)

Example 2 with SmartCar

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());
}
Also used : SmartCar(io.vertigo.dynamo.collections.data.domain.SmartCar) FacetedQuery(io.vertigo.dynamo.collections.model.FacetedQuery) DtList(io.vertigo.dynamo.domain.model.DtList) Test(org.junit.Test)

Example 3 with SmartCar

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());
}
Also used : SmartCar(io.vertigo.dynamo.collections.data.domain.SmartCar) FacetedQuery(io.vertigo.dynamo.collections.model.FacetedQuery) DtList(io.vertigo.dynamo.domain.model.DtList) Test(org.junit.Test)

Example 4 with SmartCar

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);
}
Also used : SmartCar(io.vertigo.dynamo.collections.data.domain.SmartCar) FacetedQuery(io.vertigo.dynamo.collections.model.FacetedQuery) DtList(io.vertigo.dynamo.domain.model.DtList) Test(org.junit.Test)

Aggregations

SmartCar (io.vertigo.dynamo.collections.data.domain.SmartCar)4 FacetedQuery (io.vertigo.dynamo.collections.model.FacetedQuery)4 DtList (io.vertigo.dynamo.domain.model.DtList)4 Test (org.junit.Test)4