Search in sources :

Example 1 with FileLinkPreferences

use of org.jabref.logic.layout.format.FileLinkPreferences in project jabref by JabRef.

the class LayoutTest method testWrapFileLinksLayout.

@Test
public // Test for http://discourse.jabref.org/t/the-wrapfilelinks-formatter/172 (the example in the help files)
void testWrapFileLinksLayout() throws IOException {
    when(layoutFormatterPreferences.getFileLinkPreferences()).thenReturn(new FileLinkPreferences(Collections.emptyList(), Collections.singletonList("src/test/resources/pdfs/")));
    String layoutText = layout("\\begin{file}\\format[WrapFileLinks(\\i. \\d (\\p))]{\\file}\\end{file}", "@other{bla, file={Test file:encrypted.pdf:PDF}}");
    Assert.assertEquals("1. Test file (" + new File("src/test/resources/pdfs/encrypted.pdf").getCanonicalPath() + ")", layoutText);
}
Also used : FileLinkPreferences(org.jabref.logic.layout.format.FileLinkPreferences) File(java.io.File) Test(org.junit.Test)

Aggregations

File (java.io.File)1 FileLinkPreferences (org.jabref.logic.layout.format.FileLinkPreferences)1 Test (org.junit.Test)1