Search in sources :

Example 46 with BibDatabase

use of org.jabref.model.database.BibDatabase in project jabref by JabRef.

the class OOBibStyleTest method testInstitutionAuthorMarker.

@Test
public void testInstitutionAuthorMarker() throws IOException {
    OOBibStyle style = new OOBibStyle(StyleLoader.DEFAULT_NUMERICAL_STYLE_PATH, layoutFormatterPreferences);
    Map<BibEntry, BibDatabase> entryDBMap = new HashMap<>();
    List<BibEntry> entries = new ArrayList<>();
    BibDatabase database = new BibDatabase();
    BibEntry entry = new BibEntry();
    entry.setType("article");
    entry.setField("author", "{JabRef Development Team}");
    entry.setField("title", "JabRef Manual");
    entry.setField("year", "2016");
    database.insertEntry(entry);
    entries.add(entry);
    entryDBMap.put(entry, database);
    assertEquals("[JabRef Development Team, 2016]", style.getCitationMarker(entries, entryDBMap, true, null, null));
}
Also used : BibEntry(org.jabref.model.entry.BibEntry) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) BibDatabase(org.jabref.model.database.BibDatabase) Test(org.junit.Test)

Example 47 with BibDatabase

use of org.jabref.model.database.BibDatabase in project jabref by JabRef.

the class RegExpBasedFileFinderTests method setUp.

@Before
public void setUp() {
    entry = new BibEntry();
    entry.setType(BibtexEntryTypes.ARTICLE);
    entry.setCiteKey("HipKro03");
    entry.setField("author", "Eric von Hippel and Georg von Krogh");
    entry.setField("title", "Open Source Software and the \"Private-Collective\" Innovation Model: Issues for Organization Science");
    entry.setField("journal", "Organization Science");
    entry.setField("year", "2003");
    entry.setField("volume", "14");
    entry.setField("pages", "209--223");
    entry.setField("number", "2");
    entry.setField("address", "Institute for Operations Research and the Management Sciences (INFORMS), Linthicum, Maryland, USA");
    entry.setField("doi", "http://dx.doi.org/10.1287/orsc.14.2.209.14992");
    entry.setField("issn", "1526-5455");
    entry.setField("publisher", "INFORMS");
    database = new BibDatabase();
    database.insertEntry(entry);
}
Also used : BibEntry(org.jabref.model.entry.BibEntry) BibDatabase(org.jabref.model.database.BibDatabase) Before(org.junit.Before)

Example 48 with BibDatabase

use of org.jabref.model.database.BibDatabase 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());
}
Also used : BibEntry(org.jabref.model.entry.BibEntry) BibDatabase(org.jabref.model.database.BibDatabase) BibDatabaseContext(org.jabref.model.database.BibDatabaseContext) Test(org.junit.Test)

Example 49 with BibDatabase

use of org.jabref.model.database.BibDatabase 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());
}
Also used : BibEntry(org.jabref.model.entry.BibEntry) BibDatabase(org.jabref.model.database.BibDatabase) BibDatabaseContext(org.jabref.model.database.BibDatabaseContext) Test(org.junit.Test)

Example 50 with BibDatabase

use of org.jabref.model.database.BibDatabase in project jabref by JabRef.

the class BibDatabaseContextTest method testTypeBasedOnDefaultBiblatex.

@Test
public void testTypeBasedOnDefaultBiblatex() {
    BibDatabaseContext bibDatabaseContext = new BibDatabaseContext(new BibDatabase(), new MetaData(), new Defaults(BibDatabaseMode.BIBLATEX));
    assertEquals(BibDatabaseMode.BIBLATEX, bibDatabaseContext.getMode());
    bibDatabaseContext.setMode(BibDatabaseMode.BIBTEX);
    assertEquals(BibDatabaseMode.BIBTEX, bibDatabaseContext.getMode());
}
Also used : MetaData(org.jabref.model.metadata.MetaData) BibDatabaseContext(org.jabref.model.database.BibDatabaseContext) BibDatabase(org.jabref.model.database.BibDatabase) Test(org.junit.Test)

Aggregations

BibDatabase (org.jabref.model.database.BibDatabase)88 BibEntry (org.jabref.model.entry.BibEntry)60 Test (org.junit.Test)44 ParserResult (org.jabref.logic.importer.ParserResult)20 ArrayList (java.util.ArrayList)19 HashMap (java.util.HashMap)15 BibDatabaseContext (org.jabref.model.database.BibDatabaseContext)15 BibtexParser (org.jabref.logic.importer.fileformat.BibtexParser)13 MetaData (org.jabref.model.metadata.MetaData)12 IOException (java.io.IOException)10 Defaults (org.jabref.model.Defaults)9 Before (org.junit.Before)9 File (java.io.File)8 InputStreamReader (java.io.InputStreamReader)8 InputStream (java.io.InputStream)7 PropertyVetoException (com.sun.star.beans.PropertyVetoException)6 UnknownPropertyException (com.sun.star.beans.UnknownPropertyException)6 WrappedTargetException (com.sun.star.lang.WrappedTargetException)6 LinkedHashMap (java.util.LinkedHashMap)5 BasePanel (org.jabref.gui.BasePanel)5