Пример #1
0
 @Test
 public void testGrammarSearchFullEntry() {
   BibEntry entry = new BibEntry();
   entry.setField(FieldName.TITLE, "systematic review");
   SearchQuery searchQuery = new SearchQuery("title=\"systematic review\"", false, false);
   assertTrue(searchQuery.isMatch(entry));
 }
Пример #2
0
 @Test
 public void testGrammarSearch() {
   BibEntry entry = new BibEntry();
   entry.addKeyword("one two", ',');
   SearchQuery searchQuery = new SearchQuery("keywords=\"one two\"", false, false);
   assertTrue(searchQuery.isMatch(entry));
 }
Пример #3
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));
  }
Пример #4
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));
  }
Пример #5
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));
  }