use of org.jabref.logic.importer.ParserResult in project jabref by JabRef.
the class BibtexParserTest method parseRecognizesPreambleInParenthesis.
@Test
public void parseRecognizesPreambleInParenthesis() throws IOException {
ParserResult result = parser.parse(new StringReader("@preamble(some text and \\latex)"));
assertEquals(Optional.of("some text and \\latex"), result.getDatabase().getPreamble());
}
use of org.jabref.logic.importer.ParserResult in project jabref by JabRef.
the class BibtexParserTest method parseIgnoresAndWarnsAboutEntryWithFieldsThatAreNotSeperatedByComma.
@Test
public void parseIgnoresAndWarnsAboutEntryWithFieldsThatAreNotSeperatedByComma() throws IOException {
ParserResult result = parser.parse(new StringReader("@article{test,author={Ed von Test} year=2005}"));
assertTrue(result.hasWarnings());
Collection<BibEntry> c = result.getDatabase().getEntries();
assertEquals(0, c.size());
}
use of org.jabref.logic.importer.ParserResult in project jabref by JabRef.
the class BibtexParserTest method parseRecognizesUppercaseFields.
@Test
public void parseRecognizesUppercaseFields() throws IOException {
ParserResult result = parser.parse(new StringReader("@article{test,AUTHOR={Ed von Test}}"));
Collection<BibEntry> c = result.getDatabase().getEntries();
assertEquals(1, c.size());
BibEntry e = c.iterator().next();
assertEquals("article", e.getType());
assertEquals(Optional.of("test"), e.getCiteKeyOptional());
assertEquals(2, e.getFieldNames().size());
assertEquals(Optional.of("Ed von Test"), e.getField("author"));
}
use of org.jabref.logic.importer.ParserResult in project jabref by JabRef.
the class MrDLibImporterTest method testImportDatabaseMin.
@Test
public void testImportDatabaseMin() throws IOException {
ParserResult parserResult = importer.importDatabase(inputMin);
List<BibEntry> resultList = parserResult.getDatabase().getEntries();
assertSame(0, resultList.size());
}
use of org.jabref.logic.importer.ParserResult in project jabref by JabRef.
the class BibtexParserTest method parseRecognizesPreambleWithConcatenation.
@Test
public void parseRecognizesPreambleWithConcatenation() throws IOException {
ParserResult result = parser.parse(new StringReader("@preamble{\"some text\" # \"and \\latex\"}"));
assertEquals(Optional.of("\"some text\" # \"and \\latex\""), result.getDatabase().getPreamble());
}
Aggregations