Search in sources :

Example 16 with ParameterizedHeader

use of org.glassfish.jersey.message.internal.ParameterizedHeader in project jersey by jersey.

the class ParameterizedHeadersMapTest method testGetFirst.

/**
     * Test of getFirst method, of class ParametrizedHeadersMap.
     */
@Test
public void testGetFirst() throws Exception {
    map.add("foo", new ParameterizedHeader("bar"));
    map.add("foo", new ParameterizedHeader("baz"));
    map.add("foo", new ParameterizedHeader("bop"));
    assertEquals(3, map.get("foo").size());
    assertEquals("bar", map.getFirst("foo").getValue());
}
Also used : ParameterizedHeader(org.glassfish.jersey.message.internal.ParameterizedHeader) Test(org.junit.Test)

Example 17 with ParameterizedHeader

use of org.glassfish.jersey.message.internal.ParameterizedHeader in project jersey by jersey.

the class ParameterizedHeadersMapTest method testKeySet.

/**
     * Test of keySet method, of class ParametrizedHeadersMap.
     */
@Test
public void testKeySet() throws Exception {
    map.add("foo", new ParameterizedHeader("bar"));
    map.add("baz", new ParameterizedHeader("bop"));
    Set<String> keySet = map.keySet();
    assertNotNull(keySet);
    assertEquals(2, keySet.size());
    assertTrue(keySet.contains("foo"));
    assertTrue(!keySet.contains("bar"));
    assertTrue(keySet.contains("baz"));
    assertTrue(!keySet.contains("bop"));
// TODO - detailed tests for the HeadersKeys methods
}
Also used : ParameterizedHeader(org.glassfish.jersey.message.internal.ParameterizedHeader) Test(org.junit.Test)

Example 18 with ParameterizedHeader

use of org.glassfish.jersey.message.internal.ParameterizedHeader in project jersey by jersey.

the class ParameterizedHeadersMapTest method testIsEmpty.

/**
     * Test of isEmpty method, of class ParametrizedHeadersMap.
     */
@Test
public void testIsEmpty() throws Exception {
    assertTrue(map.isEmpty());
    map.add("foo", new ParameterizedHeader("bar"));
    assertTrue(!map.isEmpty());
    map.clear();
    assertTrue(map.isEmpty());
}
Also used : ParameterizedHeader(org.glassfish.jersey.message.internal.ParameterizedHeader) Test(org.junit.Test)

Aggregations

ParameterizedHeader (org.glassfish.jersey.message.internal.ParameterizedHeader)18 Test (org.junit.Test)18 ArrayList (java.util.ArrayList)7 HashMap (java.util.HashMap)2 List (java.util.List)2 Entry (java.util.Map.Entry)1