Apache Lucene open-source search software
SOLR-5838: Relative SolrHome Path Bug At AbstractFullDistribZkTestBase
Shalin Shekhar Mangarc446aec1ed5f
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txtindex ac5c0e9dee0..acdce1d7aa4 100644--- a/solr/CHANGES.txt+++ b/solr/CHANGES.txt@@ -238,6 +238,9 @@ Other Changes* SOLR-5853: The createCollection methods in the test framework now reportsresult of operation in the returned CollectionAdminResponse (janhoy)+* SOLR-5838: Relative SolrHome Path Bug At AbstractFullDistribZkTestBase.+ (Furkan KAMACI via shalin)+================== 4.7.0 ==================Versions of Major Componentsdiff --git a/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java b/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.javaindex e5f66c6ed66..e525926271c 100644--- a/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java+++ b/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java@@ -496,9 +496,10 @@ public abstract class AbstractFullDistribZkTestBase extends AbstractDistribZkTesString path = SolrResourceLoader.normalizeDir(new File(".").getAbsolutePath());String base = new File(solrHome.getPath()).getAbsolutePath();- if (base.startsWith("."));- base.replaceFirst("\\.", new File(".").getName());-+ if (base.startsWith(".")) {+ base = base.replaceFirst("\\.", new File(".").getName());+ }+if (path.endsWith(File.separator + ".")) {path = path.substring(0, path.length() - 2);}@@ -507,7 +508,7 @@ public abstract class AbstractFullDistribZkTestBase extends AbstractDistribZkTesStringBuilder p = new StringBuilder();for (int i = 0; i < splits - 2; i++) {- p.append(".." + File.separator);+ p.append("..").append(File.separator);}String prefix = FilenameUtils.getPrefix(path);@@ -1823,4 +1824,4 @@ public abstract class AbstractFullDistribZkTestBase extends AbstractDistribZkTesfail("Could not find the new collection - " + exp.code() + " : " + collectionClient.getBaseURL());}-}\ No newline at end of file+}