From c1b8b711c7be602febb3d9bae6597458a1f7f52c Mon Sep 17 00:00:00 2001 From: Alex Rudyy Date: Fri, 25 Apr 2014 11:45:43 +0000 Subject: QPID-5715: Change test utility method for virtual host configuration store creation to wipe out the store folder before creation a store git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1590003 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/java/org/apache/qpid/test/utils/TestUtils.java | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'qpid/java') diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/TestUtils.java b/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/TestUtils.java index 16f3c3d82c..e4d4e5b24e 100644 --- a/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/TestUtils.java +++ b/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/TestUtils.java @@ -23,6 +23,7 @@ package org.apache.qpid.test.utils; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; +import java.io.File; import java.lang.management.ManagementFactory; import java.lang.management.ThreadInfo; import java.lang.management.ThreadMXBean; @@ -40,6 +41,7 @@ import org.apache.qpid.server.store.DurableConfigurationStore; import org.apache.qpid.server.store.JsonFileConfigStore; import org.apache.qpid.server.store.MemoryMessageStore; import org.apache.qpid.server.virtualhost.StandardVirtualHost; +import org.apache.qpid.util.FileUtils; import org.apache.qpid.util.Strings; public class TestUtils @@ -95,6 +97,12 @@ public class TestUtils String storePath = (String)nodeAttributes.get(DurableConfigurationStore.STORE_PATH); String path = Strings.expand(storePath, false, Strings.JAVA_SYS_PROPS_RESOLVER, Strings.ENV_VARS_RESOLVER); + File pathFile = new File(path); + if (pathFile.exists()) + { + FileUtils.delete(pathFile, true); + } + Map attributes = new HashMap(nodeAttributes); attributes.put(DurableConfigurationStore.STORE_PATH, path); -- cgit v1.2.1