summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Fiedler2011-10-24 16:59:00 (EDT)
committer Steve Speicher2011-10-24 16:59:00 (EDT)
commit398d434621e15f3e384b55ef54ccbca80b41f7e2 (patch)
tree193dd0e99670b749f2dbdd805921a089c8e0196a
parent201c3c37bdd069bb40c93b64c05e4859a9c37119 (diff)
downloadorg.eclipse.lyo.testsuite-398d434621e15f3e384b55ef54ccbca80b41f7e2.zip
org.eclipse.lyo.testsuite-398d434621e15f3e384b55ef54ccbca80b41f7e2.tar.gz
org.eclipse.lyo.testsuite-398d434621e15f3e384b55ef54ccbca80b41f7e2.tar.bz2
Bug357387 - Update to Apache HttpClient 4.1.2 and fix connection leak
-rw-r--r--org.eclipse.lyo.testsuite.server/pom.xml4
-rw-r--r--org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/server/oslcv2tests/SimplifiedQueryXmlTests.java14
2 files changed, 11 insertions, 7 deletions
diff --git a/org.eclipse.lyo.testsuite.server/pom.xml b/org.eclipse.lyo.testsuite.server/pom.xml
index 5b2fa92..f93af0d 100644
--- a/org.eclipse.lyo.testsuite.server/pom.xml
+++ b/org.eclipse.lyo.testsuite.server/pom.xml
@@ -54,9 +54,7 @@
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
- <version>4.0.1</version>
- <type>jar</type>
- <scope>compile</scope>
+ <version>4.1.2</version>
</dependency>
<dependency>
diff --git a/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/server/oslcv2tests/SimplifiedQueryXmlTests.java b/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/server/oslcv2tests/SimplifiedQueryXmlTests.java
index 61f96e4..25c3ea7 100644
--- a/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/server/oslcv2tests/SimplifiedQueryXmlTests.java
+++ b/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/server/oslcv2tests/SimplifiedQueryXmlTests.java
@@ -85,10 +85,16 @@ public class SimplifiedQueryXmlTests extends SimplifiedQueryBaseTests {
throws XPathExpressionException, IOException,
ParserConfigurationException, SAXException {
HttpResponse response = OSLCUtils.getResponseFromUrl(setupBaseUrl,
- currentUrl + query, basicCreds, OSLCConstants.CT_XML, headers);
- assertEquals(HttpStatus.SC_OK, response.getStatusLine().getStatusCode());
- String responseBody = EntityUtils.toString(response.getEntity());
- response.getEntity().consumeContent();
+ currentUrl + query, basicCreds, OSLCConstants.CT_XML, headers);
+ int statusCode = response.getStatusLine().getStatusCode();
+ if (HttpStatus.SC_OK != statusCode)
+ {
+ EntityUtils.consume(response.getEntity());
+ throw new IOException("Response code: " + statusCode + " for " + currentUrl + query);
+ }
+
+ String responseBody = EntityUtils.toString(response.getEntity());
+
Document doc = OSLCUtils.createXMLDocFromResponseBody(responseBody);
Node results = (Node) OSLCUtils.getXPath().evaluate(
"//oslc:ResponseInfo/@rdf:about", doc, XPathConstants.NODE);