From 20dcb56da85accabd8e32b41afaca71707797ade Mon Sep 17 00:00:00 2001 From: Uwe Schindler Date: Mon, 3 Jul 2017 08:15:54 +0200 Subject: [PATCH] SOLR-6671: More generic fix to assert Solr's dataHome --- .../test/org/apache/solr/core/DirectoryFactoryTest.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/solr/core/src/test/org/apache/solr/core/DirectoryFactoryTest.java b/solr/core/src/test/org/apache/solr/core/DirectoryFactoryTest.java index 2c2ddd9016d..aa00342116d 100755 --- a/solr/core/src/test/org/apache/solr/core/DirectoryFactoryTest.java +++ b/solr/core/src/test/org/apache/solr/core/DirectoryFactoryTest.java @@ -20,7 +20,6 @@ import java.io.IOException; import java.nio.file.Paths; import java.util.Properties; -import org.apache.lucene.util.Constants; import org.apache.lucene.util.LuceneTestCase; import org.apache.solr.common.util.NamedList; import org.apache.solr.handler.admin.CoreAdminHandler; @@ -74,11 +73,7 @@ public class DirectoryFactoryTest extends LuceneTestCase { private void assertDataHome(String expected, String instanceDir, RAMDirectoryFactory rdf, MockCoreContainer cc, String... properties) throws IOException { String dataHome = rdf.getDataHome(new CoreDescriptor("core_name", Paths.get(instanceDir), cc.containerProperties, cc.isZooKeeperAware(), properties)); - if (Constants.WINDOWS) { - // TODO: find a less-hacky way to assert this! - dataHome = dataHome.replaceFirst("^[A-Z]:", "").replace("\\", "/"); - } - assertEquals(expected, dataHome); + assertEquals(Paths.get(expected).toAbsolutePath(), Paths.get(dataHome).toAbsolutePath()); }