mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-19 08:52:15 +01:00
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.
This commit is contained in:
parent
2bd7be07fe
commit
5700d2b539
@ -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<ArduinoFrameFixture>() {
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user