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


##########
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:
   looking through the code, i think this loop just tries to make sure the 
changes are commited to index. it "wants" to find the correct results, after 
all 😄 



-- 
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