Search in sources :

Example 1 with FieldContentParserPreferences

use of org.jabref.logic.bibtex.FieldContentParserPreferences in project jabref by JabRef.

the class XMPSchemaBibtexTest method testSetBibtexEntry.

@Test
public void testSetBibtexEntry() throws IOException {
    when(prefs.getFieldContentParserPreferences()).thenReturn(new FieldContentParserPreferences());
    XMPMetadata xmp = new XMPMetadata();
    XMPSchemaBibtex bibtex = new XMPSchemaBibtex(xmp);
    BibEntry e = BibtexTestData.getBibtexEntry(prefs);
    bibtex.setBibtexEntry(e, null);
    BibEntry e2 = bibtex.getBibtexEntry();
    assertEqualsBibtexEntry(e, e2);
}
Also used : BibEntry(org.jabref.model.entry.BibEntry) FieldContentParserPreferences(org.jabref.logic.bibtex.FieldContentParserPreferences) XMPMetadata(org.apache.jempbox.xmp.XMPMetadata) Test(org.junit.Test)

Example 2 with FieldContentParserPreferences

use of org.jabref.logic.bibtex.FieldContentParserPreferences in project jabref by JabRef.

the class CiteKeyBasedFileFinderTest method setUp.

@Before
public void setUp() throws IOException {
    when(prefs.getFieldContentParserPreferences()).thenReturn(new FieldContentParserPreferences());
    BibDatabase database = BibtexTestData.getBibtexDatabase(prefs);
    entry = database.getEntries().iterator().next();
    rootDir = temporaryFolder.getRoot().toPath();
    Path subDir = Files.createDirectory(rootDir.resolve("Organization Science"));
    Path pdfSubDir = Files.createDirectory(rootDir.resolve("pdfs"));
    Files.createFile(subDir.resolve("HipKro03 - Hello.pdf"));
    Files.createFile(rootDir.resolve("HipKro03 - Hello.pdf"));
    Path pdfSubSubDir = Files.createDirectory(pdfSubDir.resolve("sub"));
    Files.createFile(pdfSubSubDir.resolve("HipKro03-sub.pdf"));
    Files.createDirectory(rootDir.resolve("2002"));
    Path dir2003 = Files.createDirectory(rootDir.resolve("2003"));
    Files.createFile(dir2003.resolve("Paper by HipKro03.pdf"));
    Path dirTest = Files.createDirectory(rootDir.resolve("test"));
    Files.createFile(dirTest.resolve(".TEST"));
    Files.createFile(dirTest.resolve("TEST["));
    Files.createFile(dirTest.resolve("TE.ST"));
    Files.createFile(dirTest.resolve("foo.dat"));
    Path graphicsDir = Files.createDirectory(rootDir.resolve("graphicsDir"));
    Path graphicsSubDir = Files.createDirectories(graphicsDir.resolve("subDir"));
    Files.createFile(graphicsSubDir.resolve("HipKro03test.jpg"));
    Files.createFile(graphicsSubDir.resolve("HipKro03test.png"));
}
Also used : Path(java.nio.file.Path) FieldContentParserPreferences(org.jabref.logic.bibtex.FieldContentParserPreferences) BibDatabase(org.jabref.model.database.BibDatabase) Before(org.junit.Before)

Aggregations

FieldContentParserPreferences (org.jabref.logic.bibtex.FieldContentParserPreferences)2 Path (java.nio.file.Path)1 XMPMetadata (org.apache.jempbox.xmp.XMPMetadata)1 BibDatabase (org.jabref.model.database.BibDatabase)1 BibEntry (org.jabref.model.entry.BibEntry)1 Before (org.junit.Before)1 Test (org.junit.Test)1