use of nl.knaw.huygens.timbuctoo.search.description.PropertyParser in project timbuctoo by HuygensING.
the class ListFacetDescriptionTest method filterLetsTheParserParseEachDatabaseValue.
@Test
public void filterLetsTheParserParseEachDatabaseValue() {
String value1 = "value1";
List<FacetValue> facetValues = Lists.newArrayList(new ListFacetValue(FACET_NAME, Lists.newArrayList(value1)));
GraphTraversal<Vertex, Vertex> traversal = newGraph().withVertex(v -> v.withProperty(PROPERTY, "value1").withTimId("1")).withVertex(v -> v.withProperty(PROPERTY, "value2").withTimId("2")).build().traversal().V();
instance.filter(traversal, facetValues);
// needed to verify the parser
traversal.toList();
verify(propertyParser).parse("value1");
verify(propertyParser).parse("value2");
}
use of nl.knaw.huygens.timbuctoo.search.description.PropertyParser in project timbuctoo by HuygensING.
the class PropertyDescriptorFactoryTest method getLocalWithPropertyNameAndParserReturnsALocalPropertyDescriptor.
@Test
public void getLocalWithPropertyNameAndParserReturnsALocalPropertyDescriptor() {
PropertyParser parser = mock(PropertyParser.class);
PropertyDescriptor descriptor = instance.getLocal("propertyName", parser);
assertThat(descriptor, is(instanceOf(LocalPropertyDescriptor.class)));
}
use of nl.knaw.huygens.timbuctoo.search.description.PropertyParser in project timbuctoo by HuygensING.
the class AbstractPropertyParserTest method namesReturnsTheDefaultValueIfTheInputValueIsNull.
@Test
public void namesReturnsTheDefaultValueIfTheInputValueIsNull() {
String nullString = null;
PropertyParser instance = getInstance();
Object result = instance.parseForSort(nullString);
assertThat(result, is(nullValue()));
}
use of nl.knaw.huygens.timbuctoo.search.description.PropertyParser in project timbuctoo by HuygensING.
the class PropertyParserFactoryTest method getParserReturnsAChangeDatePropertyParserForChange.
@Test
public void getParserReturnsAChangeDatePropertyParserForChange() {
PropertyParser parser = instance.getParser(Change.class);
assertThat(parser, is(instanceOf(ChangeDatePropertyParser.class)));
}
use of nl.knaw.huygens.timbuctoo.search.description.PropertyParser in project timbuctoo by HuygensING.
the class PropertyParserFactoryTest method getParserReturnsADatableFromYearPropertyParserForDatable.
@Test
public void getParserReturnsADatableFromYearPropertyParserForDatable() {
PropertyParser parser = instance.getParser(Datable.class);
assertThat(parser, is(instanceOf(DatableFromYearPropertyParser.class)));
}
Aggregations