File tree 2 files changed +6
-9
lines changed
2 files changed +6
-9
lines changed Original file line number Diff line number Diff line change 1
1
package processing .app ;
2
2
3
+ import cc .arduino .files .DeleteFilesOnShutdown ;
3
4
import org .fest .swing .edt .FailOnThreadViolationRepaintManager ;
4
5
import org .fest .swing .edt .GuiActionRunner ;
5
6
import org .fest .swing .edt .GuiQuery ;
6
7
import org .junit .After ;
7
8
import org .junit .Before ;
8
9
import processing .app .helpers .ArduinoFrameFixture ;
9
- import processing .app .helpers .FileUtils ;
10
10
11
11
import javax .swing .*;
12
12
@@ -17,6 +17,7 @@ public abstract class AbstractGUITest {
17
17
@ Before
18
18
public void startUpTheIDE () throws Exception {
19
19
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 ));
20
21
21
22
FailOnThreadViolationRepaintManager .install ();
22
23
@@ -26,6 +27,7 @@ public void startUpTheIDE() throws Exception {
26
27
Theme .init ();
27
28
Base .getPlatform ().setLookAndFeel ();
28
29
Base .untitledFolder = Base .createTempFolder ("untitled" );
30
+ DeleteFilesOnShutdown .add (Base .untitledFolder );
29
31
30
32
window = GuiActionRunner .execute (new GuiQuery <ArduinoFrameFixture >() {
31
33
@ Override
@@ -38,7 +40,6 @@ protected ArduinoFrameFixture executeInEDT() throws Throwable {
38
40
@ After
39
41
public void stopTheIDE () {
40
42
window .cleanUp ();
41
- FileUtils .recursiveDelete (Base .untitledFolder );
42
43
}
43
44
44
45
}
Original file line number Diff line number Diff line change 1
1
package processing .app ;
2
2
3
- import org . junit . After ;
3
+ import cc . arduino . files . DeleteFilesOnShutdown ;
4
4
import org .junit .Before ;
5
- import processing .app .helpers .FileUtils ;
6
5
7
6
public abstract class AbstractWithPreferencesTest {
8
7
9
8
@ Before
10
9
public void init () throws Exception {
10
+ Runtime .getRuntime ().addShutdownHook (new Thread (DeleteFilesOnShutdown .INSTANCE ));
11
11
Base .initPlatform ();
12
12
Preferences .init (null );
13
13
Theme .init ();
14
14
15
15
Base .untitledFolder = Base .createTempFolder ("untitled" );
16
-
16
+ DeleteFilesOnShutdown . add ( Base . untitledFolder );
17
17
}
18
18
19
- @ After
20
- public void cleanup () {
21
- FileUtils .recursiveDelete (Base .untitledFolder );
22
- }
23
19
}
You can’t perform that action at this time.
0 commit comments