1
0
Fork 0

Closing streams and consuming the entities so pools can reuse connections.

Updated failing test.
master
Jaime Freire 2017-04-13 19:47:19 +02:00
parent c9220cb17e
commit 10ffeec569
2 changed files with 10 additions and 2 deletions

View File

@ -52,6 +52,7 @@ import org.apache.http.entity.mime.MultipartEntity;
import org.apache.http.entity.mime.content.ByteArrayBody;
import org.apache.http.entity.mime.content.FileBody;
import org.apache.http.entity.mime.content.InputStreamBody;
import org.apache.http.util.EntityUtils;
/**
* A simple REST client that speaks JSON.
@ -153,9 +154,16 @@ public class RestClient {
BufferedReader br = new BufferedReader(isr);
String line = "";
while ((line = br.readLine()) != null)
while ((line = br.readLine()) != null) {
result.append(line);
}
isr.close();
br.close();
isr=null;
br=null;
}
EntityUtils.consumeQuietly(ent);
StatusLine sl = resp.getStatusLine();

View File

@ -16,7 +16,7 @@ public class SearchTest {
public void testSimpleSearch() throws JiraException {
JiraClient jira = new JiraClient("https://jira.atlassian.com/", null);
String key = "JRA-1";
String key = "JRASERVER-1";
Issue.SearchResult searchResult = jira.searchIssues("key = " + key);
assertNotNull(searchResult);