aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Eck II2012-07-20 13:28:02 (EDT)
committerTim Eck II2012-07-20 13:28:02 (EDT)
commit1640679a34d0948efbd93eb5284ff353b7c0cbab (patch)
treed2b30f802ba06685eda6edaaf89e0fecb59e4a3b
parentb64700d53758b2152f91a005ce4cdb637894fe36 (diff)
downloadorg.eclipse.lyo.testsuite-1640679a34d0948efbd93eb5284ff353b7c0cbab.zip
org.eclipse.lyo.testsuite-1640679a34d0948efbd93eb5284ff353b7c0cbab.tar.gz
org.eclipse.lyo.testsuite-1640679a34d0948efbd93eb5284ff353b7c0cbab.tar.bz2
I found some more errors in the asset management tests after my lastrefs/changes/01/6901/1
commit Bug - 385321 https://bugs.eclipse.org/bugs/show_bug.cgi?id=385321
-rw-r--r--org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/oslcv2/asset/GetAndUpdateBase.java8
-rw-r--r--org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/oslcv2/asset/GetAndUpdateRdfXmlTests.java8
-rw-r--r--org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/oslcv2/asset/GetAndUpdateXmlTests.java8
-rw-r--r--org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/oslcv2/asset/UsageCaseRdfXmlTests.java4
-rw-r--r--org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/oslcv2/asset/UsageCaseXmlTests.java4
5 files changed, 24 insertions, 8 deletions
diff --git a/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/oslcv2/asset/GetAndUpdateBase.java b/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/oslcv2/asset/GetAndUpdateBase.java
index 604651e..91bc48d 100644
--- a/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/oslcv2/asset/GetAndUpdateBase.java
+++ b/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/oslcv2/asset/GetAndUpdateBase.java
@@ -25,6 +25,7 @@ import org.apache.http.Header;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.message.BasicHeader;
+import org.apache.http.params.HttpConnectionParams;
import org.apache.http.util.EntityUtils;
import org.eclipse.lyo.testsuite.server.util.OSLCUtils;
import org.junit.Test;
@@ -33,7 +34,8 @@ public class GetAndUpdateBase extends AssetTestBase {
public GetAndUpdateBase(String url, String acceptType, String contentType) {
- super(url, acceptType, contentType);
+ super(url, acceptType, contentType);
+ HttpConnectionParams.setConnectionTimeout(OSLCUtils.httpclient.getParams(), 30000);
}
@Test
@@ -65,7 +67,9 @@ public class GetAndUpdateBase extends AssetTestBase {
HttpResponse resp = OSLCUtils.postDataToUrl(
artifactFactory, basicCreds, acceptType, setupProps.getProperty("artifactContentType"),
readFileFromProperty("artifactFile"), addHeader(h));
- EntityUtils.consume(resp.getEntity());
+ try {
+ EntityUtils.consume(resp.getEntity());
+ } catch (IOException e) { };
assertTrue("Expected "+HttpStatus.SC_OK + ", received " + resp.getStatusLine().getStatusCode(),
resp.getStatusLine().getStatusCode() == HttpStatus.SC_CREATED);
diff --git a/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/oslcv2/asset/GetAndUpdateRdfXmlTests.java b/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/oslcv2/asset/GetAndUpdateRdfXmlTests.java
index 78575d3..c8adb01 100644
--- a/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/oslcv2/asset/GetAndUpdateRdfXmlTests.java
+++ b/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/oslcv2/asset/GetAndUpdateRdfXmlTests.java
@@ -104,7 +104,9 @@ public class GetAndUpdateRdfXmlTests extends GetAndUpdateBase {
HttpResponse resp = OSLCUtils.postDataToUrl(artifactFactory, basicCreds,
OSLCConstants.CT_RDF, null, artifact, header);
- EntityUtils.consume(resp.getEntity());
+ try {
+ EntityUtils.consume(resp.getEntity());
+ } catch (IOException e) { }
assertTrue("Expected: " + HttpStatus.SC_CREATED + ", received: " + resp.getStatusLine().getStatusCode(),
HttpStatus.SC_CREATED == resp.getStatusLine().getStatusCode());
}
@@ -139,7 +141,9 @@ public class GetAndUpdateRdfXmlTests extends GetAndUpdateBase {
// Adds the artifact to the asset
HttpResponse resp = OSLCUtils.postDataToUrl(artifactFactory, basicCreds,
OSLCConstants.CT_RDF, "text/xml", artifact, header);
- EntityUtils.consume(resp.getEntity());
+ try {
+ EntityUtils.consume(resp.getEntity());
+ } catch (IOException e) { }
// Gets the asset with the artifact added to it
resp = getAssetResponse();
diff --git a/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/oslcv2/asset/GetAndUpdateXmlTests.java b/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/oslcv2/asset/GetAndUpdateXmlTests.java
index fadb791..0606816 100644
--- a/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/oslcv2/asset/GetAndUpdateXmlTests.java
+++ b/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/oslcv2/asset/GetAndUpdateXmlTests.java
@@ -103,7 +103,9 @@ public class GetAndUpdateXmlTests extends GetAndUpdateBase {
HttpResponse response = OSLCUtils.postDataToUrl(artifactFactory, basicCreds,
OSLCConstants.CT_XML, OSLCConstants.CT_XML, artifact, header);
- EntityUtils.consume(response.getEntity());
+ try {
+ EntityUtils.consume(response.getEntity());
+ } catch (IOException e) { }
assertTrue("Expected "+HttpStatus.SC_CREATED + ", received " + response.getStatusLine().getStatusCode(),
response.getStatusLine().getStatusCode() == HttpStatus.SC_CREATED);
}
@@ -137,7 +139,9 @@ public class GetAndUpdateXmlTests extends GetAndUpdateBase {
// Adds the artifact to the asset
HttpResponse response = OSLCUtils.postDataToUrl(artifactFactory, basicCreds,
OSLCConstants.CT_XML, OSLCConstants.CT_XML, artifact, header);
- EntityUtils.consume(response.getEntity());
+ try {
+ EntityUtils.consume(response.getEntity());
+ } catch (IOException e) { }
// Gets the asset with the artifact added to it
String resp = getAssetAsString();
diff --git a/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/oslcv2/asset/UsageCaseRdfXmlTests.java b/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/oslcv2/asset/UsageCaseRdfXmlTests.java
index 7fb9390..2815045 100644
--- a/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/oslcv2/asset/UsageCaseRdfXmlTests.java
+++ b/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/oslcv2/asset/UsageCaseRdfXmlTests.java
@@ -121,7 +121,9 @@ public class UsageCaseRdfXmlTests extends UsageCaseBase {
resp = OSLCUtils.postDataToUrl(artifactFactory, basicCreds,
OSLCConstants.CT_RDF, null, artifact, header);
- EntityUtils.consume(resp.getEntity());
+ try {
+ EntityUtils.consume(resp.getEntity());
+ } catch (IOException e) { }
assertTrue("Expected: " + HttpStatus.SC_CREATED + ", received: " + resp.getStatusLine().getStatusCode(),
HttpStatus.SC_CREATED == resp.getStatusLine().getStatusCode());
diff --git a/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/oslcv2/asset/UsageCaseXmlTests.java b/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/oslcv2/asset/UsageCaseXmlTests.java
index 1e5001e..f44a74a 100644
--- a/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/oslcv2/asset/UsageCaseXmlTests.java
+++ b/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/oslcv2/asset/UsageCaseXmlTests.java
@@ -101,7 +101,9 @@ public class UsageCaseXmlTests extends UsageCaseBase {
HttpResponse response = OSLCUtils.postDataToUrl(artifactFactory, basicCreds,
OSLCConstants.CT_XML, OSLCConstants.CT_XML, artifact, header);
- EntityUtils.consume(response.getEntity());
+ try {
+ EntityUtils.consume(response.getEntity());
+ } catch (IOException e) { }
assertTrue("Expected "+HttpStatus.SC_OK + ", received " + response.getStatusLine().getStatusCode(),
response.getStatusLine().getStatusCode() == HttpStatus.SC_CREATED);