use of com.google.refine.browsing.facets.RangeFacet.RangeFacetConfig in project OpenRefine by OpenRefine.
the class RangeFacetTests method serializeRangeFacet.
@Test
public void serializeRangeFacet() throws JsonParseException, JsonMappingException, IOException {
Project project = createCSVProject("my column\n" + "89.2\n" + "-45.9\n" + "blah\n" + "0.4\n");
project.rows.get(0).cells.set(0, new Cell(89.2, null));
project.rows.get(1).cells.set(0, new Cell(-45.9, null));
project.rows.get(3).cells.set(0, new Cell(0.4, null));
Engine engine = new Engine(project);
RangeFacetConfig config = ParsingUtilities.mapper.readValue(configJson, RangeFacetConfig.class);
RangeFacet facet = config.apply(project);
facet.computeChoices(project, engine.getAllFilteredRows());
TestUtils.isSerializedTo(facet, facetJson);
}
use of com.google.refine.browsing.facets.RangeFacet.RangeFacetConfig in project OpenRefine by OpenRefine.
the class RangeFacetTests method serializeRangeFacetConfig.
@Test
public void serializeRangeFacetConfig() throws JsonParseException, JsonMappingException, IOException {
RangeFacetConfig config = ParsingUtilities.mapper.readValue(configJson, RangeFacetConfig.class);
TestUtils.isSerializedTo(config, configJson);
}
Aggregations