You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by GitBox <gi...@apache.org> on 2019/06/18 18:04:09 UTC
[GitHub] [lucene-solr] dsmiley commented on a change in pull request #723:
SOLR-13545: AutoClose stream in ContentStreamUpdateRequest
dsmiley commented on a change in pull request #723: SOLR-13545: AutoClose stream in ContentStreamUpdateRequest
URL: https://github.com/apache/lucene-solr/pull/723#discussion_r294955402
##########
File path: solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java
##########
@@ -710,10 +714,18 @@ public void testContentStreamRequest() throws Exception {
Assert.assertEquals(0, rsp.getResults().getNumFound());
ContentStreamUpdateRequest up = new ContentStreamUpdateRequest("/update");
- up.addFile(getFile("solrj/books.csv"), "application/csv");
+ // Create a copy of the file, which can be deleted after uploading.
+ // If the stream isn't closed, the file deletion will fail on Windows,
+ // though it will succeed on linux regardless
+ final File file = new File("temp/books_copy.csv");
Review comment:
I see you're creating a file relative to the current working directory. That's a bad practice for tests generally. Call `createTempFile(...)` instead (declared in the inheritance chain).
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org