From ae33505da58589591f729f1e4745a2922f6a3a94 Mon Sep 17 00:00:00 2001 From: Uwe Schindler Date: Mon, 2 Dec 2013 23:30:54 +0000 Subject: [PATCH] SOLR-1301: Fix windows problem with escaping of folder name (see crazy https://github.com/typesafehub/config/blob/master/HOCON.md for correct format: string must be quoted and escaped like javascript) git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1547239 13f79535-47bb-0310-9956-ffa450edef68 --- .../solr/morphlines/solr/AbstractSolrMorphlineTestBase.java | 3 ++- .../src/test-files/test-morphlines/solrCellDocumentTypes.conf | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/solr/contrib/solr-morphlines-core/src/test/org/apache/solr/morphlines/solr/AbstractSolrMorphlineTestBase.java b/solr/contrib/solr-morphlines-core/src/test/org/apache/solr/morphlines/solr/AbstractSolrMorphlineTestBase.java index e5e1d3cce67..ac562e66ac7 100644 --- a/solr/contrib/solr-morphlines-core/src/test/org/apache/solr/morphlines/solr/AbstractSolrMorphlineTestBase.java +++ b/solr/contrib/solr-morphlines-core/src/test/org/apache/solr/morphlines/solr/AbstractSolrMorphlineTestBase.java @@ -28,6 +28,7 @@ import java.util.Map.Entry; import java.util.concurrent.atomic.AtomicInteger; import org.apache.commons.io.FileUtils; +import org.apache.commons.lang.StringEscapeUtils; import org.apache.solr.SolrTestCaseJ4; import org.apache.solr.client.solrj.SolrQuery; import org.apache.solr.client.solrj.SolrServer; @@ -182,7 +183,7 @@ public class AbstractSolrMorphlineTestBase extends SolrTestCaseJ4 { public static void setupMorphline(String tempDir, String file) throws IOException { String morphlineText = FileUtils.readFileToString(new File(RESOURCES_DIR + "/" + file + ".conf"), "UTF-8"); - morphlineText = morphlineText.replaceAll("RESOURCES_DIR", new File(tempDir).getAbsolutePath()); + morphlineText = morphlineText.replace("RESOURCES_DIR", StringEscapeUtils.escapeJavaScript(new File(tempDir).getAbsolutePath())); FileUtils.writeStringToFile(new File(tempDir + "/" + file + ".conf"), morphlineText, "UTF-8"); } diff --git a/solr/contrib/solr-mr/src/test-files/test-morphlines/solrCellDocumentTypes.conf b/solr/contrib/solr-mr/src/test-files/test-morphlines/solrCellDocumentTypes.conf index bf1e58d5fb4..dd769a71ba1 100644 --- a/solr/contrib/solr-mr/src/test-files/test-morphlines/solrCellDocumentTypes.conf +++ b/solr/contrib/solr-mr/src/test-files/test-morphlines/solrCellDocumentTypes.conf @@ -52,7 +52,7 @@ morphlines : [ # used for auto-detection if MIME type isn't explicitly supplied detectMimeType { includeDefaultMimeTypes : true - mimeTypesFiles : [RESOURCES_DIR/custom-mimetypes.xml] + mimeTypesFiles : ["RESOURCES_DIR/custom-mimetypes.xml"] } }