Package io.vertx.core.http

Examples of io.vertx.core.http.CaseInsensitiveHeaders


    return sb.toString();
  }

  @Test
  public void testToString() {
    MultiMap mm = new CaseInsensitiveHeaders();
    assertEquals("", mm.toString());
    mm.add("Header1", "Value1");
    assertEquals("Header1: Value1\n",
        sortByLine(mm.toString()));
    mm.add("Header2", "Value2");
    assertEquals("Header1: Value1\n"
        + "Header2: Value2\n",
        sortByLine(mm.toString()));
    mm.add("Header1", "Value3");
    assertEquals("Header1: Value1\n"
        + "Header1: Value3\n"
        + "Header2: Value2\n",
        sortByLine(mm.toString()));
    mm.remove("Header1");
    assertEquals("Header2: Value2\n",
        sortByLine(mm.toString()));
    mm.set("Header2", "Value4");
    assertEquals("Header2: Value4\n",
        sortByLine(mm.toString()));
  }
View Full Code Here


   * (isn't actually used in the implementation)
   */

  @Test
  public void testMapEntrySetValue() throws Exception {
    MultiMap mmap = new CaseInsensitiveHeaders();

    mmap.add("Header", "oldvalue");

    for (Map.Entry<String, String> me:mmap) {
      me.setValue("newvalue");
    }
    assertEquals("newvalue", mmap.get("Header"));
  }
View Full Code Here

    assertEquals("newvalue", mmap.get("Header"));
  }

  @Test
  public void testMapEntryToString() throws Exception {
    MultiMap mmap = new CaseInsensitiveHeaders();

    mmap.add("Header", "value");

    assertEquals("Header: value", mmap.iterator().next().toString());
  }
View Full Code Here

    assertEquals("Header: value", mmap.iterator().next().toString());
  }

  @Test(expected = NullPointerException.class)
  public void testMapEntrySetValueNull() throws Exception {
    MultiMap mmap = new CaseInsensitiveHeaders();

    mmap.add("Header", "oldvalue");

    for (Map.Entry<String, String> me:mmap) {
      me.setValue(null);
    }
  }
View Full Code Here

  @Test
  public void testCaseInsensitiveHeaders()
      throws Exception {

    MultiMap result = new CaseInsensitiveHeaders();

    assertNotNull(result);
    assertTrue(result.isEmpty());
    assertEquals(0, result.size());
    assertEquals("", result.toString());
  }
View Full Code Here

  }

  @Test
  public void testAddTest1()
      throws Exception {
    MultiMap mmap = new CaseInsensitiveHeaders();
    HashMap<String, String> map = new HashMap<String, String>();
    map.put("a", "b");

    MultiMap result = mmap.addAll(map);

    assertNotNull(result);
    assertFalse(result.isEmpty());
    assertEquals(1, result.size());
    assertEquals("a: b\n", result.toString());
View Full Code Here

  }

  @Test
  public void testAddTest2()
      throws Exception {
    MultiMap mmap = new CaseInsensitiveHeaders();
    HashMap<String, String> map = new HashMap<String, String>();
    map.put("a", "b");
    map.put("c", "d");

    assertEquals("a: b\nc: d\n", mmap.addAll(map).toString());
  }
View Full Code Here

  }

  @Test
  public void testAddTest3()
      throws Exception {
    MultiMap mmap = new CaseInsensitiveHeaders();
    HashMap<String, String> map = new HashMap<String, String>();
    map.put("a", "b");

    assertEquals("a: b\n", mmap.addAll(map).toString());
  }
View Full Code Here

  }

  @Test
  public void testAddTest4()
      throws Exception {
    MultiMap mmap = new CaseInsensitiveHeaders();
    Map<String, String> map = new HashMap<String, String>();

    assertEquals("", mmap.addAll(map).toString());
  }
View Full Code Here

  }

  @Test
  public void testAddTest5()
      throws Exception {
    MultiMap mmap = new CaseInsensitiveHeaders();
    MultiMap headers = new CaseInsensitiveHeaders();

    assertEquals("", mmap.addAll(headers).toString());
  }
View Full Code Here

TOP

Related Classes of io.vertx.core.http.CaseInsensitiveHeaders

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.