response.setHeader("name","foo"); Enumeration en=response.getHeaders("name"); assertEquals("foo",en.nextElement()); assertFalse(en.hasMoreElements()); response.addHeader("name","bar"); en=response.getHeaders("name"); assertEquals("foo",en.nextElement()); assertEquals("bar",en.nextElement()); assertFalse(en.hasMoreElements());
    public void testContentType()    	throws Exception    {        Response response = new Response(new HttpConnection(connector,connector.endp,connector.server));                assertEquals(null,response.getContentType());                response.setContentType("foo/bar");        assertEquals("foo/bar",response.getContentType());        response.getWriter();        assertEquals("foo/bar; charset=ISO-8859-1",response.getContentType());        response.setContentType("foo2/bar2");        assertEquals("foo2/bar2; charset=ISO-8859-1",response.getContentType());                response.recycle();                response.setContentType("text/html");        assertEquals("text/html",response.getContentType());        response.getWriter();        assertEquals("text/html; charset=ISO-8859-1",response.getContentType());        response.setContentType("foo2/bar2");        assertEquals("foo2/bar2; charset=ISO-8859-1",response.getContentType());    }