use of au.gov.asd.tac.constellation.views.tableview.components.Table in project constellation by constellation-app.
the class TablePaneNGTest method updateTable.
@Test
public void updateTable() {
final Graph graph = mock(Graph.class);
final TableViewState tableViewState = new TableViewState();
final Table table = mock(Table.class);
final ProgressBar progressBar = mock(ProgressBar.class);
final TableToolbar tableToolbar = mock(TableToolbar.class);
when(tablePane.getTable()).thenReturn(table);
when(tablePane.getProgressBar()).thenReturn(progressBar);
when(tablePane.getTableToolbar()).thenReturn(tableToolbar);
tablePane.updateTable(graph, tableViewState);
try {
tablePane.getFuture().get(30, TimeUnit.SECONDS);
} catch (InterruptedException | ExecutionException | TimeoutException ex) {
fail("The update thread did not finish as expected within the allowed time. " + "Something went wrong");
}
verify(tableToolbar).updateToolbar(tableViewState);
verify(table).updateColumns(graph, tableViewState);
verify(table).updateData(graph, tableViewState, progressBar);
verify(table).updateSelection(graph, tableViewState);
// The future finished but maybe not the JavaFX thread
WaitForAsyncUtils.waitForFxEvents();
verify(table).updateSortOrder();
}
use of au.gov.asd.tac.constellation.views.tableview.components.Table in project constellation by constellation-app.
the class UpdateTableSelectionTaskNGTest method updateSelectionTask.
@Test
public void updateSelectionTask() {
final TablePane tablePane = mock(TablePane.class);
final Graph graph = mock(Graph.class);
final TableViewState tableViewState = new TableViewState();
final Table table = mock(Table.class);
final ProgressBar progressBar = mock(ProgressBar.class);
when(tablePane.getTable()).thenReturn(table);
when(tablePane.getProgressBar()).thenReturn(progressBar);
final TriggerSelectionUpdateTask updateTableSelectionTask = new TriggerSelectionUpdateTask(tablePane, graph, tableViewState);
updateTableSelectionTask.run();
verify(table).updateSelection(graph, tableViewState);
}
Aggregations