checkParserState(xpp, 1, xpp.END_TAG, "foo", null, false, -1);
checkParserState(xpp, 1, XmlPullParser.END_TAG, "foo", null, false, -1);
    public void testSimpleWriter() throws Exception {        XmlSerializer ser = factory.newSerializer();        PackageTests.addNote("* default serializer "+ser.getClass()+"\n");                //assert there is error if trying to write                //assert there is error if trying to write        try {            ser.startTag(null, "foo");            fail("exception was expected of serializer if no input was set on parser");        } catch(Exception ex) {}                ser.setOutput(null);                //assert there is error if trying to write        try {            ser.startTag(null, "foo");            fail("exception was expected of serializer if no input was set on parser");        } catch(Exception ex) {}                StringWriter sw = new StringWriter();                ser.setOutput(sw);                try {            ser.setOutput(null, null);            fail("exception was expected of setOutput() if output stream is null");        } catch(IllegalArgumentException ex) {}                //check get property                ser.setOutput(sw);                //assertEquals(null, ser.getOutputEncoding());                ser.startDocument("ISO-8859-1", Boolean.TRUE);        ser.startTag(null, "foo");                ser.endTag(null, "foo");        ser.endDocument();                // now validate that can be deserialzied                //xpp.setInput(new StringReader("<foo></foo>"));        String serialized = sw.toString();        xpp.setInput(new StringReader(serialized));                assertEquals(null, xpp.getInputEncoding());        checkParserState(xpp, 0, xpp.START_DOCUMENT, null, null, false, -1);        xpp.next();        checkParserState(xpp, 1, xpp.START_TAG, "foo", null, xpp.isEmptyElementTag() /*empty*/, 0);        xpp.next();        checkParserState(xpp, 1, xpp.END_TAG, "foo", null, false, -1);        xpp.next();        checkParserState(xpp, 0, xpp.END_DOCUMENT, null, null, false, -1);    }