mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-29 18:52:13 +01:00
Tests weren't deleting temporary files: fixed
This commit is contained in:
parent
96c4576962
commit
dabd6e4903
@ -1,12 +1,12 @@
|
||||
package processing.app;
|
||||
|
||||
import cc.arduino.files.DeleteFilesOnShutdown;
|
||||
import org.fest.swing.edt.FailOnThreadViolationRepaintManager;
|
||||
import org.fest.swing.edt.GuiActionRunner;
|
||||
import org.fest.swing.edt.GuiQuery;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import processing.app.helpers.ArduinoFrameFixture;
|
||||
import processing.app.helpers.FileUtils;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
@ -17,6 +17,7 @@ public abstract class AbstractGUITest {
|
||||
@Before
|
||||
public void startUpTheIDE() throws Exception {
|
||||
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();
|
||||
|
||||
@ -26,6 +27,7 @@ public abstract class AbstractGUITest {
|
||||
Theme.init();
|
||||
Base.getPlatform().setLookAndFeel();
|
||||
Base.untitledFolder = Base.createTempFolder("untitled");
|
||||
DeleteFilesOnShutdown.add(Base.untitledFolder);
|
||||
|
||||
window = GuiActionRunner.execute(new GuiQuery<ArduinoFrameFixture>() {
|
||||
@Override
|
||||
@ -38,7 +40,6 @@ public abstract class AbstractGUITest {
|
||||
@After
|
||||
public void stopTheIDE() {
|
||||
window.cleanUp();
|
||||
FileUtils.recursiveDelete(Base.untitledFolder);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,23 +1,19 @@
|
||||
package processing.app;
|
||||
|
||||
import org.junit.After;
|
||||
import cc.arduino.files.DeleteFilesOnShutdown;
|
||||
import org.junit.Before;
|
||||
import processing.app.helpers.FileUtils;
|
||||
|
||||
public abstract class AbstractWithPreferencesTest {
|
||||
|
||||
@Before
|
||||
public void init() throws Exception {
|
||||
Runtime.getRuntime().addShutdownHook(new Thread(DeleteFilesOnShutdown.INSTANCE));
|
||||
Base.initPlatform();
|
||||
Preferences.init(null);
|
||||
Theme.init();
|
||||
|
||||
Base.untitledFolder = Base.createTempFolder("untitled");
|
||||
|
||||
DeleteFilesOnShutdown.add(Base.untitledFolder);
|
||||
}
|
||||
|
||||
@After
|
||||
public void cleanup() {
|
||||
FileUtils.recursiveDelete(Base.untitledFolder);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user