use of io.vertx.core.MultiMap in project vert.x by eclipse.
the class CaseInsensitiveHeadersTest method testIsEmptyTest1.
@Test
public void testIsEmptyTest1() throws Exception {
MultiMap mmap = new CaseInsensitiveHeaders();
assertTrue(mmap.isEmpty());
}
use of io.vertx.core.MultiMap in project vert.x by eclipse.
the class CaseInsensitiveHeadersTest method testToString.
@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()));
}
use of io.vertx.core.MultiMap in project vert.x by eclipse.
the class CaseInsensitiveHeadersTest method testSetTest8.
@Test
public void testSetTest8() throws Exception {
MultiMap mmap = new CaseInsensitiveHeaders();
CharSequence name = "name";
ArrayList<CharSequence> values = new ArrayList<CharSequence>();
values.add("somevalue");
assertEquals("name: somevalue\n", mmap.set(name, values).toString());
}
use of io.vertx.core.MultiMap in project vert.x by eclipse.
the class CaseInsensitiveHeadersTest method testSetIterable.
@Test
public void testSetIterable() throws Exception {
MultiMap mmap = new CaseInsensitiveHeaders();
String name = "name";
List<String> values = new ArrayList<String>();
values.add("value1");
values.add(null);
MultiMap result = mmap.set(name, values);
assertNotNull(result);
assertFalse(result.isEmpty());
assertEquals(1, result.size());
assertEquals("name: value1\n", result.toString());
}
use of io.vertx.core.MultiMap in project vert.x by eclipse.
the class CaseInsensitiveHeadersTest method testSetTest11.
@Test
public void testSetTest11() throws Exception {
MultiMap mmap = new CaseInsensitiveHeaders();
String name = "";
String strVal = "";
MultiMap result = mmap.set(name, strVal);
assertNotNull(result);
assertFalse(result.isEmpty());
assertEquals(1, result.size());
assertEquals(": \n", result.toString());
}
Aggregations