Return-Path: X-Original-To: apmail-hc-commits-archive@www.apache.org Delivered-To: apmail-hc-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8736F7E84 for ; Thu, 6 Oct 2011 13:09:46 +0000 (UTC) Received: (qmail 9576 invoked by uid 500); 6 Oct 2011 13:09:46 -0000 Delivered-To: apmail-hc-commits-archive@hc.apache.org Received: (qmail 9541 invoked by uid 500); 6 Oct 2011 13:09:46 -0000 Mailing-List: contact commits-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list commits@hc.apache.org Received: (qmail 9534 invoked by uid 99); 6 Oct 2011 13:09:46 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Oct 2011 13:09:46 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Oct 2011 13:09:43 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 61AEF2388A5F for ; Thu, 6 Oct 2011 13:09:22 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1179611 - /httpcomponents/httpclient/branches/4.1.x/httpclient/src/test/java/org/apache/http/impl/conn/TestTSCCMWithServer.java Date: Thu, 06 Oct 2011 13:09:22 -0000 To: commits@hc.apache.org From: olegk@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111006130922.61AEF2388A5F@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: olegk Date: Thu Oct 6 13:09:22 2011 New Revision: 1179611 URL: http://svn.apache.org/viewvc?rev=1179611&view=rev Log: Removed obsolete test case Modified: httpcomponents/httpclient/branches/4.1.x/httpclient/src/test/java/org/apache/http/impl/conn/TestTSCCMWithServer.java Modified: httpcomponents/httpclient/branches/4.1.x/httpclient/src/test/java/org/apache/http/impl/conn/TestTSCCMWithServer.java URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.1.x/httpclient/src/test/java/org/apache/http/impl/conn/TestTSCCMWithServer.java?rev=1179611&r1=1179610&r2=1179611&view=diff ============================================================================== --- httpcomponents/httpclient/branches/4.1.x/httpclient/src/test/java/org/apache/http/impl/conn/TestTSCCMWithServer.java (original) +++ httpcomponents/httpclient/branches/4.1.x/httpclient/src/test/java/org/apache/http/impl/conn/TestTSCCMWithServer.java Thu Oct 6 13:09:22 2011 @@ -28,7 +28,6 @@ package org.apache.http.impl.conn; import java.io.IOException; -import java.lang.ref.WeakReference; import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.Socket; @@ -484,56 +483,6 @@ public class TestTSCCMWithServer extends mgr.shutdown(); } - /** - * Tests GC of an unreferenced connection manager. - */ - @Test - public void testConnectionManagerGC() throws Exception { - // 3.x: TestHttpConnectionManager.testDroppedThread - - ThreadSafeClientConnManager mgr = createTSCCM(null); - - final HttpHost target = getServerHttp(); - final HttpRoute route = new HttpRoute(target, null, false); - final int rsplen = 8; - final String uri = "/random/" + rsplen; - - HttpRequest request = - new BasicHttpRequest("GET", uri, HttpVersion.HTTP_1_1); - - ManagedClientConnection conn = getConnection(mgr, route); - conn.open(route, httpContext, defaultParams); - - // a new context is created for each testcase, no need to reset - HttpResponse response = Helper.execute(request, conn, target, - httpExecutor, httpProcessor, defaultParams, httpContext); - EntityUtils.toByteArray(response.getEntity()); - - // release connection after marking it for re-use - conn.markReusable(); - mgr.releaseConnection(conn, -1, null); - - // We now have a manager with an open connection in its pool. - // We drop all potential hard reference to the manager and check - // whether it is GCed. Internal references might prevent that - // if set up incorrectly. - // Note that we still keep references to the connection wrapper - // we got from the manager, directly as well as in the request - // and in the context. The manager will be GCed only if the - // connection wrapper is truly detached. - WeakReference wref = - new WeakReference(mgr); - mgr = null; - - // Java does not guarantee that this will trigger the GC, but - // it does in the test environment. GC is asynchronous, so we - // need to give the garbage collector some time afterwards. - System.gc(); - Thread.sleep(1000); - - Assert.assertNull("TSCCM not garbage collected", wref.get()); - } - @Test public void testAbortDuringConnecting() throws Exception { final CountDownLatch connectLatch = new CountDownLatch(1);