use of org.eol.globi.util.CypherQuery in project eol-globi-data by jhpoelen.
the class TaxonSearchImplIT method findCloseMatchesScientificChineseCharacters.
@Test
public void findCloseMatchesScientificChineseCharacters() throws IOException {
CypherQuery cypherQuery = new TaxonSearchImpl().findCloseMatchesForCommonAndScientificNames("Ariidae", null);
CypherTestUtil.validate(cypherQuery, neo4j.getGraphDatabaseService());
String response = new CypherQueryExecutor(cypherQuery).execute(null);
assertThat(response, StringContains.containsString("印度尼西亚海鲶"));
}
use of org.eol.globi.util.CypherQuery in project eol-globi-data by jhpoelen.
the class TaxonSearchImplIT method findCloseMatchesCommonNameFoxFrenchType.
@Test
public void findCloseMatchesCommonNameFoxFrenchType() throws IOException {
CypherQuery cypherQuery = new TaxonSearchImpl().findCloseMatchesForCommonAndScientificNames("reinard", null);
CypherTestUtil.validate(cypherQuery, neo4j.getGraphDatabaseService());
String response = new CypherQueryExecutor(cypherQuery).execute(null);
assertThat(response, StringContains.containsString("Vulpes vulpes"));
assertThat(response, StringContains.containsString("renard"));
}
use of org.eol.globi.util.CypherQuery in project eol-globi-data by jhpoelen.
the class TaxonSearchImplIT method nameSuggestions.
@Test
public void nameSuggestions() throws IOException {
CypherQuery cypherQuery = new TaxonSearchImpl().findCloseMatchesForCommonAndScientificNames("homo zapiens", null);
CypherTestUtil.validate(cypherQuery, neo4j.getGraphDatabaseService());
String result = new CypherQueryExecutor(cypherQuery).execute(null);
assertThat(result, containsString("Homo sapiens"));
}
use of org.eol.globi.util.CypherQuery in project eol-globi-data by jhpoelen.
the class TaxonSearchImplIT method findCloseMatchesUpperCase.
@Test
public void findCloseMatchesUpperCase() throws IOException {
CypherQuery cypherQuery = new TaxonSearchImpl().findCloseMatchesForCommonAndScientificNames("King Mackerel", null);
CypherTestUtil.validate(cypherQuery, neo4j.getGraphDatabaseService());
String response = new CypherQueryExecutor(cypherQuery).execute(null);
assertThat(response, StringContains.containsString("Scomberomorus cavalla"));
assertThat(response, StringContains.containsString("king mackeral"));
}
use of org.eol.globi.util.CypherQuery in project eol-globi-data by jhpoelen.
the class TaxonSearchImplIT method findApidae.
@Test
public void findApidae() throws IOException {
CypherQuery cypherQuery = new TaxonSearchImpl().findCloseMatchesForCommonAndScientificNames("Apidae", null);
CypherTestUtil.validate(cypherQuery, neo4j.getGraphDatabaseService());
String result = new CypherQueryExecutor(cypherQuery).execute(null);
JsonNode json = new ObjectMapper().readTree(result);
JsonNode data = json.get("data");
JsonNode firstRow = data.get(0);
JsonNode firstCell = firstRow.get(0);
assertThat(firstCell.asText(), is("Apidae"));
}
Aggregations