X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fconfig%2Fyang-jmx-generator-plugin%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconfig%2Fyangjmxgenerator%2Fplugin%2FAbstractGeneratorTest.java;h=a17d50da5215405857a324f1e651767f8579517e;hp=2eae8b6b0954fbc44a2ef54b81f247895e419394;hb=f43b01b81319959b1907e3e04537f5169e7f33d8;hpb=ea980e87f8ac521022dfd776c5186819a8a38fd2 diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/AbstractGeneratorTest.java b/opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/AbstractGeneratorTest.java index 2eae8b6b09..a17d50da52 100644 --- a/opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/AbstractGeneratorTest.java +++ b/opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/AbstractGeneratorTest.java @@ -8,23 +8,33 @@ package org.opendaylight.controller.config.yangjmxgenerator.plugin; import java.io.File; -import org.apache.commons.io.FileUtils; import org.junit.Before; import org.opendaylight.controller.config.yangjmxgenerator.AbstractYangTest; public abstract class AbstractGeneratorTest extends AbstractYangTest { - private static final File GENERATOR_OUTPUT_PATH_ROOT = new File( - "target/testgen"); + private static final File GENERATOR_OUTPUT_PATH_ROOT = new File("target/testgen"); protected final File generatorOutputPath; public AbstractGeneratorTest() { - generatorOutputPath = new File(GENERATOR_OUTPUT_PATH_ROOT, getClass() - .getSimpleName()); + generatorOutputPath = new File(GENERATOR_OUTPUT_PATH_ROOT, getClass().getSimpleName()); } @Before public void cleanUpDirectory() throws Exception { - FileUtils.deleteDirectory(generatorOutputPath); + deleteFolder(generatorOutputPath); } + public void deleteFolder(final File folder) { + File[] files = folder.listFiles(); + if (files != null) { + for (File f : files) { + if (f.isDirectory()) { + deleteFolder(f); + } else { + f.delete(); + } + } + } + folder.delete(); + } }