diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index 277dfe65959..f4cb43e34f6 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -510,6 +510,9 @@ Bug Fixes * SOLR-3820: Solr Admin Query form is missing some edismax request parameters (steffkes) +* SOLR-4217: post.jar no longer ignores -Dparams when -Durl is used. + (Alexandre Rafalovitch, ehatcher) + Other Changes ---------------------- diff --git a/solr/core/src/java/org/apache/solr/util/SimplePostTool.java b/solr/core/src/java/org/apache/solr/util/SimplePostTool.java index c497406639c..7ccb6d8cda5 100644 --- a/solr/core/src/java/org/apache/solr/util/SimplePostTool.java +++ b/solr/core/src/java/org/apache/solr/util/SimplePostTool.java @@ -196,7 +196,8 @@ public class SimplePostTool { fatal("System Property 'data' is not valid for this tool: " + mode); } String params = System.getProperty("params", ""); - urlStr = System.getProperty("url", SimplePostTool.appendParam(DEFAULT_POST_URL, params)); + urlStr = System.getProperty("url", DEFAULT_POST_URL); + urlStr = SimplePostTool.appendParam(urlStr, params); URL url = new URL(urlStr); boolean auto = isOn(System.getProperty("auto", DEFAULT_AUTO)); String type = System.getProperty("type"); diff --git a/solr/core/src/test/org/apache/solr/util/SimplePostToolTest.java b/solr/core/src/test/org/apache/solr/util/SimplePostToolTest.java index 863c1690747..0cb7d74de99 100644 --- a/solr/core/src/test/org/apache/solr/util/SimplePostToolTest.java +++ b/solr/core/src/test/org/apache/solr/util/SimplePostToolTest.java @@ -56,6 +56,7 @@ public class SimplePostToolTest extends SolrTestCaseJ4 { t_web = SimplePostTool.parseArgsAndInit(args); System.setProperty("params", "param1=foo¶m2=bar"); + System.setProperty("url", "http://localhost:5150/solr/update"); t_test = SimplePostTool.parseArgsAndInit(args); pf = new MockPageFetcher(); @@ -76,7 +77,7 @@ public class SimplePostToolTest extends SolrTestCaseJ4 { assertEquals(1, t_web.recursive); assertEquals(10, t_web.delay); - assertNotNull(t_test.solrUrl); + assertEquals("http://localhost:5150/solr/update?param1=foo¶m2=bar",t_test.solrUrl.toExternalForm()); } @Test