use of io.vertx.core.MultiMap in project vert.x by eclipse.
the class CaseInsensitiveHeadersTest method testSetTest7.
@Test
public void testSetTest7() throws Exception {
MultiMap mmap = new CaseInsensitiveHeaders();
CharSequence name = "name";
CharSequence value = "value";
MultiMap result = mmap.set(name, value);
assertNotNull(result);
assertFalse(result.isEmpty());
assertEquals(1, result.size());
assertEquals("name: value\n", result.toString());
}
use of io.vertx.core.MultiMap in project vert.x by eclipse.
the class CaseInsensitiveHeadersTest method testSetTest10.
@Test
public void testSetTest10() throws Exception {
MultiMap mmap = new CaseInsensitiveHeaders();
String name = "aaa";
ArrayList<CharSequence> values = new ArrayList<CharSequence>();
values.add("somevalue");
assertEquals("aaa: somevalue\n", mmap.set(name, values).toString());
}
use of io.vertx.core.MultiMap in project vert.x by eclipse.
the class CaseInsensitiveHeadersTest method testGetTest3.
@Test
public void testGetTest3() throws Exception {
MultiMap mmap = new CaseInsensitiveHeaders();
String name = "name";
String result = mmap.get(name);
assertNull(result);
mmap.add(name, "value");
result = mmap.get(name);
assertEquals("value", result);
}
use of io.vertx.core.MultiMap in project vert.x by eclipse.
the class CaseInsensitiveHeadersTest method testGetAllHashColl.
@Test
public void testGetAllHashColl() {
MultiMap mm = new CaseInsensitiveHeaders();
String name1 = "AZ";
String name2 = "Y";
assertTrue("hash error", hash(name1) == hash(name2));
mm.add(name1, "value1");
mm.add(name2, "value2");
assertEquals(2, mm.size());
assertEquals("[value1]", mm.getAll(name1).toString());
assertEquals("[value2]", mm.getAll(name2).toString());
mm = new CaseInsensitiveHeaders();
name1 = "A";
name2 = "R";
assertTrue("hash error", index(hash(name1)) == index(hash(name2)));
mm.add(name1, "value1");
mm.add(name2, "value2");
assertEquals(2, mm.size());
assertEquals("[value1]", mm.getAll(name1).toString());
assertEquals("[value2]", mm.getAll(name2).toString());
}
use of io.vertx.core.MultiMap in project vert.x by eclipse.
the class CaseInsensitiveHeadersTest method testAddTest2.
@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());
}
Aggregations