use of org.jabref.model.database.BibDatabaseContext in project jabref by JabRef.
the class ModsExportFormatTest method setUp.
@Before
public void setUp() throws Exception {
databaseContext = new BibDatabaseContext();
charset = StandardCharsets.UTF_8;
modsExportFormat = new ModsExportFormat();
bibtexImporter = new BibtexImporter(mock(ImportFormatPreferences.class, Answers.RETURNS_DEEP_STUBS));
tempFile = testFolder.newFile();
importFile = Paths.get(ModsExportFormatTest.class.getResource("ModsExportFormatTestAllFields.bib").toURI());
}
use of org.jabref.model.database.BibDatabaseContext in project jabref by JabRef.
the class ModsExportFormatTestFiles method setUp.
@Before
public void setUp() throws Exception {
databaseContext = new BibDatabaseContext();
importFile = Paths.get(ModsExportFormatTestFiles.class.getResource(filename).toURI());
charset = StandardCharsets.UTF_8;
modsExportFormat = new ModsExportFormat();
tempFile = testFolder.newFile();
bibtexImporter = new BibtexImporter(mock(ImportFormatPreferences.class, Answers.RETURNS_DEEP_STUBS));
modsImporter = new ModsImporter();
}
use of org.jabref.model.database.BibDatabaseContext in project jabref by JabRef.
the class IntegrityCheckTest method createContext.
private BibDatabaseContext createContext(String field, String value, MetaData metaData) {
BibEntry entry = new BibEntry();
entry.setField(field, value);
BibDatabase bibDatabase = new BibDatabase();
bibDatabase.insertEntry(entry);
return new BibDatabaseContext(bibDatabase, metaData, new Defaults());
}
use of org.jabref.model.database.BibDatabaseContext in project jabref by JabRef.
the class BibDatabaseContextTest method testTypeBasedOnInferredModeBiblatex.
@Test
public void testTypeBasedOnInferredModeBiblatex() {
BibDatabase db = new BibDatabase();
BibEntry e1 = new BibEntry("electronic");
db.insertEntry(e1);
BibDatabaseContext bibDatabaseContext = new BibDatabaseContext(db);
assertEquals(BibDatabaseMode.BIBLATEX, bibDatabaseContext.getMode());
}
use of org.jabref.model.database.BibDatabaseContext in project jabref by JabRef.
the class BibDatabaseContextTest method testTypeBasedOnInferredModeBibTeX.
@Test
public void testTypeBasedOnInferredModeBibTeX() {
BibDatabase db = new BibDatabase();
BibEntry e1 = new BibEntry();
db.insertEntry(e1);
BibDatabaseContext bibDatabaseContext = new BibDatabaseContext(db);
assertEquals(BibDatabaseMode.BIBTEX, bibDatabaseContext.getMode());
}
Aggregations