Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -728,3 +728,5 @@ jmh {
iterations = 10
fork = 2
}

apply plugin: 'jacoco'
28 changes: 27 additions & 1 deletion src/test/java/org/jabref/cli/ArgumentProcessorTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;


class ArgumentProcessorTest {

Expand Down Expand Up @@ -73,6 +76,28 @@ void auxImport(@TempDir Path tempDir) throws Exception {

assertTrue(Files.exists(outputBib));
}

@Test
void noFileImport(@TempDir Path tempDir) throws Exception {
String auxFile = Path.of(AuxCommandLineTest.class.getResource("paper.aux").toURI()).toAbsolutePath().toString();
String originBib = Path.of(AuxCommandLineTest.class.getResource("origin.bib").toURI()).toAbsolutePath().toString();
String noExistBib = "nonexistant.bib";

Path outputBib = tempDir.resolve("output.bisb").toAbsolutePath();
String outputBibFile = outputBib.toAbsolutePath().toString();

List<String> args = List.of("--nogui", "--debug", "--aux", auxFile + "," + outputBibFile, originBib, noExistBib);

ArgumentProcessor processor = new ArgumentProcessor(
args.toArray(String[]::new),
Mode.INITIAL_START,
preferencesService,
mock(FileUpdateMonitor.class),
entryTypesManager);
processor.processArguments();

assertTrue(Files.exists(outputBib));
}

@Test
void exportMatches(@TempDir Path tempDir) throws Exception {
Expand Down Expand Up @@ -103,7 +128,8 @@ void exportMatches(@TempDir Path tempDir) throws Exception {
assertTrue(Files.exists(outputBib));
BibEntryAssert.assertEquals(expectedEntries, outputBib, bibtexImporter);
}



@Test
void convertBibtexToTablerefsabsbib(@TempDir Path tempDir) throws Exception {
Path originBib = Path.of(Objects.requireNonNull(ArgumentProcessorTest.class.getResource("origin.bib")).toURI());
Expand Down