Search in sources :

Example 11 with CaseInsensitiveHeaders

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());
}
Also used : MultiMap(io.vertx.core.MultiMap) CaseInsensitiveHeaders(io.vertx.core.http.CaseInsensitiveHeaders) Test(org.junit.Test)

Example 12 with CaseInsensitiveHeaders

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());
}
Also used : MultiMap(io.vertx.core.MultiMap) CaseInsensitiveHeaders(io.vertx.core.http.CaseInsensitiveHeaders) Test(org.junit.Test)

Example 13 with CaseInsensitiveHeaders

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);
    }
}
Also used : MultiMap(io.vertx.core.MultiMap) CaseInsensitiveHeaders(io.vertx.core.http.CaseInsensitiveHeaders) Map(java.util.Map) MultiMap(io.vertx.core.MultiMap) HashMap(java.util.HashMap) Test(org.junit.Test)

Example 14 with CaseInsensitiveHeaders

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));
}
Also used : CaseInsensitiveHeaders(io.vertx.core.http.CaseInsensitiveHeaders) Test(org.junit.Test)

Example 15 with CaseInsensitiveHeaders

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());
}
Also used : MultiMap(io.vertx.core.MultiMap) CaseInsensitiveHeaders(io.vertx.core.http.CaseInsensitiveHeaders) HashMap(java.util.HashMap) Test(org.junit.Test)

Aggregations

CaseInsensitiveHeaders (io.vertx.core.http.CaseInsensitiveHeaders)69 MultiMap (io.vertx.core.MultiMap)65 Test (org.junit.Test)64 ArrayList (java.util.ArrayList)10 HashMap (java.util.HashMap)10 Buffer (io.vertx.core.buffer.Buffer)3 VxApiServerURLInfo (com.szmirren.vxApi.core.entity.VxApiServerURLInfo)2 VxApiTrackInfos (com.szmirren.vxApi.core.entity.VxApiTrackInfos)2 VxApiParamOptions (com.szmirren.vxApi.core.options.VxApiParamOptions)2 HttpClientRequest (io.vertx.core.http.HttpClientRequest)2 HttpServerResponse (io.vertx.core.http.HttpServerResponse)2 JsonObject (io.vertx.core.json.JsonObject)2 ConnectException (java.net.ConnectException)2 Map (java.util.Map)2 TimeoutException (java.util.concurrent.TimeoutException)2 QueryStringDecoder (io.netty.handler.codec.http.QueryStringDecoder)1 QueryStringEncoder (io.netty.handler.codec.http.QueryStringEncoder)1 WebSocket (io.vertx.core.http.WebSocket)1 WebSocketFrame (io.vertx.core.http.WebSocketFrame)1 FrameType (io.vertx.core.http.impl.FrameType)1