X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fconfig%2Fyang-jmx-generator-plugin%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconfig%2Fyangjmxgenerator%2Fplugin%2FAbstractGeneratorTest.java;h=a17d50da5215405857a324f1e651767f8579517e;hb=20a32e6459fd1e27e7669bf1ebc7742b96787b94;hp=1dde94b48244fed6b8ca5867b874280f3aa425ee;hpb=f776809962df87deeaa533ba995cc6fceba64d0e;p=controller.git 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 1dde94b482..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 @@ -7,25 +7,34 @@ */ package org.opendaylight.controller.config.yangjmxgenerator.plugin; -import org.apache.commons.io.FileUtils; +import java.io.File; import org.junit.Before; import org.opendaylight.controller.config.yangjmxgenerator.AbstractYangTest; -import java.io.File; - 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(); + } }