use of io.vertx.core.http.CaseInsensitiveHeaders in project vert.x by eclipse.
the class CaseInsensitiveHeadersTest method testRemoveTest1.
@Test
public void testRemoveTest1() throws Exception {
MultiMap mmap = new CaseInsensitiveHeaders();
CharSequence name = String.valueOf(new Object());
MultiMap result = mmap.remove(name);
assertNotNull(result);
assertTrue(result.isEmpty());
assertEquals(0, result.size());
}
use of io.vertx.core.http.CaseInsensitiveHeaders in project vert.x by eclipse.
the class CaseInsensitiveHeadersTest method testIteratorTest1.
@Test
public void testIteratorTest1() throws Exception {
MultiMap mmap = new CaseInsensitiveHeaders();
Iterator<Map.Entry<String, String>> result = mmap.iterator();
assertNotNull(result);
assertFalse(result.hasNext());
}
use of io.vertx.core.http.CaseInsensitiveHeaders in project vert.x by eclipse.
the class CaseInsensitiveHeadersTest method testMapEntrySetValueNull.
@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);
}
}
use of io.vertx.core.http.CaseInsensitiveHeaders in project vert.x by eclipse.
the class CaseInsensitiveHeadersTest method testHashMININT.
// construct a string with hash==MIN_VALUE
// to get coverage of the if in hash()
// we will calculate the representation of
// MAX_VALUE+1 in base31, which wraps around to
// MIN_VALUE in int representation
@Test
public void testHashMININT() {
CaseInsensitiveHeaders mm = new CaseInsensitiveHeaders();
String name1 = "";
long value = Integer.MAX_VALUE;
value++;
int base = 31;
long pow = 1;
while (value > pow * base) {
pow *= base;
}
while (pow != 0) {
long mul = value / pow;
name1 = ((char) mul) + name1;
value -= pow * mul;
pow /= base;
}
name1 = ((char) value) + name1;
mm.add(name1, "value");
assertEquals("value", mm.get(name1));
}
use of io.vertx.core.http.CaseInsensitiveHeaders in project vert.x by eclipse.
the class CaseInsensitiveHeadersTest method testAddTest4.
@Test
public void testAddTest4() throws Exception {
MultiMap mmap = new CaseInsensitiveHeaders();
Map<String, String> map = new HashMap<String, String>();
assertEquals("", mmap.addAll(map).toString());
}
Aggregations