From 5700d2b5396750ed1fbd14895951154edd9a6f63 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Wed, 6 May 2020 20:59:24 +0200 Subject: [PATCH] AbstractGUITest: Make a subclass of AbstractWithPreferencesTest Both classes contained some duplicate code, so unify that by making one a subclass of the other. This also prepares for further additions that should be inherited by both. --- app/test/processing/app/AbstractGUITest.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/app/test/processing/app/AbstractGUITest.java b/app/test/processing/app/AbstractGUITest.java index d1db60d98..913508856 100644 --- a/app/test/processing/app/AbstractGUITest.java +++ b/app/test/processing/app/AbstractGUITest.java @@ -41,25 +41,21 @@ import processing.app.helpers.FileUtils; import javax.swing.*; import java.util.Random; -public abstract class AbstractGUITest { +public abstract class AbstractGUITest extends AbstractWithPreferencesTest { protected ArduinoFrameFixture window; @Before public void startUpTheIDE() throws Exception { + // This relies on AbstractWithPreferencesTest to set up the + // non-gui-specific stuff. + System.setProperty("mrj.version", "whynot"); //makes sense only on osx. See https://github.com/alexruiz/fest-swing-1.x/issues/2#issuecomment-86532042 - Runtime.getRuntime().addShutdownHook(new Thread(DeleteFilesOnShutdown.INSTANCE)); FailOnThreadViolationRepaintManager.install(); - BaseNoGui.initPlatform(); - BaseNoGui.getPlatform().init(); - PreferencesData.init(null); JPopupMenu.setDefaultLightWeightPopupEnabled(false); - Theme.init(); BaseNoGui.getPlatform().setLookAndFeel(); - Base.untitledFolder = FileUtils.createTempFolder("untitled" + new Random().nextInt(Integer.MAX_VALUE), ".tmp"); - DeleteFilesOnShutdown.add(Base.untitledFolder); window = GuiActionRunner.execute(new GuiQuery() { @Override