Package com.google.code.http4j.impl

Examples of com.google.code.http4j.impl.CanonicalHeader


 
  private Header acceptLanguage;
 
  @BeforeClass
  public void beforeClass() {
    host = new CanonicalHeader("host", "code.google.com");
    acceptLanguage = new CanonicalHeader("ACcePT-lanGuagE", "en_US");
  }
View Full Code Here


 
  private Header acceptLanguage;
 
  @BeforeClass
  public void beforeClass() {
    host = new CanonicalHeader("host", "code.google.com");
    acceptLanguage = new CanonicalHeader("ACcePT-lanGuagE", "en_US");
  }
View Full Code Here

  }
 
  @Test(dependsOnMethods = "get")
  public void set() {
    List<Header> headers = new LinkedList<Header>();
    headers.add(new CanonicalHeader(Headers.RESPONSE_COOKIE, "PREF=ID=2067d32f823de961:NW=1:TM=1284034854:LM=1284034854:S=eLKAQ-QOYpFKPwI3; expires=Sat, 08-Sep-2012 12:20:54 GMT; path=/; domain=.google.com"));
    headers.add(new CanonicalHeader(Headers.RESPONSE_COOKIE, "NID=38=g4PriUXNBibltyAS5Rko6b6ygubtZQs0s2FAy0zMYHOKOIY5rQyE1gAskYS0MU6g767OB24_xknddTgcBKuEMsShbEhZMH0ev9A_uMbWF9D61d8VcASWeksFx2kTSR_i; expires=Fri, 11-Mar-2011 12:20:54 GMT; path=/; domain=.google.com; HttpOnly"));
    headers.add(new CanonicalHeader(Headers.CONTENT_LENGTH, "458"));
    cache.set(uri, headers);
    String cookie = cache.get(uri);
    Assert.assertNotNull(cookie);
    Assert.assertEquals(cookie, "PREF=ID=2067d32f823de961:NW=1:TM=1284034854:LM=1284034854:S=eLKAQ-QOYpFKPwI3;NID=38=g4PriUXNBibltyAS5Rko6b6ygubtZQs0s2FAy0zMYHOKOIY5rQyE1gAskYS0MU6g767OB24_xknddTgcBKuEMsShbEhZMH0ev9A_uMbWF9D61d8VcASWeksFx2kTSR_i");
    Assert.assertNull(cache.get(anotherUri));
View Full Code Here

  }
 
  @Test(dependsOnMethods = "get")
  public void set() {
    List<Header> headers = new LinkedList<Header>();
    headers.add(new CanonicalHeader(Headers.RESPONSE_COOKIE, "PREF=ID=2067d32f823de961:NW=1:TM=1284034854:LM=1284034854:S=eLKAQ-QOYpFKPwI3; expires=Sat, 08-Sep-2012 12:20:54 GMT; path=/; domain=.google.com"));
    headers.add(new CanonicalHeader(Headers.RESPONSE_COOKIE, "NID=38=g4PriUXNBibltyAS5Rko6b6ygubtZQs0s2FAy0zMYHOKOIY5rQyE1gAskYS0MU6g767OB24_xknddTgcBKuEMsShbEhZMH0ev9A_uMbWF9D61d8VcASWeksFx2kTSR_i; expires=Fri, 11-Mar-2011 12:20:54 GMT; path=/; domain=.google.com; HttpOnly"));
    headers.add(new CanonicalHeader(Headers.CONTENT_LENGTH, "458"));
    cache.set(uri, headers);
    String cookie = cache.get(uri);
    Assert.assertNotNull(cookie);
    Assert.assertEquals(cookie, "PREF=ID=2067d32f823de961:NW=1:TM=1284034854:LM=1284034854:S=eLKAQ-QOYpFKPwI3;NID=38=g4PriUXNBibltyAS5Rko6b6ygubtZQs0s2FAy0zMYHOKOIY5rQyE1gAskYS0MU6g767OB24_xknddTgcBKuEMsShbEhZMH0ev9A_uMbWF9D61d8VcASWeksFx2kTSR_i");
    Assert.assertNull(cache.get(anotherUri));
View Full Code Here

  }
 
  @Test
  public void toString_Headers() {
    List<Header> headers = new LinkedList<Header>();
    headers.add(new CanonicalHeader("Content-Type","text/html"));
    headers.add(new CanonicalHeader("Content-Length","2012"));
    String string = Headers.toString(headers);
    Assert.assertEquals(string, "\r\nContent-Type:text/html\r\nContent-Length:2012");
  }
View Full Code Here

TOP

Related Classes of com.google.code.http4j.impl.CanonicalHeader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.