Skip to content

Commit

Permalink
Added the InspecImportTest
Browse files Browse the repository at this point in the history
  • Loading branch information
mairdl committed Dec 21, 2015
1 parent dd6f7ac commit eb26272
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import java.util.List;

import net.sf.jabref.importer.OutputPrinterToNull;
import net.sf.jabref.model.entry.BibtexEntry;
import net.sf.jabref.model.entry.BibEntry;
import net.sf.jabref.model.entry.BibtexEntryTypes;
import org.junit.Assert;

Expand Down Expand Up @@ -59,9 +59,9 @@ public void testIsRecognizedFormatReject() throws IOException {
@Test
public void testImportEntries1() throws IOException{
try(InputStream inStream = InspecImportTest.class.getResourceAsStream("InspecImportTest2.txt")) {
List<BibtexEntry> entries = inspecImp.importEntries(inStream, new OutputPrinterToNull());
List<BibEntry> entries = inspecImp.importEntries(inStream, new OutputPrinterToNull());
assertEquals(1, entries.size());
BibtexEntry entry = entries.get(0);
BibEntry entry = entries.get(0);

assertEquals("The SIS project : software reuse with a natural language approach", entry.getField("title"));
assertEquals("Prechelt, Lutz", entry.getField("author"));
Expand All @@ -78,19 +78,19 @@ public void testImportEntries1() throws IOException{
@Test
public void testImportEntries2() throws IOException{
try(InputStream inStream = InspecImportTest.class.getResourceAsStream("InspecImportTest3.txt")) {
List<BibtexEntry> entries = inspecImp.importEntries(inStream, new OutputPrinterToNull());
List<BibEntry> entries = inspecImp.importEntries(inStream, new OutputPrinterToNull());
assertEquals(1, entries.size());
BibtexEntry entry = entries.get(0);
BibEntry entry = entries.get(0);
assertEquals(BibtexEntryTypes.INPROCEEDINGS, entry.getType());
}
}

@Test
public void testImportEntries3()throws IOException {
try (InputStream inStream = InspecImportTest.class.getResourceAsStream("InspecImportTest4.txt")){
List<BibtexEntry> entries = inspecImp.importEntries(inStream, new OutputPrinterToNull());
List<BibEntry> entries = inspecImp.importEntries(inStream, new OutputPrinterToNull());
assertEquals(1, entries.size());
BibtexEntry entry = entries.get(0);
BibEntry entry = entries.get(0);
assertEquals(BibtexEntryTypes.MISC, entry.getType());
}
}
Expand Down

0 comments on commit eb26272

Please sign in to comment.