Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix fetcher test: CiteSeerTest #6128

Merged
merged 1 commit into from
Mar 17, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
}
}