File tree Expand file tree Collapse file tree 2 files changed +6
-9
lines changed Expand file tree Collapse file tree 2 files changed +6
-9
lines changed Original file line number Diff line number Diff line change 11package processing .app ;
22
3+ import cc .arduino .files .DeleteFilesOnShutdown ;
34import org .fest .swing .edt .FailOnThreadViolationRepaintManager ;
45import org .fest .swing .edt .GuiActionRunner ;
56import org .fest .swing .edt .GuiQuery ;
67import org .junit .After ;
78import org .junit .Before ;
89import processing .app .helpers .ArduinoFrameFixture ;
9- import processing .app .helpers .FileUtils ;
1010
1111import javax .swing .*;
1212
@@ -17,6 +17,7 @@ public abstract class AbstractGUITest {
1717 @ Before
1818 public void startUpTheIDE () throws Exception {
1919 System .setProperty ("mrj.version" , "whynot" ); //makes sense only on osx. See https://github.com/alexruiz/fest-swing-1.x/issues/2#issuecomment-86532042
20+ Runtime .getRuntime ().addShutdownHook (new Thread (DeleteFilesOnShutdown .INSTANCE ));
2021
2122 FailOnThreadViolationRepaintManager .install ();
2223
@@ -26,6 +27,7 @@ public void startUpTheIDE() throws Exception {
2627 Theme .init ();
2728 Base .getPlatform ().setLookAndFeel ();
2829 Base .untitledFolder = Base .createTempFolder ("untitled" );
30+ DeleteFilesOnShutdown .add (Base .untitledFolder );
2931
3032 window = GuiActionRunner .execute (new GuiQuery <ArduinoFrameFixture >() {
3133 @ Override
@@ -38,7 +40,6 @@ protected ArduinoFrameFixture executeInEDT() throws Throwable {
3840 @ After
3941 public void stopTheIDE () {
4042 window .cleanUp ();
41- FileUtils .recursiveDelete (Base .untitledFolder );
4243 }
4344
4445}
Original file line number Diff line number Diff line change 11package processing .app ;
22
3- import org . junit . After ;
3+ import cc . arduino . files . DeleteFilesOnShutdown ;
44import org .junit .Before ;
5- import processing .app .helpers .FileUtils ;
65
76public abstract class AbstractWithPreferencesTest {
87
98 @ Before
109 public void init () throws Exception {
10+ Runtime .getRuntime ().addShutdownHook (new Thread (DeleteFilesOnShutdown .INSTANCE ));
1111 Base .initPlatform ();
1212 Preferences .init (null );
1313 Theme .init ();
1414
1515 Base .untitledFolder = Base .createTempFolder ("untitled" );
16-
16+ DeleteFilesOnShutdown . add ( Base . untitledFolder );
1717 }
1818
19- @ After
20- public void cleanup () {
21- FileUtils .recursiveDelete (Base .untitledFolder );
22- }
2319}
You can’t perform that action at this time.
0 commit comments