Skip to content

Commit

Permalink
Merge pull request JabRef#6128 from JabRef/fix-citeseer-test
Browse files Browse the repository at this point in the history
Fix fetcher test: CiteSeerTest
  • Loading branch information
koppor committed Mar 17, 2020
2 parents 2339e95 + 57b5833 commit 6468f42
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions src/test/java/org/jabref/logic/importer/fetcher/CiteSeerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,25 @@ void setUp() throws Exception {

@Test
void searchByQueryFindsEntry() throws Exception {
BibEntry expected = new BibEntry();
expected.setType(StandardEntryType.Misc);
expected.setField(StandardField.AUTHOR, "Wang Wei and Zhang Pingwen and Zhang Zhifei");
expected.setField(StandardField.TITLE, "Rigorous Derivation from Landau-de Gennes Theory to Eericksen-leslie Theory");
expected.setField(StandardField.DOI, "10.1.1.744.5780");
BibEntry expected = new BibEntry(StandardEntryType.Misc)
.withField(StandardField.AUTHOR, "Wang Wei and Zhang Pingwen and Zhang Zhifei")
.withField(StandardField.TITLE, "Rigorous Derivation from Landau-de Gennes Theory to Eericksen-leslie Theory")
.withField(StandardField.DOI, "10.1.1.744.5780");

List<BibEntry> fetchedEntries = fetcher.performSearch("title:Ericksen-Leslie AND venue:q AND ncites:[10 TO 15000]");
assertEquals(Collections.singletonList(expected), fetchedEntries);
}

@Test
void searchByQueryFindsEntry2() throws Exception {
BibEntry expected = new BibEntry();
expected.setType(StandardEntryType.Misc);
expected.setField(StandardField.AUTHOR, "Lazarus Richard S.");
expected.setField(StandardField.TITLE, "Coping Theory and Research: Past Present and Future");
expected.setField(StandardField.DOI, "10.1.1.115.9665");
expected.setField(StandardField.YEAR, "1993");
expected.setField(StandardField.JOURNALTITLE, "PSYCHOSOMATIC MEDICINE");

List<BibEntry> fetchedEntries = fetcher.performSearch("JabRef");
assertEquals(expected, fetchedEntries.get(4));
BibEntry expected = new BibEntry(StandardEntryType.Misc)
.withField(StandardField.AUTHOR, "Lazarus Richard S.")
.withField(StandardField.TITLE, "Coping Theory and Research: Past Present and Future")
.withField(StandardField.DOI, "10.1.1.115.9665")
.withField(StandardField.YEAR, "1993")
.withField(StandardField.JOURNALTITLE, "PSYCHOSOMATIC MEDICINE");

List<BibEntry> fetchedEntries = fetcher.performSearch("doi:10.1.1.115.9665");
assertEquals(Collections.singletonList(expected), fetchedEntries);
}
}

0 comments on commit 6468f42

Please sign in to comment.