Search in sources :

Example 51 with CaseInsensitiveHeaders

use of io.vertx.core.http.CaseInsensitiveHeaders in project vert.x by eclipse.

the class CaseInsensitiveHeadersTest method testMapEntrySetValue.

/*
   * unit tests for public method in MapEntry
   * (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"));
}
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 52 with CaseInsensitiveHeaders

use of io.vertx.core.http.CaseInsensitiveHeaders in project vert.x by eclipse.

the class CaseInsensitiveHeadersTest method testContainsTest2.

@Test
public void testContainsTest2() throws Exception {
    MultiMap mmap = new CaseInsensitiveHeaders();
    String name = "";
    assertFalse(mmap.contains(name));
}
Also used : MultiMap(io.vertx.core.MultiMap) CaseInsensitiveHeaders(io.vertx.core.http.CaseInsensitiveHeaders) Test(org.junit.Test)

Example 53 with CaseInsensitiveHeaders

use of io.vertx.core.http.CaseInsensitiveHeaders in project vert.x by eclipse.

the class CaseInsensitiveHeadersTest method testAddMultiMap.

@Test
public void testAddMultiMap() throws Exception {
    MultiMap mmap = new CaseInsensitiveHeaders();
    MultiMap mm = new CaseInsensitiveHeaders();
    mm.add("Header1", "value1");
    mm.add("Header2", "value2");
    MultiMap result = mmap.addAll(mm);
    assertEquals(2, result.size());
    assertEquals("Header1: value1\nHeader2: value2\n", result.toString());
}
Also used : MultiMap(io.vertx.core.MultiMap) CaseInsensitiveHeaders(io.vertx.core.http.CaseInsensitiveHeaders) Test(org.junit.Test)

Example 54 with CaseInsensitiveHeaders

use of io.vertx.core.http.CaseInsensitiveHeaders in project vert.x by eclipse.

the class CaseInsensitiveHeadersTest method testRemoveTest2.

@Test
public void testRemoveTest2() throws Exception {
    MultiMap mmap = new CaseInsensitiveHeaders();
    String name = "1";
    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 55 with CaseInsensitiveHeaders

use of io.vertx.core.http.CaseInsensitiveHeaders in project vert.x by eclipse.

the class CaseInsensitiveHeadersTest method testRemoveTest4.

@Test
public void testRemoveTest4() throws Exception {
    MultiMap mmap = new CaseInsensitiveHeaders();
    String name = "name";
    String value = "value";
    mmap.add(name, value);
    assertTrue(mmap.contains(name));
    MultiMap result = mmap.remove(name);
    assertFalse(result.contains(name));
}
Also used : MultiMap(io.vertx.core.MultiMap) CaseInsensitiveHeaders(io.vertx.core.http.CaseInsensitiveHeaders) 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