mirror of
https://github.com/BentoBoxWorld/Challenges.git
synced 2024-11-25 03:55:10 +01:00
Clean up databbase_backup after tests.
This commit is contained in:
parent
edc7f5f9a6
commit
c26b27afa1
@ -219,7 +219,7 @@ public class ChallengesAddonTest {
|
||||
new File("config.yml").delete();
|
||||
deleteAll(new File("addons"));
|
||||
deleteAll(new File("database"));
|
||||
|
||||
deleteAll(new File("database_backup"));
|
||||
}
|
||||
|
||||
private void deleteAll(File file) throws IOException {
|
||||
|
@ -196,10 +196,16 @@ public class ChallengesManagerTest {
|
||||
*/
|
||||
@After
|
||||
public void tearDown() throws Exception {
|
||||
// Clean up JSON database
|
||||
// Clean up file system
|
||||
if (database.exists()) {
|
||||
Files.walk(database.toPath())
|
||||
new File("addon.jar").delete();
|
||||
new File("config.yml").delete();
|
||||
deleteAll(new File("addons"));
|
||||
deleteAll(new File("database"));
|
||||
deleteAll(new File("database_backup"));
|
||||
}
|
||||
|
||||
private void deleteAll(File file) throws IOException {
|
||||
if (file.exists()) {
|
||||
Files.walk(file.toPath())
|
||||
.sorted(Comparator.reverseOrder())
|
||||
.map(Path::toFile)
|
||||
.forEach(File::delete);
|
||||
|
Loading…
Reference in New Issue
Block a user