Skip to content

Instantly share code, notes, and snippets.

/*
* Copyright (c) 2015, Francis Galiegue (fgaliegue@gmail.com)
*
* This software is dual-licensed under:
*
* - the Lesser General Public License (LGPL) version 3.0 or, at your option, any
* later version;
* - the Apache Software License (ASL) version 2.0.
*
* The text of both licenses is available under the src/resources/ directory of
/*
* Copyright (c) 2015, Francis Galiegue (fgaliegue@gmail.com)
*
* This software is dual-licensed under:
*
* - the Lesser General Public License (LGPL) version 3.0 or, at your option, any
* later version;
* - the Apache Software License (ASL) version 2.0.
*
* The text of both licenses is available under the src/resources/ directory of
/*
* Copyright (c) 2015, Francis Galiegue (fgaliegue@gmail.com)
*
* This software is dual-licensed under:
*
* - the Lesser General Public License (LGPL) version 3.0 or, at your option, any
* later version;
* - the Apache Software License (ASL) version 2.0.
*
* The text of both licenses is available under the src/resources/ directory of
@Test
public void handleLoadFileTest()
throws IOException, SQLException
{
final Path path = mock(Path.class);
final CsvTraceModel model = mock(CsvTraceModel.class);
final CsvTracePresenter tracePresenter
= mock(CsvTracePresenter.class);
when(view.chooseFile()).thenReturn(path);
@Test
public void handleLoadFileNoFileTest()
{
when(view.chooseFile()).thenReturn(null);
presenter.handleLoadFile();
final InOrder inOrder = inOrder(factory, view);
inOrder.verify(view).chooseFile();
compile(group: "org.jooq", name: "jooq", version: "3.5.1");
// Uncomment this when the code generation needs to be rerun
//compile(group: "org.jooq", name: "jooq-meta", version: "3.5.1");
//compile(group: "org.jooq", name: "jooq-codegen", version: "3.5.1");
/**
* Run a task in the background producing a value; schedule a task consuming
* that value to run on the UI thread
*
* @param supplier the background task producing a value
* @param consumer the UI thread task consuming that value
* @param <T> type parameter of the produced/consume value
*/
public <T> void compute(
@OnBackgroundThread final Supplier<? extends T> supplier,
public void doRefreshTabs()
{
final ThrowingConsumer<CountDownLatch> await = CountDownLatch::await;
tabs.stream().map(TabPresenter::refresh).forEach(await.orDoNothing());
}
@Override
public Map<Integer, Integer> getDepthMap(final int startLine,
final int wantedLines)
throws GrappaDebuggerException
{
loadInputBuffer();
final List<IndexRange> ranges
= IntStream.range(startLine, startLine + wantedLines)
.mapToObj(inputBuffer::getLineRange)
package com.github.fge.grappa.debugger.mainwindow;
import com.github.fge.grappa.debugger.common.GuiTaskRunner;
import com.github.fge.grappa.debugger.javafx.AlertFactory;
import javafx.stage.Stage;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import java.io.IOException;
import java.util.concurrent.ExecutorService;