SOLR-4127: post.jar ignores -Dparams when -Durl is used

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1432794 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Erik Hatcher 2013-01-14 03:31:10 +00:00
parent cc7a83c221
commit 3552167217
3 changed files with 7 additions and 2 deletions

View File

@ -510,6 +510,9 @@ Bug Fixes
* SOLR-3820: Solr Admin Query form is missing some edismax request parameters * SOLR-3820: Solr Admin Query form is missing some edismax request parameters
(steffkes) (steffkes)
* SOLR-4217: post.jar no longer ignores -Dparams when -Durl is used.
(Alexandre Rafalovitch, ehatcher)
Other Changes Other Changes
---------------------- ----------------------

View File

@ -196,7 +196,8 @@ public class SimplePostTool {
fatal("System Property 'data' is not valid for this tool: " + mode); fatal("System Property 'data' is not valid for this tool: " + mode);
} }
String params = System.getProperty("params", ""); 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); URL url = new URL(urlStr);
boolean auto = isOn(System.getProperty("auto", DEFAULT_AUTO)); boolean auto = isOn(System.getProperty("auto", DEFAULT_AUTO));
String type = System.getProperty("type"); String type = System.getProperty("type");

View File

@ -56,6 +56,7 @@ public class SimplePostToolTest extends SolrTestCaseJ4 {
t_web = SimplePostTool.parseArgsAndInit(args); t_web = SimplePostTool.parseArgsAndInit(args);
System.setProperty("params", "param1=foo&param2=bar"); System.setProperty("params", "param1=foo&param2=bar");
System.setProperty("url", "http://localhost:5150/solr/update");
t_test = SimplePostTool.parseArgsAndInit(args); t_test = SimplePostTool.parseArgsAndInit(args);
pf = new MockPageFetcher(); pf = new MockPageFetcher();
@ -76,7 +77,7 @@ public class SimplePostToolTest extends SolrTestCaseJ4 {
assertEquals(1, t_web.recursive); assertEquals(1, t_web.recursive);
assertEquals(10, t_web.delay); assertEquals(10, t_web.delay);
assertNotNull(t_test.solrUrl); assertEquals("http://localhost:5150/solr/update?param1=foo&param2=bar",t_test.solrUrl.toExternalForm());
} }
@Test @Test