Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Pingel2012-01-25 14:49:48 +0000
committerSteffen Pingel2012-01-25 14:49:48 +0000
commitb60424f6fcf3ed5b030723bd3cfc2226445ba4a8 (patch)
tree45a6f863c01a4055acf21a75d788d7353b1f6361 /org.eclipse.mylyn.commons.repositories.http.tests
parent78f839a9cce110f97ec1d31a98627729bda6061d (diff)
downloadorg.eclipse.mylyn.commons-b60424f6fcf3ed5b030723bd3cfc2226445ba4a8.tar.gz
org.eclipse.mylyn.commons-b60424f6fcf3ed5b030723bd3cfc2226445ba4a8.tar.xz
org.eclipse.mylyn.commons-b60424f6fcf3ed5b030723bd3cfc2226445ba4a8.zip
RESOLVED - bug 351100: fix failing tests for Mylyn 3.7
https://bugs.eclipse.org/bugs/show_bug.cgi?id=351100 Change-Id: If72a3a8ceeaa00cfc334d23444c80e21945ec264
Diffstat (limited to 'org.eclipse.mylyn.commons.repositories.http.tests')
-rw-r--r--org.eclipse.mylyn.commons.repositories.http.tests/src/org/eclipse/mylyn/commons/repositories/http/tests/HttpUtilTest.java13
1 files changed, 3 insertions, 10 deletions
diff --git a/org.eclipse.mylyn.commons.repositories.http.tests/src/org/eclipse/mylyn/commons/repositories/http/tests/HttpUtilTest.java b/org.eclipse.mylyn.commons.repositories.http.tests/src/org/eclipse/mylyn/commons/repositories/http/tests/HttpUtilTest.java
index a2b82845..976f13be 100644
--- a/org.eclipse.mylyn.commons.repositories.http.tests/src/org/eclipse/mylyn/commons/repositories/http/tests/HttpUtilTest.java
+++ b/org.eclipse.mylyn.commons.repositories.http.tests/src/org/eclipse/mylyn/commons/repositories/http/tests/HttpUtilTest.java
@@ -13,8 +13,6 @@ package org.eclipse.mylyn.commons.repositories.http.tests;
import static org.junit.Assert.assertEquals;
-import java.net.InetSocketAddress;
-
import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
import org.apache.http.client.methods.HttpGet;
@@ -35,8 +33,6 @@ public class HttpUtilTest {
private TestProxy testProxy;
- private InetSocketAddress proxyAddress;
-
private DefaultHttpClient client;
private ThreadSafeClientConnManager connectionManager;
@@ -47,10 +43,7 @@ public class HttpUtilTest {
@Before
public void setUp() throws Exception {
testProxy = new TestProxy();
- int proxyPort = testProxy.startAndWait();
- assert proxyPort > 0;
- proxyAddress = new InetSocketAddress("localhost", proxyPort);
-
+ testProxy.startAndWait();
connectionManager = new ThreadSafeClientConnManager();
client = new DefaultHttpClient() {
@Override
@@ -67,8 +60,8 @@ public class HttpUtilTest {
@Test
public void testGetRequestPoolConnections() throws Exception {
- String url = "http://" + proxyAddress.getHostName() + ":" + proxyAddress.getPort() + "/";
- HttpRequestBase request = new HttpGet(url);
+ testProxy.addResponse(TestProxy.SERVICE_UNVAILABLE);
+ HttpRequestBase request = new HttpGet(testProxy.getUrl());
HttpUtil.configureClient(client, null);
assertEquals(0, connectionManager.getConnectionsInPool());

Back to the top