checkParserState(xpp, 1, xpp.TEXT, null, "test", false, -1);
checkParserState(xpp, 1, XmlPullParser.TEXT, null, "test", false, -1);
    public void testSimpleStream() throws Exception {        XmlSerializer ser = factory.newSerializer();                ByteArrayOutputStream baos = new ByteArrayOutputStream();        ser.setOutput(baos, "UTF-8");        ser.startDocument("UTF-8", null);        ser.startTag("", "foo");        ser.text("test");        ser.endTag("", "foo");        ser.endDocument();                //check taking input form input stream        //byte[] binput = "<foo>test</foo>".getBytes("UTF8");                byte[] binput = baos.toByteArray();                xpp.setInput(new ByteArrayInputStream( binput ), "UTF-8" );        assertEquals("UTF-8", xpp.getInputEncoding());                //xpp.setInput(new StringReader( "<foo/>" ) );        checkParserState(xpp, 0, xpp.START_DOCUMENT, null, null, false, -1);        xpp.next();        checkParserState(xpp, 1, xpp.START_TAG, "foo", null, false /*empty*/, 0);        xpp.next();        checkParserState(xpp, 1, xpp.TEXT, null, "test", false, -1);        assertEquals(false, xpp.isWhitespace());        xpp.next();        checkParserState(xpp, 1, xpp.END_TAG, "foo", null, false, -1);        xpp.next();        checkParserState(xpp, 0, xpp.END_DOCUMENT, null, null, false, -1);    }