bogdanstoik commented on code in PR #2557:
URL: https://github.com/apache/solr/pull/2557#discussion_r1679930353


##########
solr/core/src/test/org/apache/solr/cli/PostToolTest.java:
##########
@@ -147,6 +147,43 @@ public void testRunWithCollectionParam() throws Exception {
     assertEquals("*:* found unexpected number of documents", expectedDocCount, 
numFound);
   }
 
+  @Test
+  public void testRunCsvWithCustomSeparatorParam() throws Exception {
+    final String collection = "testRunCsvWithCustomSeparatorParam";
+
+    // Provide the port for the PostTool to look up.
+    EnvUtils.setProperty("jetty.port", 
cluster.getJettySolrRunner(0).getLocalPort() + "");
+
+    withBasicAuth(CollectionAdminRequest.createCollection(collection, "conf1", 
1, 1, 0, 0))
+        .processAndWait(cluster.getSolrClient(), 10);
+
+    File tsvDoc = File.createTempFile("temp", ".tsv");
+
+    FileWriter fw = new FileWriter(tsvDoc, StandardCharsets.UTF_8);
+    fw.write("1\tmytitle\n");
+    fw.close();
+
+    String[] args = {
+      "post", "-c", collection, "-credentials", SecurityJson.USER_PASS, 
"-params", "\"separator=%09&header=false&fieldnames=id,title_s\"", "-type", 
"text/csv", tsvDoc.getAbsolutePath()
+    };
+    assertEquals(0, runTool(args));
+
+    int numFound = 0;
+    int expectedDocCount = 1;
+
+    for (int idx = 0; idx < 100; ++idx) {

Review Comment:
   same as above comment, i just copy-pasted and modified the 
testRunWithCollectionParam function



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to