Thomas Vachuska

Adding a proper clean-up step for unit test file system artifacts.

Change-Id: Ia602b2359f290c4327611dc092bbcdaf28c144a2
...@@ -35,19 +35,20 @@ import static org.onosproject.app.DefaultApplicationDescriptionTest.*; ...@@ -35,19 +35,20 @@ import static org.onosproject.app.DefaultApplicationDescriptionTest.*;
35 35
36 public class ApplicationArchiveTest { 36 public class ApplicationArchiveTest {
37 37
38 - static final String ROOT = "/tmp/app-junit/" + new Random().nextInt() + "/foo"; 38 + static final String ROOT = "/tmp/app-junit/";
39 + static final String STORE = ROOT + new Random().nextInt(1000) + "/foo";
39 40
40 private ApplicationArchive aar = new ApplicationArchive(); 41 private ApplicationArchive aar = new ApplicationArchive();
41 42
42 @Before 43 @Before
43 public void setUp() { 44 public void setUp() {
44 - aar.setRootPath(ROOT); 45 + aar.setRootPath(STORE);
45 } 46 }
46 47
47 @After 48 @After
48 public void tearDown() throws IOException { 49 public void tearDown() throws IOException {
49 - if (new File(aar.getRootPath()).exists()) { 50 + if (new File(ROOT).exists()) {
50 - Tools.removeDirectory(aar.getRootPath()); 51 + Tools.removeDirectory(ROOT);
51 } 52 }
52 } 53 }
53 54
......