Exemplo n.º 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));
 }
Exemplo n.º 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));
 }
Exemplo n.º 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));
  }
Exemplo n.º 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));
  }
Exemplo n.º 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));
  }