@Test
    public void testAttributeParsing() throws BOSHException {
        AbstractBody body = createBody();
        assertNotNull(body);
        assertAttribute(body, BodyQName.createBOSH("foo"), null);
        Map<BodyQName, String> expected = new HashMap<BodyQName, String>();
        expected.put(Attributes.CONTENT, "text/xml; charset=utf-8");
        expected.put(Attributes.HOLD, "1");
        expected.put(Attributes.RID, "1573741820");
        expected.put(Attributes.TO, "server.com");
        expected.put(Attributes.ROUTE, "xmpp:server.com:6222");
        expected.put(Attributes.SECURE, "false");
        expected.put(Attributes.VER, "1.6");
        expected.put(Attributes.WAIT, "60");
        expected.put(Attributes.ACK, "1");
        expected.put(Attributes.XML_LANG, "en");

        Set<BodyQName> attrs = new HashSet<BodyQName>(body.getAttributeNames());
        Iterator<BodyQName> iter = expected.keySet().iterator();
        while (iter.hasNext()) {
            BodyQName name = iter.next();
            assertNotNull(name);
            String expectedVal = expected.get(name);
            assertNotNull(expectedVal);
            assertEquals("Attribute '" + name.getLocalPart()
                    + "' value incorrect", expectedVal,
                    body.getAttribute(name));
            assertTrue(attrs.remove(name));
            iter.remove();
        }
        assertEquals(0, attrs.size());
        assertEquals(0, expected.size());
    }