From 5992a831e4085f1475c8feafd0dddf3cab901c03 Mon Sep 17 00:00:00 2001 From: "Chris M. Hostetter" Date: Wed, 12 Dec 2012 23:02:20 +0000 Subject: [PATCH] SOLR-4136: fix hostContext randomization to never include double slashes git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1421034 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/solr/BaseDistributedSearchTestCase.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/solr/test-framework/src/java/org/apache/solr/BaseDistributedSearchTestCase.java b/solr/test-framework/src/java/org/apache/solr/BaseDistributedSearchTestCase.java index 624cc8c9c1e..54c87482f49 100644 --- a/solr/test-framework/src/java/org/apache/solr/BaseDistributedSearchTestCase.java +++ b/solr/test-framework/src/java/org/apache/solr/BaseDistributedSearchTestCase.java @@ -109,9 +109,11 @@ public abstract class BaseDistributedSearchTestCase extends SolrTestCaseJ4 { // NOOP: don't try to add a subdir to nothing (ie "//" is bad) } } + // paranoia, we *really* don't want to ever get "//" in a path... + final String hc = hostContext.toString().replaceAll("\\/+","/"); - log.info("Setting hostContext system property: " + hostContext.toString()); - System.setProperty("hostContext", hostContext.toString()); + log.info("Setting hostContext system property: " + hc); + System.setProperty("hostContext", hc); } /**