Search in sources :

Example 1 with PreferencesService

use of org.jabref.preferences.PreferencesService in project jabref by JabRef.

the class ManageJournalAbbreviationsViewModelTest method setUpViewModel.

@Before
public void setUpViewModel() throws Exception {
    abbreviationPreferences = mock(JournalAbbreviationPreferences.class);
    PreferencesService preferences = mock(PreferencesService.class);
    when(preferences.getJournalAbbreviationPreferences()).thenReturn(abbreviationPreferences);
    dialogService = mock(DialogService.class);
    TaskExecutor taskExecutor = new CurrentThreadTaskExecutor();
    JournalAbbreviationLoader journalAbbreviationLoader = mock(JournalAbbreviationLoader.class);
    viewModel = new ManageJournalAbbreviationsViewModel(preferences, dialogService, taskExecutor, journalAbbreviationLoader);
    emptyTestFile = createTemporaryTestFile("emptyTestFile.txt", "");
    testFile1Entries = createTemporaryTestFile("testFile1Entries.txt", "Test Entry = TE" + NEWLINE + "");
    testFile3Entries = createTemporaryTestFile("testFile3Entries.txt", "Abbreviations = Abb" + NEWLINE + "Test Entry = TE" + NEWLINE + "MoreEntries = ME" + NEWLINE + "");
    testFile4Entries = createTemporaryTestFile("testFile4Entries.txt", "Abbreviations = Abb" + NEWLINE + "Test Entry = TE" + NEWLINE + "MoreEntries = ME" + NEWLINE + "Entry = E" + NEWLINE + "");
    testFile5EntriesWithDuplicate = createTemporaryTestFile("testFile5Entries.txt", "Abbreviations = Abb" + NEWLINE + "Test Entry = TE" + NEWLINE + "Test Entry = TE" + NEWLINE + "MoreEntries = ME" + NEWLINE + "EntryEntry = EE" + NEWLINE + "");
}
Also used : DialogService(org.jabref.gui.DialogService) CurrentThreadTaskExecutor(org.jabref.gui.util.CurrentThreadTaskExecutor) TaskExecutor(org.jabref.gui.util.TaskExecutor) CurrentThreadTaskExecutor(org.jabref.gui.util.CurrentThreadTaskExecutor) JournalAbbreviationPreferences(org.jabref.logic.journals.JournalAbbreviationPreferences) JournalAbbreviationLoader(org.jabref.logic.journals.JournalAbbreviationLoader) PreferencesService(org.jabref.preferences.PreferencesService) Before(org.junit.Before)

Aggregations

DialogService (org.jabref.gui.DialogService)1 CurrentThreadTaskExecutor (org.jabref.gui.util.CurrentThreadTaskExecutor)1 TaskExecutor (org.jabref.gui.util.TaskExecutor)1 JournalAbbreviationLoader (org.jabref.logic.journals.JournalAbbreviationLoader)1 JournalAbbreviationPreferences (org.jabref.logic.journals.JournalAbbreviationPreferences)1 PreferencesService (org.jabref.preferences.PreferencesService)1 Before (org.junit.Before)1