"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "httpclient/src/test/java/org/apache/http/client/protocol/TestRequestAddCookies.java" between
httpcomponents-client-4.5.6-src.tar.gz and httpcomponents-client-4.5.7-src.tar.gz

About: HttpComponents is an Apache project responsible for creating and maintaining a toolset of low level Java components focused on HTTP and associated protocols. Java sources.

TestRequestAddCookies.java  (httpcomponents-client-4.5.6-src):TestRequestAddCookies.java  (httpcomponents-client-4.5.7-src)
skipping to change at line 60 skipping to change at line 60
import org.apache.http.impl.cookie.DefaultCookieSpecProvider; import org.apache.http.impl.cookie.DefaultCookieSpecProvider;
import org.apache.http.impl.cookie.IgnoreSpecProvider; import org.apache.http.impl.cookie.IgnoreSpecProvider;
import org.apache.http.impl.cookie.NetscapeDraftSpec; import org.apache.http.impl.cookie.NetscapeDraftSpec;
import org.apache.http.impl.cookie.NetscapeDraftSpecProvider; import org.apache.http.impl.cookie.NetscapeDraftSpecProvider;
import org.apache.http.impl.cookie.RFC2965SpecProvider; import org.apache.http.impl.cookie.RFC2965SpecProvider;
import org.apache.http.message.BasicHttpRequest; import org.apache.http.message.BasicHttpRequest;
import org.apache.http.protocol.HttpCoreContext; import org.apache.http.protocol.HttpCoreContext;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.mockito.Matchers;
import org.mockito.Mockito; import org.mockito.Mockito;
public class TestRequestAddCookies { public class TestRequestAddCookies {
private HttpHost target; private HttpHost target;
private CookieStore cookieStore; private CookieStore cookieStore;
private Lookup<CookieSpecProvider> cookieSpecRegistry; private Lookup<CookieSpecProvider> cookieSpecRegistry;
@Before @Before
public void setUp() { public void setUp() {
skipping to change at line 405 skipping to change at line 406
final Header[] headers1 = request.getHeaders(SM.COOKIE); final Header[] headers1 = request.getHeaders(SM.COOKIE);
Assert.assertNotNull(headers1); Assert.assertNotNull(headers1);
Assert.assertEquals(2, headers1.length); Assert.assertEquals(2, headers1.length);
Assert.assertEquals("$Version=1; name1=\"value1\"", headers1[0].getValue ()); Assert.assertEquals("$Version=1; name1=\"value1\"", headers1[0].getValue ());
Assert.assertEquals("$Version=1; name2=\"value2\"", headers1[1].getValue ()); Assert.assertEquals("$Version=1; name2=\"value2\"", headers1[1].getValue ());
final Header[] headers2 = request.getHeaders(SM.COOKIE2); final Header[] headers2 = request.getHeaders(SM.COOKIE2);
Assert.assertNotNull(headers2); Assert.assertNotNull(headers2);
Assert.assertEquals(0, headers2.length); Assert.assertEquals(0, headers2.length);
Mockito.verify(this.cookieStore, Mockito.times(1)).clearExpired(Mockito. <Date>any()); Mockito.verify(this.cookieStore, Mockito.times(1)).clearExpired(Matchers .<Date>any());
} }
@Test @Test
public void testNoMatchingCookies() throws Exception { public void testNoMatchingCookies() throws Exception {
final HttpRequest request = new BasicHttpRequest("GET", "/"); final HttpRequest request = new BasicHttpRequest("GET", "/");
this.cookieStore.clear(); this.cookieStore.clear();
final BasicClientCookie cookie3 = new BasicClientCookie("name3", "value3 "); final BasicClientCookie cookie3 = new BasicClientCookie("name3", "value3 ");
cookie3.setDomain("www.somedomain.com"); cookie3.setDomain("www.somedomain.com");
cookie3.setPath("/"); cookie3.setPath("/");
 End of changes. 2 change blocks. 
1 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)