-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
366 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
src/test/java/net/sf/jabref/importer/fileformat/RISImporterTestFiles.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package net.sf.jabref.importer.fileformat; | ||
|
||
import net.sf.jabref.*; | ||
import net.sf.jabref.bibtex.BibtexEntryAssert; | ||
import net.sf.jabref.importer.OutputPrinterToNull; | ||
import net.sf.jabref.model.entry.BibEntry; | ||
import org.junit.Assert; | ||
import org.junit.Before; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.junit.runners.Parameterized; | ||
import org.junit.runners.Parameterized.Parameter; | ||
import org.junit.runners.Parameterized.Parameters; | ||
|
||
import java.io.IOException; | ||
import java.io.InputStream; | ||
import java.util.Arrays; | ||
import java.util.Collection; | ||
import java.util.List; | ||
|
||
@RunWith(Parameterized.class) | ||
public class RISImporterTestFiles { | ||
|
||
private RisImporter risImporter; | ||
|
||
@Parameter | ||
public String fileName; | ||
|
||
|
||
@Before | ||
public void setUp() throws Exception { | ||
Globals.prefs = JabRefPreferences.getInstance(); | ||
risImporter = new RisImporter(); | ||
} | ||
|
||
@Parameters(name = "{0}") | ||
public static Collection<String> fileNames() { | ||
return Arrays.asList(new String[] {"RisImporterTest1", "RisImporterTest3", | ||
"RisImporterTest4a", "RisImporterTest4b", "RisImporterTest4c", | ||
"RisImporterTest5a", "RisImporterTest5b", "RisImporterTest6"}); | ||
} | ||
|
||
@Test | ||
public void testIsRecognizedFormat() throws IOException { | ||
try (InputStream stream = RISImporterTest.class.getResourceAsStream(fileName + ".ris")) { | ||
Assert.assertTrue(risImporter.isRecognizedFormat(stream)); | ||
} | ||
} | ||
|
||
@Test | ||
public void testImportEntries() throws IOException { | ||
try (InputStream risStream = RISImporterTest.class.getResourceAsStream(fileName + ".ris")) { | ||
|
||
List<BibEntry> risEntries = risImporter.importEntries(risStream, new OutputPrinterToNull()); | ||
BibtexEntryAssert.assertEquals(RISImporterTest.class, fileName + ".bib", risEntries); | ||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/test/resources/net/sf/jabref/importer/fileformat/RisImporterCorrupted.ris
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
| ||
JF - Empirical Software Engineering | ||
T1 - Editorial: Open Source and Empirical Software Engineering | ||
VL - 6 | ||
IS - 3 | ||
SP - 193 | ||
EP - 194 | ||
PY - 2001/09/01/ | ||
AU - Harrison, Warren | ||
UR - http://dx.doi.org/10.1023/A:1017379030770 | ||
ER - | ||
|
25 changes: 25 additions & 0 deletions
25
src/test/resources/net/sf/jabref/importer/fileformat/RisImporterTest1.bib
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
@phdthesis{, | ||
abstract = {abstract0 | ||
abstract1}, | ||
address = {32 peralta avenue los gatos ca}, | ||
author = {Cocke and Harrison, Warren Levenshtein Morris}, | ||
booktitle = {kmptnz}, | ||
comment = {comment0 | ||
comment1 | ||
comment2}, | ||
doi = {whatever}, | ||
editor = {Rives and Kasami}, | ||
issn = {kmptns}, | ||
journal = {kmptnd}, | ||
keywords = {keyword0, keyword1}, | ||
month = {#sep#}, | ||
pages = {193--194}, | ||
publisher = {kmptnv}, | ||
refid = {123456 sxdbgsd}, | ||
school = {kmptvf}, | ||
series = {Arrow}, | ||
title = {Editorial: Open Source and Empirical Software Engineering: Editorial. Editorial? Editorial: Editorials}, | ||
url = {http://dx.doi.org/10.1023/A:1017379030770}, | ||
volume = {6}, | ||
year = {2001} | ||
} |
69 changes: 61 additions & 8 deletions
69
src/test/resources/net/sf/jabref/importer/fileformat/RisImporterTest1.ris
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,66 @@ | ||
| ||
TY - JOUR | ||
| ||
TY - BOOK | ||
TY - JOUR | ||
TY - MGZN | ||
TY - THES | ||
TY - UNPB | ||
TY - RPRT | ||
TY - CHAP | ||
TY - OTHER | ||
TY - CONF | ||
JF - Empirical Software Engineering | ||
T1 - Editorial: Open Source and Empirical Software Engineering | ||
VL - 6 | ||
IS - 3 | ||
T1 - Editorial: Open Source and Empirical Software Engineering: | ||
TI - Editorial. | ||
T1 - Editorial? | ||
T1 - Editorial | ||
T1 - Editorials | ||
VL - 6 | ||
IS - | ||
SP - 193 | ||
EP - 194 | ||
PY - 99 | ||
PY - YEAR/MONTH/DAY/ | ||
PY - 2001/09/01/ | ||
AU - Harrison, Warren | ||
PY - 2001/00/00/ | ||
PY - /// | ||
PY - 2001/// | ||
Y1 - 2001/09/01/ | ||
AU - Cocke | ||
A1 - Harrison, Warren | ||
Levenshtein | ||
Morris | ||
A2 - Rives | ||
A2 - Kasami | ||
T2 - Automaton | ||
T3 - Arrow | ||
BT - State | ||
JA - kmptne | ||
JF - kmptnz | ||
TY - OTHER | ||
JO - kmptnd | ||
|
||
PB - kmptnv | ||
TY - THES | ||
PB - kmptvf | ||
ID - 123456 | ||
sxdbgsd | ||
AD - 32 peralta avenue los gatos ca | ||
CY - 32 peralta avenue los gatos ca | ||
SN - kmptns | ||
|
||
N2 - abstract0 | ||
AB - abstract1 | ||
UR - http://dx.doi.org/10.1023/A:1017379030770 | ||
ER - | ||
|
||
|
||
KW - keyword0 | ||
KW - keyword1 | ||
|
||
U1 - comment0 | ||
U2 - comment1 | ||
N1 - comment2 | ||
|
||
M3 - doi: whatever | ||
M3 - no | ||
|
||
IS - | ||
ER - kmpt |
14 changes: 14 additions & 0 deletions
14
src/test/resources/net/sf/jabref/importer/fileformat/RisImporterTest3.bib
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
@incollection{, | ||
author = {Barata, Catarina and Celebi, MEmre and Marques, JorgeS}, | ||
booktitle = {Dermoscopy Image Analysis}, | ||
comment = {doi:10.1201/b19107-2}, | ||
doi = {10.1201/b19107-2}, | ||
issn = {978-1-4822-5326-9}, | ||
month = {#sep#}, | ||
pages = {1-22}, | ||
publisher = {CRC Press}, | ||
series = {Digital Imaging and Computer Vision}, | ||
title = {Toward a Robust Analysis of Dermoscopy Images Acquired under Different Conditions}, | ||
url = {http://dx.doi.org/10.1201/b19107-2}, | ||
year = {2015} | ||
} |
Oops, something went wrong.