checkParserState(xpp, 0, xpp.START_DOCUMENT, null, null, false, -1);
checkParserState(xpp, 0, XmlPullParser.START_DOCUMENT, null, null, false, -1);
    public void testSimpleSerWithAttribute() throws Exception {        XmlSerializer ser = factory.newSerializer();        // one step further - it has an attribute and content ...                StringWriter sw = new StringWriter();                assertEquals(0, ser.getDepth());        ser.setOutput(sw);        assertEquals(0, ser.getDepth());                ser.startDocument(null, null);        assertEquals(0, ser.getDepth());        assertEquals(null, ser.getNamespace());        assertEquals(null, ser.getName());                ser.startTag(null, "foo");        assertEquals(1, ser.getDepth());        assertEquals(null, ser.getNamespace());        assertEquals("foo", ser.getName());                ser.attribute(null, "attrName", "attrVal");        assertEquals(1, ser.getDepth());        assertEquals(null, ser.getNamespace());        assertEquals("foo", ser.getName());                ser.text("bar");        assertEquals(1, ser.getDepth());        assertEquals(null, ser.getNamespace());        assertEquals("foo", ser.getName());                ser.startTag("", "p:t");        assertEquals(2, ser.getDepth());        assertEquals("", ser.getNamespace());        assertEquals("p:t", ser.getName());                ser.text("\n\t ");                ser.endTag("", "p:t");        assertEquals(1, ser.getDepth());        assertEquals(null, ser.getNamespace());        assertEquals("foo", ser.getName());                ser.endTag(null, "foo");        assertEquals(0, ser.getDepth());        assertEquals(null, ser.getNamespace());        assertEquals(null, ser.getName());                ser.endDocument();        assertEquals(0, ser.getDepth());        assertEquals(null, ser.getNamespace());        assertEquals(null, ser.getName());                //xpp.setInput(new StringReader("<foo attrName='attrVal'>bar<p:t>\r\n\t </p:t></foo>"));        String serialized = sw.toString();        xpp.setInput(new StringReader(serialized));        checkParserState(xpp, 0, xpp.START_DOCUMENT, null, null, false, -1);        xpp.next();        checkParserState(xpp, 1, xpp.START_TAG, "foo", null, false, 1);        checkAttrib(xpp, 0, "attrName", "attrVal");        xpp.next();        checkParserState(xpp, 1, xpp.TEXT, null, "bar", false, -1);        assertEquals(false, xpp.isWhitespace());        xpp.next();        checkParserState(xpp, 2, xpp.START_TAG, "p:t", null, false, 0);        xpp.next();        checkParserState(xpp, 2, xpp.TEXT, null, "\n\t ", false, -1);        assertTrue(xpp.isWhitespace());        xpp.next();        checkParserState(xpp, 2, xpp.END_TAG, "p:t", null, false, -1);        xpp.next();        checkParserState(xpp, 1, xpp.END_TAG, "foo", null, false, -1);        xpp.next();        checkParserState(xpp, 0, xpp.END_DOCUMENT, null, null, false, -1);                    }