Search in sources :

Example 21 with MultiMap

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

the class CaseInsensitiveHeadersTest method testIteratorTest2.

@Test
public void testIteratorTest2() throws Exception {
    MultiMap mmap = new CaseInsensitiveHeaders();
    mmap.add("a", "b");
    Iterator<Map.Entry<String, String>> result = mmap.iterator();
    assertNotNull(result);
    assertTrue(result.hasNext());
}
Also used : MultiMap(io.vertx.core.MultiMap) CaseInsensitiveHeaders(io.vertx.core.http.CaseInsensitiveHeaders) Test(org.junit.Test)

Example 22 with MultiMap

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

the class CaseInsensitiveHeadersTest method testAddTest8.

@Test
public void testAddTest8() throws Exception {
    MultiMap mmap = new CaseInsensitiveHeaders();
    CharSequence name = "name";
    ArrayList<CharSequence> values = new ArrayList<CharSequence>();
    values.add("somevalue");
    assertEquals("name: somevalue\n", mmap.add(name, values).toString());
}
Also used : MultiMap(io.vertx.core.MultiMap) CaseInsensitiveHeaders(io.vertx.core.http.CaseInsensitiveHeaders) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Example 23 with MultiMap

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

the class CaseInsensitiveHeadersTest method testAddTest13.

@Test
public void testAddTest13() throws Exception {
    MultiMap mmap = new CaseInsensitiveHeaders();
    String name = "aaa";
    String strVal = "";
    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 24 with MultiMap

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

the class CaseInsensitiveHeadersTest method testSetTest1.

@Test
public void testSetTest1() throws Exception {
    MultiMap mmap = new CaseInsensitiveHeaders();
    HashMap<String, String> headers = new HashMap<String, String>();
    headers.put("", "");
    MultiMap result = mmap.setAll(headers);
    assertNotNull(result);
    assertFalse(result.isEmpty());
    assertEquals(1, result.size());
    assertEquals(": \n", result.toString());
}
Also used : MultiMap(io.vertx.core.MultiMap) CaseInsensitiveHeaders(io.vertx.core.http.CaseInsensitiveHeaders) HashMap(java.util.HashMap) Test(org.junit.Test)

Example 25 with MultiMap

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

the class CaseInsensitiveHeadersTest method testCaseInsensitiveHeaders.

@Test
public void testCaseInsensitiveHeaders() throws Exception {
    MultiMap result = new CaseInsensitiveHeaders();
    assertNotNull(result);
    assertTrue(result.isEmpty());
    assertEquals(0, result.size());
    assertEquals("", result.toString());
}
Also used : MultiMap(io.vertx.core.MultiMap) CaseInsensitiveHeaders(io.vertx.core.http.CaseInsensitiveHeaders) Test(org.junit.Test)

Aggregations

MultiMap (io.vertx.core.MultiMap)87 Test (org.junit.Test)75 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 VertxException (io.vertx.core.VertxException)8 HttpClientRequest (io.vertx.core.http.HttpClientRequest)8 HttpMethod (io.vertx.core.http.HttpMethod)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 DeploymentOptions (io.vertx.core.DeploymentOptions)7 Future (io.vertx.core.Future)7