Search in sources :

Example 61 with MultiMap

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

the class CaseInsensitiveHeadersTest method testSetTest13.

@Test
public void testSetTest13() throws Exception {
    MultiMap mmap = new CaseInsensitiveHeaders();
    String name = "aaa";
    String strVal = "";
    MultiMap result = mmap.set(name, strVal);
    assertNotNull(result);
    assertFalse(result.isEmpty());
    assertEquals(1, result.size());
    assertEquals("aaa: \n", result.toString());
}
Also used : MultiMap(io.vertx.core.MultiMap) CaseInsensitiveHeaders(io.vertx.core.http.CaseInsensitiveHeaders) Test(org.junit.Test)

Example 62 with MultiMap

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

the class CaseInsensitiveHeadersTest method testContainsTest1.

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

Example 63 with MultiMap

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

the class CaseInsensitiveHeadersTest method testGetAllTest3.

@Test
public void testGetAllTest3() throws Exception {
    MultiMap mmap = new CaseInsensitiveHeaders();
    String name = "name";
    List<String> result = mmap.getAll(name);
    assertNotNull(result);
    assertEquals(0, result.size());
}
Also used : MultiMap(io.vertx.core.MultiMap) CaseInsensitiveHeaders(io.vertx.core.http.CaseInsensitiveHeaders) Test(org.junit.Test)

Example 64 with MultiMap

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

the class CaseInsensitiveHeadersTest method testAddTest14.

@Test
public void testAddTest14() throws Exception {
    MultiMap mmap = new CaseInsensitiveHeaders();
    String name = "";
    String strVal = "aaa";
    assertEquals(": aaa\n", mmap.add(name, strVal).toString());
}
Also used : MultiMap(io.vertx.core.MultiMap) CaseInsensitiveHeaders(io.vertx.core.http.CaseInsensitiveHeaders) Test(org.junit.Test)

Example 65 with MultiMap

use of io.vertx.core.MultiMap 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)

Aggregations

MultiMap (io.vertx.core.MultiMap)89 Test (org.junit.Test)77 CaseInsensitiveHeaders (io.vertx.core.http.CaseInsensitiveHeaders)61 HashMap (java.util.HashMap)21 ArrayList (java.util.ArrayList)19 Map (java.util.Map)12 Buffer (io.vertx.core.buffer.Buffer)9 DefaultHttpHeaders (io.netty.handler.codec.http.DefaultHttpHeaders)8 Handler (io.vertx.core.Handler)8 VertxException (io.vertx.core.VertxException)8 HttpClientRequest (io.vertx.core.http.HttpClientRequest)8 HttpMethod (io.vertx.core.http.HttpMethod)8 HttpServerResponse (io.vertx.core.http.HttpServerResponse)8 HeadersAdaptor (io.vertx.core.http.impl.HeadersAdaptor)8 HttpResponseStatus (io.netty.handler.codec.http.HttpResponseStatus)7 InternalLoggerFactory (io.netty.util.internal.logging.InternalLoggerFactory)7 Nullable (io.vertx.codegen.annotations.Nullable)7 AbstractVerticle (io.vertx.core.AbstractVerticle)7 AsyncResult (io.vertx.core.AsyncResult)7 Context (io.vertx.core.Context)7