Search in sources :

Example 1 with CurrentThreadTaskExecutor

use of org.jabref.gui.util.CurrentThreadTaskExecutor in project jabref by JabRef.

the class GroupNodeViewModelTest method setUp.

@Before
public void setUp() throws Exception {
    stateManager = mock(StateManager.class);
    when(stateManager.getSelectedEntries()).thenReturn(FXCollections.emptyObservableList());
    databaseContext = new BibDatabaseContext();
    taskExecutor = new CurrentThreadTaskExecutor();
    viewModel = getViewModelForGroup(new WordKeywordGroup("Test group", GroupHierarchyType.INDEPENDENT, "test", "search", true, ',', false));
}
Also used : StateManager(org.jabref.gui.StateManager) CurrentThreadTaskExecutor(org.jabref.gui.util.CurrentThreadTaskExecutor) BibDatabaseContext(org.jabref.model.database.BibDatabaseContext) WordKeywordGroup(org.jabref.model.groups.WordKeywordGroup) Before(org.junit.Before)

Example 2 with CurrentThreadTaskExecutor

use of org.jabref.gui.util.CurrentThreadTaskExecutor in project jabref by JabRef.

the class GroupTreeViewModelTest method setUp.

@Before
public void setUp() throws Exception {
    databaseContext = new BibDatabaseContext();
    stateManager = new StateManager();
    stateManager.activeDatabaseProperty().setValue(Optional.of(databaseContext));
    taskExecutor = new CurrentThreadTaskExecutor();
    groupTree = new GroupTreeViewModel(stateManager, mock(DialogService.class), taskExecutor);
}
Also used : StateManager(org.jabref.gui.StateManager) CurrentThreadTaskExecutor(org.jabref.gui.util.CurrentThreadTaskExecutor) BibDatabaseContext(org.jabref.model.database.BibDatabaseContext) Before(org.junit.Before)

Example 3 with CurrentThreadTaskExecutor

use of org.jabref.gui.util.CurrentThreadTaskExecutor 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

CurrentThreadTaskExecutor (org.jabref.gui.util.CurrentThreadTaskExecutor)3 Before (org.junit.Before)3 StateManager (org.jabref.gui.StateManager)2 BibDatabaseContext (org.jabref.model.database.BibDatabaseContext)2 DialogService (org.jabref.gui.DialogService)1 TaskExecutor (org.jabref.gui.util.TaskExecutor)1 JournalAbbreviationLoader (org.jabref.logic.journals.JournalAbbreviationLoader)1 JournalAbbreviationPreferences (org.jabref.logic.journals.JournalAbbreviationPreferences)1 WordKeywordGroup (org.jabref.model.groups.WordKeywordGroup)1 PreferencesService (org.jabref.preferences.PreferencesService)1