Пример #1
0
  @Test
  public void testSearchMatchesSingleKeyword() {
    BibEntry e = new BibEntry(BibtexEntryTypes.INPROCEEDINGS.getName());
    e.setField("keywords", "banana, pineapple, orange");

    SearchQuery searchQuery = new SearchQuery("anykeyword==pineapple", false, false);
    assertTrue(searchQuery.isMatch(e));
  }
Пример #2
0
  @Test
  public void testSearchingForOpenBraketInBooktitle() {
    BibEntry e = new BibEntry(BibtexEntryTypes.INPROCEEDINGS.getName());
    e.setField(FieldName.BOOKTITLE, "Super Conference (SC)");

    SearchQuery searchQuery = new SearchQuery("booktitle=\"(\"", false, false);
    assertTrue(searchQuery.isMatch(e));
  }
Пример #3
0
  @Test
  public void testSearchAllFieldsNotForSpecificField() {
    BibEntry e = new BibEntry(BibtexEntryTypes.INPROCEEDINGS.getName());
    e.setField("title", "Fruity features");
    e.setField("keywords", "banana, pineapple, orange");

    SearchQuery searchQuery = new SearchQuery("anyfield=fruit and keywords!=banana", false, false);
    assertFalse(searchQuery.isMatch(e));
  }