summaryrefslogtreecommitdiff
path: root/qpid/java
diff options
context:
space:
mode:
authorAlex Rudyy <orudyy@apache.org>2014-04-25 11:45:43 +0000
committerAlex Rudyy <orudyy@apache.org>2014-04-25 11:45:43 +0000
commitc1b8b711c7be602febb3d9bae6597458a1f7f52c (patch)
treec30c83e53de88c19c9436d6af43a2c571ae8034f /qpid/java
parentacf84ebf5462342656a257ed978238c23fb1c900 (diff)
downloadqpid-python-c1b8b711c7be602febb3d9bae6597458a1f7f52c.tar.gz
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
Diffstat (limited to 'qpid/java')
-rw-r--r--qpid/java/systests/src/main/java/org/apache/qpid/test/utils/TestUtils.java8
1 files changed, 8 insertions, 0 deletions
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<String, Object> attributes = new HashMap<String, Object>(nodeAttributes);
attributes.put(DurableConfigurationStore.STORE_PATH, path);