From 53e72623c248494dd23284ab7fa993bd6ea3b69f Mon Sep 17 00:00:00 2001 From: Caleb Hulbert Date: Thu, 24 Aug 2023 15:21:34 -0400 Subject: [PATCH] fix(test): compile error --- .../paintera/PainteraBaseViewTest.java | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/test/java/org/janelia/saalfeldlab/paintera/PainteraBaseViewTest.java b/src/test/java/org/janelia/saalfeldlab/paintera/PainteraBaseViewTest.java index 66f675348..d100433e8 100644 --- a/src/test/java/org/janelia/saalfeldlab/paintera/PainteraBaseViewTest.java +++ b/src/test/java/org/janelia/saalfeldlab/paintera/PainteraBaseViewTest.java @@ -22,14 +22,13 @@ import org.janelia.saalfeldlab.util.grids.LabelBlockLookupAllBlocks; import org.janelia.saalfeldlab.util.grids.LabelBlockLookupNoBlocks; import org.jetbrains.annotations.NotNull; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; import org.testfx.api.FxRobot; +import org.testfx.api.FxToolkit; import org.testfx.framework.junit.ApplicationTest; import java.util.Arrays; import java.util.Random; +import java.util.concurrent.TimeoutException; import java.util.function.BiFunction; import java.util.function.Consumer; import java.util.function.Supplier; @@ -37,7 +36,7 @@ public class PainteraBaseViewTest extends FxRobot { -// @BeforeClass + // @BeforeClass public static void setup() throws Exception { System.setProperty("headless.geometry", "1600x1200-32"); @@ -47,14 +46,17 @@ public static void setup() throws Exception { ApplicationTest.launch(Paintera.class, "--log-level=ERROR"); } -// @AfterClass - public static void cleanup() throws InterruptedException { + // @AfterClass + public static void cleanup() throws InterruptedException, TimeoutException { InvokeOnJavaFXApplicationThread.invokeAndWait(() -> { - Paintera.getApplication().resetApplication(); + Paintera.getPaintera().getBaseView().stop(); + Paintera.getPaintera().getProjectDirectory().close(); }); + FxToolkit.cleanupApplication(Paintera.getApplication()); } -// @Test + + // @Test public void testAddSingleScaleLabelSource() { final RandomAccessibleInterval labels = ArrayImgs.unsignedLongs(10, 15, 20); final PainteraBaseView viewer = Paintera.getPaintera().getBaseView(); @@ -66,7 +68,7 @@ public void testAddSingleScaleLabelSource() { "singleScaleLabelSource", new LabelBlockLookupNoBlocks()); } -// @Test + // @Test public void testAddSingleScaleConnectomicsRawSource() { final Random random = new Random(); final RandomAccessibleInterval rawData = @@ -87,7 +89,7 @@ public void testAddSingleScaleConnectomicsRawSource() { ); } -// @Test + // @Test public void testAddMultiScaleConnectomicsRawSource() { var random = new Random(); final double[] center2D = new double[]{500, 500}; @@ -132,7 +134,7 @@ private static void fillCylinderChunk(double[] center2D, Double scale, LoopBuild }); } -// @Test + // @Test public void testAddMultiScaleConnectomicsLabelSource() { final Random random = new Random();