mirror of https://github.com/zlatinb/muwire
cleanup before and after file tree test
parent
90988ce717
commit
abad1919cc
|
@ -1,9 +1,26 @@
|
||||||
package com.muwire.core.files
|
package com.muwire.core.files
|
||||||
|
|
||||||
|
import org.junit.After
|
||||||
|
import org.junit.Before
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
|
||||||
class FileTreeTest {
|
class FileTreeTest {
|
||||||
|
|
||||||
|
@Before
|
||||||
|
@After
|
||||||
|
public void cleanup() {
|
||||||
|
File a = new File("a")
|
||||||
|
File b = new File("b")
|
||||||
|
[a,b].each {
|
||||||
|
if (it.exists()) {
|
||||||
|
if (it.isDirectory())
|
||||||
|
it.deleteDir()
|
||||||
|
else
|
||||||
|
it.delete()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testRemoveEmtpyDirs() {
|
public void testRemoveEmtpyDirs() {
|
||||||
File a = new File("a")
|
File a = new File("a")
|
||||||
|
@ -108,10 +125,13 @@ class FileTreeTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
File a = new File("a")
|
File a = new File("a")
|
||||||
|
a.delete()
|
||||||
a.createNewFile()
|
a.createNewFile()
|
||||||
File b = new File("b")
|
File b = new File("b")
|
||||||
|
b.delete()
|
||||||
b.mkdir()
|
b.mkdir()
|
||||||
File c = new File(b, "c")
|
File c = new File(b, "c")
|
||||||
|
c.delete()
|
||||||
c.createNewFile()
|
c.createNewFile()
|
||||||
|
|
||||||
FileTree<String> tree = new FileTree<>()
|
FileTree<String> tree = new FileTree<>()
|
||||||
|
|
Loading…
Reference in New Issue