Search in sources :

Example 6 with Facet

use of com.google.refine.browsing.facets.Facet in project OpenRefine by OpenRefine.

the class ListFacetTests method testSelectedEmptyChoice.

@Test
public void testSelectedEmptyChoice() throws IOException {
    Project project = createCSVProject("Column A\n" + "a\n" + "c\n" + "e");
    Engine engine = new Engine(project);
    ListFacetConfig facetConfig = ParsingUtilities.mapper.readValue(jsonConfig, ListFacetConfig.class);
    Facet facet = facetConfig.apply(project);
    facet.computeChoices(project, engine.getAllFilteredRows());
    TestUtils.isSerializedTo(facet, selectedEmptyChoiceFacet);
}
Also used : Project(com.google.refine.model.Project) ListFacetConfig(com.google.refine.browsing.facets.ListFacet.ListFacetConfig) Engine(com.google.refine.browsing.Engine) Facet(com.google.refine.browsing.facets.Facet) RefineTest(com.google.refine.RefineTest) Test(org.testng.annotations.Test)

Aggregations

Facet (com.google.refine.browsing.facets.Facet)6 RefineTest (com.google.refine.RefineTest)3 ListFacetConfig (com.google.refine.browsing.facets.ListFacet.ListFacetConfig)3 Project (com.google.refine.model.Project)3 Test (org.testng.annotations.Test)3 Engine (com.google.refine.browsing.Engine)2 ListFacet (com.google.refine.browsing.facets.ListFacet)2 RangeFacet (com.google.refine.browsing.facets.RangeFacet)2 ScatterplotFacet (com.google.refine.browsing.facets.ScatterplotFacet)2 TextSearchFacet (com.google.refine.browsing.facets.TextSearchFacet)2 TimeRangeFacet (com.google.refine.browsing.facets.TimeRangeFacet)2 ConjunctiveFilteredRecords (com.google.refine.browsing.util.ConjunctiveFilteredRecords)1 ConjunctiveFilteredRows (com.google.refine.browsing.util.ConjunctiveFilteredRows)1 FilteredRecordsAsFilteredRows (com.google.refine.browsing.util.FilteredRecordsAsFilteredRows)1 JSONArray (org.json.JSONArray)1 JSONObject (org.json.JSONObject)1