jmeter-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrey Pokhilko <a...@ya.ru>
Subject Re: Progressive Migration from HttpClient 4.2.3 to 4.5
Date Tue, 27 Oct 2015 15:32:18 GMT
Hi,

Today we've found an issue in using HTTPClient 4.5 in JMeter. If we just
replace the libraries with no change to JMeter code, it stops processing
wildcard domains for cookies. I've failed to understand if it is
regression in HTTPClient or something else.

I've managed to write a unit test for it, I can commit it into trunk if
needed. Unit test works fine on old libraries, but fails with 4.5:

package org.apache.jmeter.protocol.http.control;

import org.apache.http.cookie.Cookie;
import org.apache.jmeter.testelement.property.CollectionProperty;
import org.junit.Assert;
import org.junit.Test;

import java.net.URL;
import java.util.List;

public class HC4CookieHandlerTest {

    @Test public void testAddCookieFromHeader_wildcard() throws Exception {
        HC4CookieHandler obj = new HC4CookieHandler("compatibility");
        URL url = new URL("https://subdomain.bt.com/page");
        CookieManager mgr = new CookieManager();
        String headerLine = "SMTRYNO=1; path=/; domain=.bt.com";
        obj.addCookieFromHeader(mgr, true, headerLine, url);
        CollectionProperty cp = mgr.getCookies();
        List<Cookie> res = obj.getCookiesForUrl(cp, url, false);
        Assert.assertEquals(1, res.size());
        for (Cookie cookie : res) {
            Assert.assertEquals(".bt.com", cookie.getDomain());
        }
    }
}



Andrey Pokhilko

On 07/04/2015 05:35 PM, Philippe Mouawad wrote:
> Hello,
> HttpClient 4.3 introduced a new set of APIs which makes migration from
> 4.2.3 to 4.5 an important work.
>
> What are the risks and what do you think about the approach of progressive
> migration:
>
>    - We upgrade to  4.5 HttpClient/Mime and 4.4.1 (HttpCore) jars which
>    show many deprecations but not broken compilation
>    - Once done, we move progressively (not always possible) to 4.5 the code
>
> If this is feasible then it would allow us to fix :
>
>    - https://bz.apache.org/bugzilla/show_bug.cgi?id=57935
>
>
> Any trace of a migration documentation from 4.2.X to 4.3. ?
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message